|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.core.RTIConnection
public abstract class RTIConnection
As discussed in the documentation on the wiki, the entire
communications sub-system is abstracted from the rest of the RTI. The RTIConnection
class is something of the facade that enables this. Communications-binding specific
implementations should extends this class, providing implementations of the abstract methods.
The other methods generally exist for convenience in the subclasses or for use by the RTI. You
shouldn't need to override them, although you can if you wish.
Field Summary | |
---|---|
private com.lbf.commons.messaging.IMessageHandler |
requestHandler
|
protected RTIExec |
rti
|
Constructor Summary | |
---|---|
RTIConnection()
|
Method Summary | |
---|---|
abstract void |
close(String reason)
This method should close the connection to the client. |
RTIExec |
getRtiExecution()
Fetches the RTIExec that has been associated with this connection. |
boolean |
harvestConnection()
This method will ask the Reaper to harvest it. |
void |
receiveRequest(com.lbf.commons.messaging.MessageContext context)
This is the method to which all incoming requests from the LRC should be passed when they are received by the implemention-specific subclasses of RTIConnection . |
abstract void |
sendCallback(com.lbf.commons.messaging.MessageContext context)
This method should be implemented by all subclasses in a manner specific to the communication mechanism that is in use. |
void |
setRequestHandler(com.lbf.commons.messaging.IMessageHandler handler)
This is called automatically by the framework when the connection is attached to a federate. |
void |
setRtiExecution(RTIExec rti)
Like setRequestHandler(IMessageHandler) , this method is called automatically by
the framework. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private com.lbf.commons.messaging.IMessageHandler requestHandler
protected RTIExec rti
Constructor Detail |
---|
public RTIConnection()
Method Detail |
---|
public void receiveRequest(com.lbf.commons.messaging.MessageContext context)
RTIConnection
. If you
are implementing a connection, pass any messages you receive to this method.
This method will take the given message and pass it to the request handler associated with
this connection. You don't need to set that handler, it will be done automatically by the
RTIExec
when a federate joins a federation. Once the call is over, the appropriate
response should be in the context. If an exception occurs, it is wrapped in an exception
response message and placed into the context.
public void setRequestHandler(com.lbf.commons.messaging.IMessageHandler handler)
receiveRequest(MessageContext)
to pass it messages when they are
received.
public void setRtiExecution(RTIExec rti)
setRequestHandler(IMessageHandler)
, this method is called automatically by
the framework. This is currently done in the FedexFactory
, as a federate is created.
public RTIExec getRtiExecution()
RTIExec
that has been associated with this connection. If you call this
too soon, it may be null. If should be set in the FedexFactory
when the federate is
being created.
public boolean harvestConnection()
Reaper
for more information.
public abstract void sendCallback(com.lbf.commons.messaging.MessageContext context) throws Exception
Exception
public abstract void close(String reason)
reason
- Textual description of why the connection is being closed. Note that this may
be null, so be sure to check before using it
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |