|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RemoteTransferListener
A class that implements this interface can be registered with the ClientBrokerFactory. The pair of listener methods (transferWrite and transferRead) will then be invoked in two situations. 1) As data is loaded from the database by queries, extents, or id lookups, and 2) As objects are created or updated on the client and committed.
Note, that your class that implements this interface must be serializable. Your Read and Write methods may only access fields of your object that are in the Default Fetch Group. Please take care to make sure that your methods read and write corresponding values to the data stream for each object. If they don't, your reader will likely raise excepitons becuase it will be unable to correctly read the reamining objects transferred during the operation.
Usage: application code running on the machine using the remote broker.
import kodo.remote.*;
import kodo.conf.*;
kodo.kernel.BrokerFactory
factory = Bootstrap.getBrokerFactory
(System.getProperties ());
factory.addTransferListener (new MyTransferListener ());
class MyTransferListener ()
implements RemoteTransferListener
{
public void transferWrite (Object pcObject, ObjectOutput
outStream, boolean serverToClient) {
// Depending upon class of pcObject, write external data into
// the output stream.
}
public void transferRead (Object pcObject,
ObjectInput
inStream, boolean serverToClient) {
// Depending upon class of pcObject, read external data from
// the input stream.
}
};
For example, each of your Employee objects might have an associated external png image file. When your application causes an Employee object to be loaded from the database the transferWrite () method will be invoked on the server machine. Your listener transferWrite method can then open the png disk file and write it into the ObjectOutput stream. Then, your listener's transferRead () method will be invoked at the remote persistent manager where it can read the image from the stream and write it to a local file.
Method Summary | |
---|---|
void |
transferRead(Object pcObject,
ObjectInput inStream,
boolean serverToClient)
Notification that your persistent capable object (pcObject) is being transfered between the remote persistent manager and the server persistent manager. |
void |
transferWrite(Object pcObject,
ObjectOutput outStream,
boolean serverToClient)
Notification that your persistent capable object (pcObject) is being transfered between the remote persistent manager and the server persistent manager. |
Method Detail |
---|
void transferWrite(Object pcObject, ObjectOutput outStream, boolean serverToClient)
void transferRead(Object pcObject, ObjectInput inStream, boolean serverToClient)
|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |