public class OnmsServiceManagerImpl extends Object implements OnmsServiceManager
Constructor and Description |
---|
OnmsServiceManagerImpl(org.osgi.framework.BundleContext bundleContext) |
Modifier and Type | Method and Description |
---|---|
VaadinApplicationContext |
createApplicationContext(VaadinApplicationContextCreator creator) |
EventRegistry |
getEventRegistry() |
<T> T |
getService(Class<T> clazz,
VaadinApplicationContext applicationContext)
Returns a service in session-scope.
|
<T> List<T> |
getServices(Class<T> clazz,
VaadinApplicationContext applicationContext,
Hashtable<String,Object> additionalProperties)
Returns all registered services within session-scope and may be consider additional Properties.
|
<T> void |
registerAsService(Class<T> serviceClass,
T serviceBean,
VaadinApplicationContext applicationContext)
Register a service with session scope.
|
<T> void |
registerAsService(Class<T> serviceClass,
T serviceBean,
VaadinApplicationContext applicationContext,
Dictionary<String,Object> properties)
Registers a service with session scope but allows to set additional Properties.
|
void |
sessionDestroyed(String sessionId)
Remove all services from OSGi-container for the destroyed session.
|
void |
sessionInitialized(String sessionId) |
public OnmsServiceManagerImpl(org.osgi.framework.BundleContext bundleContext)
public <T> void registerAsService(Class<T> serviceClass, T serviceBean, VaadinApplicationContext applicationContext)
OnmsServiceManager
registerAsService
in interface OnmsServiceManager
serviceBean
- The service to be registered. Must not be null.applicationContext
- The session scope. Must not be null.public <T> void registerAsService(Class<T> serviceClass, T serviceBean, VaadinApplicationContext applicationContext, Dictionary<String,Object> properties)
OnmsServiceManager
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.public EventRegistry getEventRegistry()
getEventRegistry
in interface OnmsServiceManager
public <T> T getService(Class<T> clazz, VaadinApplicationContext applicationContext)
OnmsServiceManager
getService
in interface OnmsServiceManager
clazz
- The type of the service. Must not be null.applicationContext
- The session-scope. Must not be null.public <T> List<T> getServices(Class<T> clazz, VaadinApplicationContext applicationContext, Hashtable<String,Object> additionalProperties)
OnmsServiceManager
getServices
in interface OnmsServiceManager
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.public void sessionInitialized(String sessionId)
sessionInitialized
in interface SessionListener
public void sessionDestroyed(String sessionId)
sessionDestroyed
in interface SessionListener
public VaadinApplicationContext createApplicationContext(VaadinApplicationContextCreator creator)
createApplicationContext
in interface OnmsServiceManager
Copyright © 2021. All rights reserved.