|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.osgi.internal.service.exporter.AbstractServiceExporter org.springframework.osgi.internal.service.exporter.AbstractListenerAwareExporter org.springframework.osgi.service.exporter.OsgiServiceFactoryBean
public class OsgiServiceFactoryBean
FactoryBean that transparently publishes other beans in the same application context as OSGi services returning the ServiceRegistration for the given object.
The service properties used when publishing the service are determined by the OsgiServicePropertiesResolver. The default implementation uses
Field Summary | |
---|---|
static int |
AUTO_EXPORT_ALL
|
static int |
AUTO_EXPORT_CLASS_HIERARCHY
|
static int |
AUTO_EXPORT_DISABLED
|
static int |
AUTO_EXPORT_INTERFACES
|
Fields inherited from class org.springframework.osgi.internal.service.exporter.AbstractServiceExporter |
---|
publishAtStartup |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
OsgiServiceFactoryBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
protected Class[] |
autoDetectClassesForPublishing(Class clazz)
Return an array of classes for the given bean that have been discovered using the autoExportMode. |
void |
destroy()
|
String |
getActivationMethod()
|
String |
getDeactivationMethod()
|
Object |
getObject()
|
Class |
getObjectType()
|
int |
getOrder()
|
int |
getRanking()
|
OsgiServicePropertiesResolver |
getResolver()
|
Map |
getServiceProperties()
|
protected boolean |
isBeanBundleScoped()
|
boolean |
isSingleton()
|
void |
registerService()
Publish the given object as an OSGi service. |
protected ServiceRegistration |
registerService(Class[] classes,
Dictionary serviceProperties)
Registration method. |
void |
setActivationMethod(String activationMethod)
|
void |
setAutoExport(String autoExportMode)
Set the autoexport mode to use. |
void |
setAutoExportNumber(int autoExportMode)
Set the autoexport mode to use. |
void |
setBeanClassLoader(ClassLoader classLoader)
|
void |
setBeanFactory(BeanFactory beanFactory)
|
void |
setBeanName(String name)
|
void |
setBundleContext(BundleContext context)
|
void |
setContextClassloader(String classloaderManagementOption)
Set the context classloader management strategy to use when invoking operations on the exposed target bean |
void |
setDeactivationMethod(String deactivationMethod)
|
void |
setInterfaces(Class[] serviceInterfaces)
|
void |
setOrder(int order)
|
void |
setRanking(int ranking)
|
void |
setResolver(OsgiServicePropertiesResolver resolver)
|
void |
setServiceProperties(Map serviceProperties)
|
void |
setTarget(Object target)
Export the given object as an OSGi service. |
void |
setTargetBeanName(String name)
|
void |
unregisterService()
|
protected void |
unregisterService(ServiceRegistration registration)
Unregisters (literally stops) a service. |
Methods inherited from class org.springframework.osgi.internal.service.exporter.AbstractListenerAwareExporter |
---|
notifyListeners, setListeners |
Methods inherited from class org.springframework.osgi.internal.service.exporter.AbstractServiceExporter |
---|
isRunning, setPublishAtStartup, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int AUTO_EXPORT_DISABLED
public static final int AUTO_EXPORT_INTERFACES
public static final int AUTO_EXPORT_CLASS_HIERARCHY
public static final int AUTO_EXPORT_ALL
Constructor Detail |
---|
public OsgiServiceFactoryBean()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class org.springframework.osgi.internal.service.exporter.AbstractServiceExporter
Exception
protected Class[] autoDetectClassesForPublishing(Class clazz)
clazz
-
public void registerService()
registerService
in class org.springframework.osgi.internal.service.exporter.AbstractServiceExporter
beanClass
- serviceProperties
- protected ServiceRegistration registerService(Class[] classes, Dictionary serviceProperties)
classes
- serviceProperties
-
protected boolean isBeanBundleScoped()
public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public Object getObject() throws Exception
getObject
in interface FactoryBean
Exception
public Class getObjectType()
getObjectType
in interface FactoryBean
public boolean isSingleton()
isSingleton
in interface FactoryBean
public void destroy()
destroy
in interface DisposableBean
public void unregisterService()
unregisterService
in class org.springframework.osgi.internal.service.exporter.AbstractServiceExporter
protected void unregisterService(ServiceRegistration registration)
registration
- public void setContextClassloader(String classloaderManagementOption)
classloaderManagementOption
- public void setTarget(Object target)
target
- The target to set.public void setAutoExportNumber(int autoExportMode)
AUTO_EXPORT_DISABLED
autoExportMode
- the auto export mode as an int#setAutoExportName(String)
,
AUTO_EXPORT_DISABLED
,
AUTO_EXPORT_INTERFACES
,
AUTO_EXPORT_CLASS_HIERARCHY
,
AUTO_EXPORT_ALL
public void setAutoExport(String autoExportMode)
autoExportMode
- setAutoExportNumber(int)
public String getActivationMethod()
public void setActivationMethod(String activationMethod)
public String getDeactivationMethod()
public void setDeactivationMethod(String deactivationMethod)
public Map getServiceProperties()
public void setServiceProperties(Map serviceProperties)
public int getRanking()
public void setRanking(int ranking)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
public void setBundleContext(BundleContext context)
setBundleContext
in interface BundleContextAware
public OsgiServicePropertiesResolver getResolver()
public void setResolver(OsgiServicePropertiesResolver resolver)
resolver
- The resolver to set.public void setTargetBeanName(String name)
public void setInterfaces(Class[] serviceInterfaces)
public int getOrder()
getOrder
in interface Ordered
public void setOrder(int order)
order
- The order to set.public void setBeanName(String name)
setBeanName
in interface BeanNameAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |