|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.mobilityrpc.controller.impl.MobilityControllerImpl
public class MobilityControllerImpl
| Constructor Summary | |
|---|---|
MobilityControllerImpl()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Calls destroy() on the connection controller, which will unbind all connection listeners, disconnect
all open connections and shut down the threads which were managing connections. |
ConnectionManager |
getConnectionManager()
Returns the ConnectionManager which manages connections for this controller. |
MobilitySessionInternal |
getMessageHandlingSession(UUID sessionId)
|
MobilitySession |
getSession(UUID sessionId)
Returns the existing session with the specified id, or if no such session with the id exists, (re)creates a new session with the same id and adds it to the session registry. |
MobilitySession |
newSession()
Creates a new session, with a newly generated UUID, and adds it to the session registry. |
void |
receiveIncomingMessage(ConnectionId connectionId,
byte[] message)
Supplies the message to the handler for it to be processed. |
void |
releaseSession(UUID sessionId)
Releases the given session immediately, if it is registered. |
void |
sendOutgoingMessage(ConnectionId identifier,
Object message)
Serializes the supplied message object and submits it to the outgoing message queue of the connection indicated, such that it will be sent to the machine at the other end of the connection for processing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MobilityControllerImpl()
| Method Detail |
|---|
public void receiveIncomingMessage(ConnectionId connectionId,
byte[] message)
IncomingMessageHandler
receiveIncomingMessage in interface IncomingMessageHandlerconnectionId - Identifies the connection from which the message was receivedmessage - The message to supply
public void sendOutgoingMessage(ConnectionId identifier,
Object message)
OutgoingMessageHandlercom.googlecode.mobilityrpc.protocol.pojo package, such that it can be serialized to its protobuf counterpart
representation.
The object supplied will be serialized to protobuf format synchronously inside this method, by the thread
calling this method. The method will only then submit the message in protobuf format to the connection's
outgoing message queue, where it will be sent asynchronously.
As such if the object supplied cannot be serialized to protobuf format, this method will throw an exception
to the code calling this method. This method does not block.
sendOutgoingMessage in interface OutgoingMessageHandleridentifier - Identifies the connection through which the message should be sentmessage - A java object representation of a protocol messagepublic ConnectionManager getConnectionManager()
MobilityControllerConnectionManager which manages connections for this controller.
getConnectionManager in interface MobilityControllerConnectionManager which manages connections for this controllerpublic void destroy()
destroy() on the connection controller, which will unbind all connection listeners, disconnect
all open connections and shut down the threads which were managing connections.
destroy in interface Destroyabledestroy in interface MobilityControllerpublic MobilitySession getSession(UUID sessionId)
MobilityController
getSession in interface MobilityControllersessionId - The session id of the session to return
public MobilitySession newSession()
MobilityController
newSession in interface MobilityControllerpublic void releaseSession(UUID sessionId)
MobilityControllerMobilitySession.release(), which includes logic to gracefully release
sessions after threads which are using them have finished. This method would release sessions while they are in
use, which could cause errors for requests executing in those sessions.
releaseSession in interface MobilityControllersessionId - The session id to releasepublic MobilitySessionInternal getMessageHandlingSession(UUID sessionId)
getMessageHandlingSession in interface MobilityControllerInternal
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||