Package omero.cmd

Class SessionI

    • Method Detail

      • destroy

        public void destroy​(Ice.Current current)
        Destruction simply decrements the reference count for a session to allow reconnecting to it. This means that the Glacier timeout property is fairly unimportant. If a Glacier connection times out or is otherwise destroyed, a client can attempt to reconnect. However, in the case of only one reference to the session, if the Glacier2 timeout is greater than the session timeout, exceptions can be thrown when this method tries to clean up the session. Therefore all session access must be guarded by a try/finally block.
        Specified by:
        destroy in interface Glacier2._SessionOperations
      • handleCallbackException

        public void handleCallbackException​(java.lang.Exception e)
        Reusable method for logging an exception that occurs on one-way communication with clients during callback notification.
      • cleanupSelf

        public void cleanupSelf()
        Called if this isn't a kill-everything event.
        See Also:
        Trac ticket #9330
      • doDestroy

        public void doDestroy()
        Performs the actual cleanup operation on all the resources shared between this and other ServiceFactoryI instances in the same Session. Since destroy(Current) is called regardless by the router, even when a client has just died, we have this internal method for handling the actual closing of resources. This method must take precautions to not throw a SessionException . See destroy(Current) for more information. When destroy(Current) is called but it isn't time to close down the entire instance, then we should still close down the stateless services for this instance as well as remove ourselves from the adapter.
        See Also:
        Trac ticket #9330
      • cleanServants

        public static void cleanServants​(boolean all,
                                         java.lang.String clientId,
                                         ServantHolder holder,
                                         Ice.ObjectAdapter adapter)
        Clean all servants that are in the current holder and remove them from the adapter. If all is true, then all servants that are non-null will be processed. Otherwise, only servants that a) belong to this clientId and b) are not stateful (since stateful services may be used by other clients).
        Parameters:
        all - if stateful sessions should be shut down such that other clients cannot reattach (the servant is cleaned up)
        clientId - Only used if all is false.
        holder - ServantHolder to be cleaned.
        adapter - from which the servants should be removed.
      • internalServantConfig

        protected void internalServantConfig​(java.lang.Object obj)
                                      throws ServerError
        Throws:
        ServerError
      • createServantDelegate

        protected Ice.Object createServantDelegate​(java.lang.String name)
                                            throws ServerError
        Creates a proxy according to the servant definition for the given name. Injects the instance for this session so that all services are linked to a single session. Creates an ome.api.* service (mostly managed by Spring), wraps it with the interceptors which are in effect, and stores the instance away in the cache. Note: Since HardWiredInterceptor implements MethodInterceptor, all the Advice instances will be wrapped in Advisor instances and will be returned by Advised.getAdvisors().
        Throws:
        ServerError
      • configureServant

        public void configureServant​(Ice.Object servant)
                              throws ServerError
        Apply proper AOP and call setters for any known injection properties.
        Parameters:
        servant - the servant
        Throws:
        ServerError - if the configuration or tying failed
      • registerServant

        public Ice.ObjectPrx registerServant​(Ice.Identity id,
                                             Ice.Object servant)
                                      throws ServerError
        Registers the servant with the adapter (or throws an exception if one is already registered) as well as configures the servant in any post-Spring way necessary, based on the type of the servant.
        Throws:
        ServerError
      • registerServant

        public Ice.ObjectPrx registerServant​(Ice.Identity id,
                                             Ice.Object servant,
                                             Ice.Current current)
                                      throws ServerError
        Additionally stores information from the Current argument in the CallContext so that information from the creation of a servant can be recorded server-side without the need for clients to re-send the information or even for values which clients should not know.
        Throws:
        ServerError
      • getIdentity

        public Ice.Identity getIdentity​(java.lang.String name)
      • sessionId

        public static Ice.Identity sessionId​(java.lang.String clientId,
                                             java.lang.String uuid)
        Definition of session ids: "session-<CLIENTID>/<UUID>"
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object