Class OnmsServiceManagerImpl

    • Constructor Detail

      • OnmsServiceManagerImpl

        public OnmsServiceManagerImpl​(org.osgi.framework.BundleContext bundleContext)
    • Method Detail

      • registerAsService

        public <T> void registerAsService​(java.lang.Class<T> serviceClass,
                                          T serviceBean,
                                          VaadinApplicationContext applicationContext)
        Description copied from interface: OnmsServiceManager
        Register a service with session scope.
        Specified by:
        registerAsService in interface OnmsServiceManager
        serviceBean - The service to be registered. Must not be null.
        applicationContext - The session scope. Must not be null.
      • registerAsService

        public <T> void registerAsService​(java.lang.Class<T> serviceClass,
                                          T serviceBean,
                                          VaadinApplicationContext applicationContext,
                                          java.util.Dictionary<java.lang.String,​java.lang.Object> properties)
        Description copied from interface: OnmsServiceManager
        Registers a service with session scope but allows to set additional Properties.
        Specified by:
        registerAsService in interface OnmsServiceManager
        serviceBean - The service to be registered. Must not be null.
        applicationContext - the session scope. Must not be null.
        properties - Additional Properties. Must not be null.
      • getService

        public <T> T getService​(java.lang.Class<T> clazz,
                                VaadinApplicationContext applicationContext)
        Description copied from interface: OnmsServiceManager
        Returns a service in session-scope. Be aware that if there are multiple services registered for the given class, only the first one is returned.
        Specified by:
        getService in interface OnmsServiceManager
        Parameters:
        clazz - The type of the service. Must not be null.
        applicationContext - The session-scope. Must not be null.
      • getServices

        public <T> java.util.List<T> getServices​(java.lang.Class<T> clazz,
                                                 VaadinApplicationContext applicationContext,
                                                 java.util.Hashtable<java.lang.String,​java.lang.Object> additionalProperties)
        Description copied from interface: OnmsServiceManager
        Returns all registered services within session-scope and may be consider additional Properties.
        Specified by:
        getServices in interface OnmsServiceManager
        Parameters:
        clazz - the type of the service. Must not be null.
        applicationContext - The session scope. Must not be null.
        additionalProperties - optional additional propeties. Must not be null.
      • sessionDestroyed

        public void sessionDestroyed​(java.lang.String sessionId)
        Remove all services from OSGi-container for the destroyed session.
        Specified by:
        sessionDestroyed in interface SessionListener