|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.osgi.bundle.BundleFactoryBean
public class BundleFactoryBean
Bundle installer.
FactoryBean allows customers to use Spring to drive bundle
management. Bundles states can be modified using the action
(defaults to start) and destroyAction (not set by
default) parameters.
For example, to automatically install and start a bundle from the local
maven repository (assuming the bundle has been already retrieved), one can
use the following configuration:
<osgi:bundle id="aBundle" symbolic-name="org.company.bundles.a"
location="file:${localRepository}/org/company/bundles/a/${pom.version}/a-${pom.version}.jar"
action="start"/>
Note: Pay attention when installing bundles
dynamically since classes can be loaded aggressively.
BundleAction| Constructor Summary | |
|---|---|
BundleFactoryBean()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
|
void |
destroy()
|
BundleAction |
getAction()
Returns the action. |
Bundle |
getBundle()
Returns the bundle with which the class interacts. |
BundleAction |
getDestroyAction()
Returns the destroyAction. |
String |
getLocation()
Return the given location. |
Object |
getObject()
|
Class |
getObjectType()
|
Resource |
getResource()
Return the Resource object (if a ResourceLoader is
available) from the given location (if any). |
int |
getStartLevel()
Gets the bundle start level. |
String |
getSymbolicName()
Return the given bundle symbolic name. |
boolean |
isSingleton()
|
void |
setAction(BundleAction action)
Action to execute at startup. |
void |
setBundle(Bundle bundle)
Set the backing bundle used by this class. |
void |
setBundleContext(BundleContext context)
Set the BundleContext that this bean runs in. |
void |
setClassLoader(ClassLoader classloader)
|
void |
setDestroyAction(BundleAction action)
Action to execute at shutdown. |
void |
setLocation(String url)
Set the bundle location (optional operation). |
void |
setPushBundleAsContextClassLoader(boolean pushBundleAsContextClassLoader)
Determines whether invocations on the remote service should be performed in the context (thread context class loader) of the target bundle's ClassLoader. |
void |
setResourceLoader(ResourceLoader resourceLoader)
|
void |
setStartLevel(int startLevel)
Sets the bundle start level. |
void |
setSymbolicName(String symbolicName)
Set the bundle symbolic name (optional operation). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BundleFactoryBean()
| Method Detail |
|---|
public Class getObjectType()
getObjectType in interface FactoryBeanpublic boolean isSingleton()
isSingleton in interface FactoryBean
public Object getObject()
throws Exception
getObject in interface FactoryBeanException
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface InitializingBeanException
public void destroy()
throws Exception
destroy in interface DisposableBeanExceptionpublic Resource getResource()
Resource object (if a ResourceLoader is
available) from the given location (if any).
Resource object for the given locationpublic String getLocation()
public void setLocation(String url)
url - bundle location (normally an URL or a Spring Resource)public String getSymbolicName()
public void setSymbolicName(String symbolicName)
symbolicName - bundle symbolic namepublic void setBundleContext(BundleContext context)
BundleContextAwareBundleContext that this bean runs in. Normally this can
be used to initialize an object.
setBundleContext in interface BundleContextAwarecontext - the BundleContext object to be used
by this objectpublic BundleAction getAction()
public void setAction(BundleAction action)
action - action to execute at startuppublic BundleAction getDestroyAction()
public void setDestroyAction(BundleAction action)
action - action to execute at shutdownpublic int getStartLevel()
public void setStartLevel(int startLevel)
startLevel - bundle start level.public void setPushBundleAsContextClassLoader(boolean pushBundleAsContextClassLoader)
false.
pushBundleAsContextClassLoader - true if the thread context class
loader will be set to the target bundle or false otherwisepublic void setClassLoader(ClassLoader classloader)
public void setResourceLoader(ResourceLoader resourceLoader)
setResourceLoader in interface ResourceLoaderAwarepublic Bundle getBundle()
public void setBundle(Bundle bundle)
bundle - The bundle to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||