|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ninja.rmi.NinjaRemoteObject | +--ninja.ispace.iSpaceService | +--ninja.activeproxy.path.SDSOperator | +--ninja.activeproxy.path.Operator
Operator is the base abstract class that other operators should inherit from. There is only one method that operators must implement: run().
Field Summary | |
private java.util.Hashtable |
pathIDToInputConnector
|
private java.util.Hashtable |
pathIDToOperatorToNotify
|
private java.util.Hashtable |
pathIDToOutputConnector
|
private java.util.Hashtable |
pathIDToPathDescription
|
private java.util.Hashtable |
pathIDToReader
|
private java.util.Hashtable |
pathIDToRebuildFlag
|
private java.util.Hashtable |
pathIDToWriter
|
private java.util.Hashtable |
threadToPathID
|
Fields inherited from class ninja.activeproxy.path.SDSOperator |
descr,
running,
serviceName,
xmlData |
Fields inherited from class ninja.rmi.NinjaRemoteObject |
servref |
Constructor Summary | |
Operator()
|
Method Summary | |
java.lang.Object |
getCommunicationInfo(java.lang.Object pathID)
Returns an object which the previous operator in the path will use to create a connection with this operator. |
java.lang.String |
getIdentification()
Returns "local_hostname:current_time". |
java.lang.String |
getOperatorDescription()
Returns an operator description. |
OperatorIF |
getOperatorToNotify(java.lang.Object pathID)
Returns the operator which would be notified in case of path failure. |
PathDescription |
getPathDescription(java.lang.Object pathID)
|
java.lang.Object |
getPathID(java.lang.Thread thread)
Returns the pathID handled by the given thread. |
PathInputStream |
getReader(java.lang.Object pathID)
Returns the reader for this operator in the path with given ID. |
private java.lang.Thread |
getThread(java.lang.Object pathID)
|
PathOutputStream |
getWriter(java.lang.Object pathID)
Returns the writer for this operator in the path with the given ID. |
java.net.InetAddress |
hostName()
|
boolean |
isPathAlive(java.lang.Object pathID)
Determines if the path specified by the given path ID still runs (there is a thread handling this path) through this operator. |
boolean |
isReaderReady(java.lang.Object pathID)
Determines if the reader for this operator in the path has been set. |
boolean |
isReady(java.lang.Object pathID)
Determines if the reader and writer for this operator in the path have been set. |
boolean |
isWriterReady(java.lang.Object pathID)
Determines if the writer for this operator in the path has been set. |
void |
kill(java.lang.Object pathID)
Tears down the connections established by this operator in the path, cleans up state associated with this path and kills its thread of execution. |
void |
loadInputConnector(java.net.URL inputConnectorURL,
java.lang.String inputConnectorClass,
java.lang.Object pathID)
Loads and instantiates the input connector. |
void |
loadOutputConnector(java.net.URL outputConnectorURL,
java.lang.String outputConnectorClass,
java.lang.Object pathID)
Loads and instantiates the output connector. |
void |
pathFailed(java.lang.Object pathID)
Notifies another operator that path failed (previous operator, source operator where path originated or whatever operator was set by setOperatorToNotify. |
void |
resume(java.lang.Object pathID)
Resume the thread managing the specified pathID. |
abstract void |
run()
|
void |
setOperatorToNotify(OperatorIF operatorToNotify,
java.lang.Object pathID)
Sets the operator to notify in case of path failure; used for failure detection while the path is running. |
void |
setPathDescription(PathDescription path,
java.lang.Object pid)
|
void |
setReader(java.io.InputStream reader,
java.lang.Object pathID)
Sets the reader for this operator in the path with the given ID. |
void |
setupReader(java.lang.Object pathID)
Sets up the reader for this operator in the path with the given ID. |
void |
setupWriter(OperatorIF nextOperator,
java.lang.Object pathID)
Sets up the writer for this operator in the path with the given ID. |
void |
setWriter(java.io.OutputStream writer,
java.lang.Object pathID)
Sets the writer for this operator in the path with the given ID. |
void |
start(java.lang.Object pathID)
Starts a new thread of execution in the operator to service the path identified by path ID. |
void |
suspend(java.lang.Object pathID)
Suspend the thread managing the specified pathID. |
Methods inherited from class ninja.activeproxy.path.SDSOperator |
destroy,
getDescription,
GetServiceDescriptor,
GetServiceName,
init |
Methods inherited from class ninja.rmi.NinjaRemoteObject |
exportObject,
getStub,
unexportObject |
Methods inherited from class java.lang.Object |
|
Field Detail |
private java.util.Hashtable threadToPathID
private java.util.Hashtable pathIDToInputConnector
private java.util.Hashtable pathIDToOutputConnector
private java.util.Hashtable pathIDToReader
private java.util.Hashtable pathIDToWriter
private java.util.Hashtable pathIDToOperatorToNotify
private java.util.Hashtable pathIDToPathDescription
private java.util.Hashtable pathIDToRebuildFlag
Constructor Detail |
public Operator() throws java.rmi.RemoteException
Method Detail |
public void loadInputConnector(java.net.URL inputConnectorURL, java.lang.String inputConnectorClass, java.lang.Object pathID) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.rmi.RemoteException
inputConnectorURL
- URL where the input connector can be downloaded from.inputConnectorClass
- input connector class.pathID
- path ID.public void loadOutputConnector(java.net.URL outputConnectorURL, java.lang.String outputConnectorClass, java.lang.Object pathID) throws java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.rmi.RemoteException
outputConnectorURL
- URL where the output connector can be downloaded from.outputConnectorClass
- output connector class.pathID
- path ID.public void setupReader(java.lang.Object pathID) throws InvalidPathIDException, java.rmi.RemoteException
pathID
- path ID.public void setupWriter(OperatorIF nextOperator, java.lang.Object pathID) throws InvalidPathIDException, java.rmi.RemoteException
pathID
- path ID.nextOperator
- next operator in the path.public void setOperatorToNotify(OperatorIF operatorToNotify, java.lang.Object pathID) throws java.rmi.RemoteException
operatorToNotify
- operator to be notified in case of path failure.pathID
- path ID.public OperatorIF getOperatorToNotify(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.public java.lang.Object getCommunicationInfo(java.lang.Object pathID) throws InvalidPathIDException, java.rmi.RemoteException
pathID
- path ID.public void pathFailed(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.private java.lang.Thread getThread(java.lang.Object pathID)
public boolean isPathAlive(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.public boolean isReady(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.public boolean isReaderReady(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.public boolean isWriterReady(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- path ID.public void start(java.lang.Object pathID) throws InvalidPathIDException, java.rmi.RemoteException
pathID
- path ID.public void suspend(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- The pathID to suspend.public void resume(java.lang.Object pathID) throws java.rmi.RemoteException
pathID
- The pathID to resume.public void kill(java.lang.Object pathID)
pathID
- path ID.public java.lang.String getIdentification() throws java.rmi.RemoteException
public java.net.InetAddress hostName() throws java.rmi.RemoteException
public java.lang.Object getPathID(java.lang.Thread thread)
thread
- thread handling path going through operator.public void setReader(java.io.InputStream reader, java.lang.Object pathID)
reader
- input stream to read from.pathID
- path ID.public PathInputStream getReader(java.lang.Object pathID)
pathID
- path ID.public void setWriter(java.io.OutputStream writer, java.lang.Object pathID)
writer
- output stream to write to.pathID
- path ID.public PathOutputStream getWriter(java.lang.Object pathID)
pathID
- path ID.public java.lang.String getOperatorDescription() throws java.rmi.RemoteException
public void setPathDescription(PathDescription path, java.lang.Object pid)
public PathDescription getPathDescription(java.lang.Object pathID)
public abstract void run()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |