galaxy.server
Class DataInBrokerProxy
java.lang.Object
|
+--galaxy.server.DataInBrokerProxy
- public class DataInBrokerProxy
- extends java.lang.Object
This class encapsulates a DataInBroker
.
Method Summary |
protected void |
abortReceived()
This method is called when the DataInBroker that is
associated with this proxy catches an unexpected exception while
receiving brokered data. |
protected void |
cleanup()
This cleanup method is called when the DataInBroker that is
associated with this proxy is preparing to stop. |
protected void |
disconnectReceived()
This method is called when the DataInBroker that is
associated with this proxy receives a disconnect message
from the outgoing broker (indicates all data has been received). |
java.lang.Object |
getObject(boolean wait)
Returns the object associated with this broker. |
protected void |
receivedObject(java.lang.Object obj)
If this proxy is configured to handle data immediately as it is read
into the associated DataInBroker , this method is called
each time the broker receives an object's worth of data. |
void |
start()
This method starts the underlying DataInBroker , if it
exists. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
proxy
protected BrokerProxy proxy
server
protected Server server
immediate
protected boolean immediate
DataInBrokerProxy
public DataInBrokerProxy(Server server,
BrokerProxy proxy,
boolean immediate,
boolean startBroker)
throws java.io.IOException
- Creates an inbound broker proxy.
- Parameters:
server
- the Server
that is creating this proxyproxy
- the Proxy
that is associated with the
target DataOutBroker
.immediate
- if true, the receivedObject
method of
this proxy is called each time the broker receives
an object's worth of data.startBroker
- if true, the DataInBroker
associated
with this proxy is started
receivedObject
protected void receivedObject(java.lang.Object obj)
- If this proxy is configured to handle data immediately as it is read
into the associated
DataInBroker
, this method is called
each time the broker receives an object's worth of data. If this proxy
is not configured to handle data as it comes in, this method is only
called when the broker receives a disconnect message from the outgoing
broker. Override this method to provide your own data handling routine.
disconnectReceived
protected void disconnectReceived()
- This method is called when the
DataInBroker
that is
associated with this proxy receives a disconnect message
from the outgoing broker (indicates all data has been received).
Override this method to provide your own customized finalization
routine. This broker is stopped after this method is called.
abortReceived
protected void abortReceived()
- This method is called when the
DataInBroker
that is
associated with this proxy catches an unexpected exception while
receiving brokered data.
Override this method to provide your own customized error handling
routine. This broker is stopped after this method is called.
cleanup
protected void cleanup()
- This cleanup method is called when the
DataInBroker
that is
associated with this proxy is preparing to stop. Override this method to
provide your own customized cleanup routine.
The generic DataInBroker
cleanup will still take place.
start
public void start()
- This method starts the underlying
DataInBroker
, if it
exists.
getObject
public java.lang.Object getObject(boolean wait)
throws java.io.IOException
- Returns the object associated with this broker. If the target
outbound broker is brokering an "any" stream (e.g., the
DataOutBrokerProxy
object is brokering an object of type
-1), this method returns null. Use the receivedObject
method to retrieve and processe the brokered data in this case.
- Parameters:
wait
- if true, this method will not return until a non-null
object is received, else it will return immediately
(returning the object even if it is still null).- Returns:
- the object associated with this broker (may be null).
- Throws:
java.io.IOException
- if there was a problem while creating the in broker
and retrieving the object