org.springframework.osgi.context.support
Class BundleFactoryBean

java.lang.Object
  extended by org.springframework.osgi.context.support.BundleFactoryBean
All Implemented Interfaces:
DisposableBean, FactoryBean, InitializingBean, BundleContextAware
Direct Known Subclasses:
VirtualBundleFactoryBean

public class BundleFactoryBean
extends Object
implements FactoryBean, BundleContextAware, InitializingBean, DisposableBean

Install Bundles using a FactoryBean. This allows customers to use Spring to drive bundle management. Bundles states can be modified using the state parameter. Most commonly this is set to "start".

Pay attention when installing bundles dynamically since classes can be loaded aggressively.

Author:
Andy Piper

Field Summary
protected  BundleContext bundleContext
           
protected  Resource location
          Bundle location
protected  String symbolicName
          Bundle symName
 
Constructor Summary
BundleFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 void destroy()
           
 Object getObject()
           
 Class getObjectType()
           
 boolean isSingleton()
           
 void setAction(String action)
           
 void setBundleContext(BundleContext context)
           
 void setClassloader(ClassLoader classloader)
           
 void setLocation(Resource url)
           
 void setPushBundleAsContextClassloader(boolean pushBundleAsContextClassLoader)
          Determines whether invocations on the remote service should be performed in the context of the target bundle's ClassLoader.
 void setStartLevel(int startLevel)
           
 void setSymbolicName(String symbolicName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

protected Resource location
Bundle location


symbolicName

protected String symbolicName
Bundle symName


bundleContext

protected BundleContext bundleContext
Constructor Detail

BundleFactoryBean

public BundleFactoryBean()
Method Detail

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface FactoryBean

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface FactoryBean

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface FactoryBean
Throws:
Exception

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface DisposableBean
Throws:
Exception

setLocation

public void setLocation(Resource url)
                 throws Exception
Throws:
Exception

setSymbolicName

public void setSymbolicName(String symbolicName)

setBundleContext

public void setBundleContext(BundleContext context)
Specified by:
setBundleContext in interface BundleContextAware

setAction

public void setAction(String action)

setStartLevel

public void setStartLevel(int startLevel)

setPushBundleAsContextClassloader

public void setPushBundleAsContextClassloader(boolean pushBundleAsContextClassLoader)
Determines whether invocations on the remote service should be performed in the context of the target bundle's ClassLoader. The default is false.

Parameters:
pushBundleAsContextClassLoader -

setClassloader

public void setClassloader(ClassLoader classloader)


Copyright © 2006-2007 Spring Framework. All Rights Reserved.