com.googlecode.mobilityrpc.session
Class MobilityContext

java.lang.Object
  extended by com.googlecode.mobilityrpc.session.impl.MobilityContextInternal
      extended by com.googlecode.mobilityrpc.session.MobilityContext

public class MobilityContext
extends MobilityContextInternal

Provides static methods which allow mobile objects which arrive on a remote machine to get a reference to the MobilitySession in which they are executing, and to determine the ConnectionId from which they were received.

Author:
Niall Gallagher

Method Summary
static ConnectionId getCurrentConnectionId()
          Returns the ConnectionId from which the current request was received.
static MobilitySession getCurrentSession()
          Returns the MobilitySession in which the calling thread is executing.
static boolean hasCurrentSession()
          Returns true if the current thread has a session, otherwise false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCurrentSession

public static MobilitySession getCurrentSession()
Returns the MobilitySession in which the calling thread is executing.

Returns:
The MobilitySession in which the calling thread is executing
Throws:
IllegalStateException - If the current thread does not have a session

hasCurrentSession

public static boolean hasCurrentSession()
Returns true if the current thread has a session, otherwise false.

Returns:
True if the current thread has a session, otherwise false.

getCurrentConnectionId

public static ConnectionId getCurrentConnectionId()
Returns the ConnectionId from which the current request was received.

Returns:
The ConnectionId from which the current request was received
Throws:
IllegalStateException - If the current thread does not have a session


Copyright © 2012. All Rights Reserved.