|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--galaxy.server.DataOutBroker
This class represents the supplier of a brokering connection. It accepts
multiple client connections and serves data to these clients. A timeout
can be specified for DataOutBroker
. Once the timeout expires,
no new client connections are accepted, but the broker will continue to
serve up data until it is done (i.e., when a DisconnectMessage
is written to its output data structure). The brokered data is cached and
the broker can serve this data to new clients as they connect.
Constructor Summary | |
DataOutBroker(Server server,
int pollMilliseconds,
int timeoutSeconds)
Constructor. |
Method Summary | |
void |
close()
Tells this broker to disconnect from its clients once it times out. |
protected void |
connectionEstablished()
This method is called when this broker establishes a connection with a new inbound broker. |
protected void |
disconnectReceived()
This method is called when this broker is told to disconnect from its client inbound brokers (once it times out). |
void |
expire()
Forces this broker to time out, preventing any additional client connections from being established. |
java.lang.String |
getCallId()
Returns the call id associated with this broker. |
static int |
getCallIdIndex()
Returns a call id unique to the current Java virtual machine. |
boolean |
isExpired()
Indicates if this broker has timed out. |
boolean |
isStopped()
Indicates if this broker is stopped. |
void |
populateFrame(GFrame frame,
java.lang.String hostKey,
java.lang.String portKey)
Populates a frame that is announcing the availability of brokered data with the broker's contact information. |
void |
run()
Outgoing broker thread runs a polling loop, waiting for data to write to clients. |
void |
stop()
Marks this broker's thread as being stopped. |
void |
write(java.lang.Object obj)
Adds data to this broker's incoming data buffer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataOutBroker(Server server, int pollMilliseconds, int timeoutSeconds)
server
- the Server
that created this brokerpollMilliseconds
- the polling cycle in milliseconds. If less than
or equal to zero, default poll is used.timeoutSeconds
- timeout in seconds for this broker. If zero,
default timeout is used. If less than zero,
broker never times out.Method Detail |
public static int getCallIdIndex()
public java.lang.String getCallId()
public boolean isExpired()
public void expire()
public boolean isStopped()
public void run()
run
in interface java.lang.Runnable
public void stop()
public void populateFrame(GFrame frame, java.lang.String hostKey, java.lang.String portKey)
frame
- the frame to populatehostKey
- the name of the broker's host name frame keyportKey
- the name of the broker's listener port frame keypublic void write(java.lang.Object obj)
obj
- the data object to add to the bufferpublic void close()
protected void connectionEstablished()
protected void disconnectReceived()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |