Remote Systems
v6.4.1

com.ibm.etools.systems.dstore.core.util
Class Receiver

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.ibm.etools.systems.dstore.core.util.Receiver
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
ClientReceiver, ServerReceiver

public abstract class Receiver
extends Thread

This class is used for receiving data from a socket in the DataStore communication layer.


Field Summary
protected  boolean _canExit
           
protected  DataStore _dataStore
           
static String Copyright
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Receiver(Socket socket, DataStore dataStore)
          Constructor
 
Method Summary
 boolean canExit()
          Indicates that the receiver can stop receiving data from the socket.
 void finish()
          Called when a DataStore connection is terminated.
abstract  void handleDocument(DataElement documentObject)
          Implemented to provide a means of handling received input
abstract  void handleError(Throwable e)
          Implemented to provide a means of handling errors in the communication layer
 void handleInput()
          Periodically called to receive data from the socket
 void run()
          Called when the receiver thread is running
 Socket socket()
          Returns the associated socket
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_dataStore

protected DataStore _dataStore

_canExit

protected boolean _canExit
Constructor Detail

Receiver

public Receiver(Socket socket,
                DataStore dataStore)
Constructor

Parameters:
socket - the socket to read from
dataStore - the associated DataStore
Method Detail

finish

public void finish()
Called when a DataStore connection is terminated.


canExit

public boolean canExit()
Indicates that the receiver can stop receiving data from the socket.

Returns:
true if the receiver can stop

run

public void run()
Called when the receiver thread is running


handleInput

public void handleInput()
Periodically called to receive data from the socket


socket

public Socket socket()
Returns the associated socket

Returns:
the socket

handleDocument

public abstract void handleDocument(DataElement documentObject)
Implemented to provide a means of handling received input

Parameters:
documentObject - the root object of the received data

handleError

public abstract void handleError(Throwable e)
Implemented to provide a means of handling errors in the communication layer

Parameters:
e - an exception that occurred

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.