Class SessionHelper

java.lang.Object
com.zeroc.Glacier2.SessionHelper

public class SessionHelper extends Object
A helper class for using Glacier2 with GUI applications.
  • Method Details

    • destroy

      public void destroy()
      Destroys the Glacier2 session. Once the session has been destroyed, SessionCallback.disconnected(com.zeroc.Glacier2.SessionHelper) is called on the associated callback object.
    • communicator

      public Communicator communicator()
      Returns the session's communicator object.
      Returns:
      The communicator.
    • categoryForClient

      public String categoryForClient() throws SessionNotExistException
      Returns the category to be used in the identities of all of the client's callback objects. Clients must use this category for the router to forward callback requests to the intended client.
      Returns:
      The category.
      Throws:
      SessionNotExistException - No session exists.
    • addWithUUID

      public ObjectPrx addWithUUID(Object servant) throws SessionNotExistException
      Adds a servant to the callback object adapter's Active Servant Map with a UUID.
      Parameters:
      servant - The servant to add.
      Returns:
      The proxy for the servant.
      Throws:
      SessionNotExistException - No session exists.
    • session

      public SessionPrx session()
      Returns the Glacier2 session proxy, or null if the session hasn't been established yet or the session has already been destroyed.
      Returns:
      The session proxy, or null if no session exists.
    • isConnected

      public boolean isConnected()
      Returns true if there is an active session, otherwise returns false.
      Returns:
      trueif session exists or false if no session exists.
    • objectAdapter

      public ObjectAdapter objectAdapter() throws SessionNotExistException
      Creates an object adapter for callback objects.
      Returns:
      The object adapter.
      Throws:
      SessionNotExistException - No session exists.
    • connect

      protected void connect(Map<String,String> context)
    • connect

      protected void connect(String username, String password, Map<String,String> context)