Interface Session

All Superinterfaces:
Object, Session

public interface Session extends Session
A session object is used by IceGrid clients to allocate and release objects. Client sessions are created either via the Registry object or via the registry client SessionManager object.
See Also:
  • Method Details

    • keepAlive

      void keepAlive(Current current)
      Keep the session alive. Clients should call this operation regularly to prevent the server from reaping the session.
      Parameters:
      current - The Current object for the invocation.
      See Also:
    • allocateObjectByIdAsync

      Allocate an object. Depending on the allocation timeout, this operation might hang until the object is available or until the timeout is reached.
      Parameters:
      id - The identity of the object to allocate.
      current - The Current object for the invocation.
      Returns:
      The proxy of the allocated object.
      Throws:
      AllocationException - Raised if the object can't be allocated.
      ObjectNotRegisteredException - Raised if the object with the given identity is not registered with the registry.
      See Also:
    • allocateObjectByTypeAsync

      CompletionStage<ObjectPrx> allocateObjectByTypeAsync(String type, Current current) throws AllocationException
      Allocate an object with the given type. Depending on the allocation timeout, this operation can block until an object becomes available or until the timeout is reached.
      Parameters:
      type - The type of the object.
      current - The Current object for the invocation.
      Returns:
      The proxy of the allocated object.
      Throws:
      AllocationException - Raised if the object could not be allocated.
      See Also:
    • releaseObject

      void releaseObject(Identity id, Current current) throws AllocationException, ObjectNotRegisteredException
      Release an object that was allocated using allocateObjectById or allocateObjectByType.
      Parameters:
      id - The identity of the object to release.
      current - The Current object for the invocation.
      Throws:
      AllocationException - Raised if the given object can't be released. This might happen if the object isn't allocatable or isn't allocated by the session.
      ObjectNotRegisteredException - Raised if the object with the given identity is not registered with the registry.
    • setAllocationTimeout

      void setAllocationTimeout(int timeout, Current current)
      Set the allocation timeout. If no objects are available for an allocation request, a call to allocateObjectById or allocateObjectByType will block for the duration of this timeout.
      Parameters:
      timeout - The timeout in milliseconds.
      current - The Current object for the invocation.
    • ice_ids

      default String[] ice_ids(Current current)
      Description copied from interface: Object
      Returns the Slice type IDs of the interfaces supported by this object.
      Specified by:
      ice_ids in interface Object
      Specified by:
      ice_ids in interface Session
      Parameters:
      current - The Current object for the invocation.
      Returns:
      The Slice type IDs of the interfaces supported by this object, in base-to-derived order. The first element of the returned array is always ::Ice::Object.
    • ice_id

      default String ice_id(Current current)
      Description copied from interface: Object
      Returns the Slice type ID of the most-derived interface supported by this object.
      Specified by:
      ice_id in interface Object
      Specified by:
      ice_id in interface Session
      Parameters:
      current - The Current object for the invocation.
      Returns:
      The Slice type ID of the most-derived interface.
    • ice_staticId

      static String ice_staticId()
      Description copied from interface: Object
      Returns the Slice type ID of the interface supported by this object.
      Returns:
      The return value is always ::Ice::Object.