|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.xbus.technical.file.FileBase
net.sf.xbus.technical.file.FileReceiver
public class FileReceiver
When the FileReceiver receives a request it reads the files
into a String and calls the application layer.
| Field Summary | |
|---|---|
protected FileReceiverConfiguration |
mConfiguration
|
protected java.lang.String |
mCopyname
Full path name of the copy from the original file to be read. |
| Constructor Summary | |
|---|---|
FileReceiver()
|
|
| Method Summary | |
|---|---|
void |
close()
Is not implemented for file system |
void |
commit()
Implemented method commit from TAResource interface. |
protected boolean |
doReceive(XBUSSystem xbusSystem)
Manages the process of receipt for several XBUSSystems. |
java.lang.String |
getConfigFilename()
|
java.lang.String |
getOnError()
|
protected java.lang.Object |
getRequestContent()
getRequestContent delivers the content of the request. |
java.lang.String |
getType()
A Receiver can receive data either as a
String or as an Object from a neighboring
system. |
void |
open()
Is not implemented for file system |
void |
readConfiguration(java.lang.String systemName)
Reads some entries from the configuration. |
void |
receive(java.lang.String systemName)
This method manages all processes of the receipt for one as parameter given name of the neighbor-system. |
void |
rollback()
Implemented method rollback from TAResource ignores all
changes have made since the beginning of the process (transaction). |
| Methods inherited from class net.sf.xbus.technical.file.FileBase |
|---|
copyFile, deleteFile, getEncoding, getFileLength, getLastByteOfFile, renameFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected FileReceiverConfiguration mConfiguration
protected java.lang.String mCopyname
| Constructor Detail |
|---|
public FileReceiver()
| Method Detail |
|---|
public void receive(java.lang.String systemName)
First, the list of XBUSSystemfor
this system is determined by replacing the markers for additional
adresses.
After that for each XBUSSystem the method doReceive(XBUSSystem)
is invoked to read the file and process its content.
receive in interface ReceiverSingleInterfacesystemName - name of the interface definition
XException - if something goes wrongXBUSSystem.getSystems(String, String)
public void readConfiguration(java.lang.String systemName)
throws XException
systemName -
XException - if anything goes wrongprotected boolean doReceive(XBUSSystem xbusSystem)
xbusSystem - name of the interface definition
protected java.lang.Object getRequestContent()
throws XException
getRequestContent delivers the content of the request.
Subclasses may define their own request content.
String but casted to
Object for compliance reasons
XException
public void commit()
throws XException
commit from TAResource interface. The
purpose of commit actions is to remove any backup information that had
been created during process(tansaction).
Depending on the FinalResolution, the following acts commit all actions.
| Resolution | Acts |
|---|---|
| Preserve | delete copy file |
| Rename | delete backup copy |
| Delete | 1. delete copy file 2. delete backup copy |
commit in interface TAResourceXException - if any error occursTAResource.commit()
public void rollback()
throws XException
rollback from TAResource ignores all
changes have made since the beginning of the process (transaction).
Depending on the FinalResolution, the following acts roll back all modifications that have been made in the file system:
| Resolution | Acts |
|---|---|
| Preserve | delete copy file |
| Rename | 1. rename backup copy to the original file 2. delete copy file |
| Delete | 1. rename backup copy to the original file 2. delete copy file |
rollback in interface TAResourceXException - if any error occursTAResource.rollback()public void open()
open in interface TAResourcepublic java.lang.String getConfigFilename()
public java.lang.String getOnError()
public void close()
close in interface TAResourcepublic java.lang.String getType()
ReceiverReceiver can receive data either as a
String or as an Object from a neighboring
system.Strings, getType
returns Constants.TYPE_TEXTObjects, getType
returns Constants.TYPE_OBJECT
getType in interface Receiver
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||