org.portico.binding.jvm
Class JVMServerConnection
java.lang.Object
org.portico.core.RTIConnection
org.portico.binding.jvm.JVMServerConnection
public class JVMServerConnection
- extends RTIConnection
This is the JVM-binding RTIConnection
implementation that provides a link back to a
specific federate so that the RTI can contact it for callbacks.
This class acts much like a unix pipe. If effectively attaches its outgoing channel to the
incoming channel of its associated JVMClientConnection
. On the other side, the same
thing happens, and outgoing messages for the client connection are routed to the incoming
message handler of this class (see RTIConnection.receiveRequest(MessageContext)
).
Method Summary |
void |
close(String reason)
Called when the connection should close (for whatever reason). |
void |
sendCallback(com.lbf.commons.messaging.MessageContext context)
Passes the given message over to the linked JVMClientConnection where it is given
to the LRC for processing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
client
private JVMClientConnection client
JVMServerConnection
public JVMServerConnection(JVMClientConnection client)
throws JException
- Creates a new
JVMServerConnection
that is associated with a specific client through
the given JVMClientConnection
. Through the client connection, the federate can be
contacted.
- Throws:
JException
sendCallback
public void sendCallback(com.lbf.commons.messaging.MessageContext context)
throws Exception
- Passes the given message over to the linked
JVMClientConnection
where it is given
to the LRC for processing. If an error occurs, an exception response is packaged into the
context and processing ends.
- Specified by:
sendCallback
in class RTIConnection
- Throws:
Exception
close
public void close(String reason)
- Called when the connection should close (for whatever reason). This method will break any
connection between this instance and the associated
JVMClientConnection
by first
setting any of its references to this instance to null, and then setting local references
to the client to null.
- Specified by:
close
in class RTIConnection
- Parameters:
reason
- Textual description of why the connection is being closed. Note that this may
be null, so be sure to check before using it