Remote System Explorer DataStore
Release 3.2

org.eclipse.dstore.core.util
Class Receiver

java.lang.Object
  extended by java.lang.Thread
      extended by org.eclipse.dstore.core.server.SecuredThread
          extended by org.eclipse.dstore.core.util.Receiver
All Implemented Interfaces:
Runnable, IDataStorePreferenceListener
Direct Known Subclasses:
ServerReceiver

public abstract class Receiver
extends SecuredThread
implements IDataStorePreferenceListener

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

Since:
3.0 Moved from non-API to API

Field Summary
protected  boolean _canExit
           
 
Fields inherited from class org.eclipse.dstore.core.server.SecuredThread
_dataStore
 
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 preferenceChanged(String property, String value)
          A DataStore preference has changed
 void run()
          Called when the receiver thread is running
 Socket socket()
          Returns the associated socket
 
Methods inherited from class org.eclipse.dstore.core.server.SecuredThread
setDataStore
 
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

_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

Specified by:
run in interface Runnable
Overrides:
run in class SecuredThread

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

preferenceChanged

public void preferenceChanged(String property,
                              String value)
Description copied from interface: IDataStorePreferenceListener
A DataStore preference has changed

Specified by:
preferenceChanged in interface IDataStorePreferenceListener
Parameters:
property - the property that has changed
value - the value of the property

Remote System Explorer DataStore
Release 3.2

Copyright (c) IBM Corporation and others 2000, 2010. All Rights Reserved.