org.apache.servicemix.jbi.deployer.impl
Class Deployer
java.lang.Object
org.apache.servicemix.jbi.deployer.impl.Deployer
- All Implemented Interfaces:
- java.util.EventListener, LifeCycleListener, Listener, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener
public class Deployer
- extends java.lang.Object
- implements org.osgi.framework.SynchronousBundleListener, LifeCycleListener
Deployer for JBI artifacts
|
Method Summary |
void |
bundleChanged(org.osgi.framework.BundleEvent event)
|
protected void |
checkPendingAssemblies()
|
protected void |
checkPendingInstallers()
|
ServiceUnitImpl |
createServiceUnit(ServiceUnitDesc sud,
java.io.File suRootDir,
ComponentImpl component)
|
void |
destroy()
|
org.osgi.framework.BundleContext |
getBundleContext()
|
ComponentImpl |
getComponent(java.lang.String name)
|
java.util.Map<java.lang.String,ComponentImpl> |
getComponents()
|
AssemblyReferencesListener |
getEndpointListener()
|
Environment |
getEnvironment()
|
AbstractInstaller |
getInstaller(java.lang.Object o)
|
protected AbstractInstaller |
getJmxManaged()
|
org.fusesource.commons.management.ManagementStrategy |
getManagementStrategy()
|
javax.management.MBeanServer |
getMbeanServer()
|
org.osgi.service.prefs.PreferencesService |
getPreferencesService()
|
java.util.Map<java.lang.String,ServiceAssemblyImpl> |
getServiceAssemblies()
|
ServiceAssemblyImpl |
getServiceAssembly(java.lang.String name)
|
java.util.Map<java.lang.String,SharedLibraryImpl> |
getSharedLibraries()
|
SharedLibraryImpl |
getSharedLibrary(java.lang.String name)
|
int |
getShutdownTimeout()
|
void |
init()
|
boolean |
isAutoStart()
|
void |
lifeCycleChanged(LifeCycleEvent event)
|
protected boolean |
match(org.osgi.framework.Bundle bundle)
|
protected void |
onBundleStarted(org.osgi.framework.Bundle bundle)
Callback called when a new bundle has been started. |
protected void |
onBundleStopping(org.osgi.framework.Bundle bundle)
|
protected void |
onBundleUninstalled(org.osgi.framework.Bundle bundle)
|
ComponentImpl |
registerComponent(org.osgi.framework.Bundle bundle,
ComponentDesc componentDesc,
javax.jbi.component.Component innerComponent,
SharedLibrary[] sharedLibraries)
|
protected void |
registerDeployedComponent(org.osgi.framework.ServiceReference reference,
javax.jbi.component.Component component)
Register an already deployed JBI component. |
void |
registerDeployedServiceAssembly(org.osgi.framework.ServiceReference reference,
DeployedAssembly assembly)
|
protected void |
registerService(org.osgi.framework.Bundle bundle,
java.lang.String[] clazz,
java.lang.Object service,
java.util.Dictionary props)
|
protected void |
registerService(org.osgi.framework.Bundle bundle,
java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary props)
Register and keep track of an OSGi service |
ServiceAssemblyImpl |
registerServiceAssembly(org.osgi.framework.Bundle bundle,
ServiceAssemblyDesc serviceAssemblyDesc,
java.util.List<ServiceUnitImpl> sus)
|
SharedLibraryImpl |
registerSharedLibrary(org.osgi.framework.Bundle bundle,
SharedLibraryDesc sharedLibraryDesc,
java.lang.ClassLoader classLoader)
|
void |
setAutoStart(boolean autoStart)
|
void |
setBundleContext(org.osgi.framework.BundleContext bundleContext)
|
void |
setEndpointListener(AssemblyReferencesListener endpointListener)
|
void |
setEnvironment(Environment environment)
|
void |
setJmxManaged(AbstractInstaller installer)
|
void |
setManagementStrategy(org.fusesource.commons.management.ManagementStrategy managementStrategy)
|
void |
setMbeanServer(javax.management.MBeanServer mbeanServer)
|
void |
setPreferencesService(org.osgi.service.prefs.PreferencesService preferencesService)
|
void |
setShutdownTimeout(int shutdownTimeout)
|
protected void |
unregisterComponent(ComponentImpl component)
|
protected void |
unregisterDeployedComponent(org.osgi.framework.ServiceReference reference,
javax.jbi.component.Component component)
|
void |
unregisterDeployedServiceAssembly(org.osgi.framework.ServiceReference reference,
DeployedAssembly assembly)
|
protected void |
unregisterServiceAssembly(ServiceAssemblyImpl assembly)
|
protected void |
unregisterServices(org.osgi.framework.Bundle bundle)
|
protected void |
unregisterSharedLibrary(SharedLibrary library)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
TYPE_SERVICE_ENGINE
public static final java.lang.String TYPE_SERVICE_ENGINE
- See Also:
- Constant Field Values
TYPE_BINDING_COMPONENT
public static final java.lang.String TYPE_BINDING_COMPONENT
- See Also:
- Constant Field Values
Deployer
public Deployer()
throws javax.jbi.JBIException
- Throws:
javax.jbi.JBIException
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
setBundleContext
public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
getPreferencesService
public org.osgi.service.prefs.PreferencesService getPreferencesService()
setPreferencesService
public void setPreferencesService(org.osgi.service.prefs.PreferencesService preferencesService)
isAutoStart
public boolean isAutoStart()
setAutoStart
public void setAutoStart(boolean autoStart)
setEndpointListener
public void setEndpointListener(AssemblyReferencesListener endpointListener)
getEndpointListener
public AssemblyReferencesListener getEndpointListener()
getManagementStrategy
public org.fusesource.commons.management.ManagementStrategy getManagementStrategy()
setManagementStrategy
public void setManagementStrategy(org.fusesource.commons.management.ManagementStrategy managementStrategy)
getMbeanServer
public javax.management.MBeanServer getMbeanServer()
setMbeanServer
public void setMbeanServer(javax.management.MBeanServer mbeanServer)
setEnvironment
public void setEnvironment(Environment environment)
getEnvironment
public Environment getEnvironment()
getJmxManaged
protected AbstractInstaller getJmxManaged()
setJmxManaged
public void setJmxManaged(AbstractInstaller installer)
getSharedLibraries
public java.util.Map<java.lang.String,SharedLibraryImpl> getSharedLibraries()
getComponents
public java.util.Map<java.lang.String,ComponentImpl> getComponents()
getServiceAssemblies
public java.util.Map<java.lang.String,ServiceAssemblyImpl> getServiceAssemblies()
getSharedLibrary
public SharedLibraryImpl getSharedLibrary(java.lang.String name)
getComponent
public ComponentImpl getComponent(java.lang.String name)
getServiceAssembly
public ServiceAssemblyImpl getServiceAssembly(java.lang.String name)
setShutdownTimeout
public void setShutdownTimeout(int shutdownTimeout)
getShutdownTimeout
public int getShutdownTimeout()
init
public void init()
throws java.lang.Exception
- Throws:
java.lang.Exception
destroy
public void destroy()
throws java.lang.Exception
- Throws:
java.lang.Exception
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChanged in interface org.osgi.framework.BundleListener
match
protected boolean match(org.osgi.framework.Bundle bundle)
onBundleStarted
protected void onBundleStarted(org.osgi.framework.Bundle bundle)
- Callback called when a new bundle has been started.
This method will check if the bundle is a JBI artifact and will process it accordingly.
- Parameters:
bundle -
onBundleStopping
protected void onBundleStopping(org.osgi.framework.Bundle bundle)
onBundleUninstalled
protected void onBundleUninstalled(org.osgi.framework.Bundle bundle)
createServiceUnit
public ServiceUnitImpl createServiceUnit(ServiceUnitDesc sud,
java.io.File suRootDir,
ComponentImpl component)
registerSharedLibrary
public SharedLibraryImpl registerSharedLibrary(org.osgi.framework.Bundle bundle,
SharedLibraryDesc sharedLibraryDesc,
java.lang.ClassLoader classLoader)
throws java.lang.Exception
- Throws:
java.lang.Exception
registerComponent
public ComponentImpl registerComponent(org.osgi.framework.Bundle bundle,
ComponentDesc componentDesc,
javax.jbi.component.Component innerComponent,
SharedLibrary[] sharedLibraries)
throws java.lang.Exception
- Throws:
java.lang.Exception
registerServiceAssembly
public ServiceAssemblyImpl registerServiceAssembly(org.osgi.framework.Bundle bundle,
ServiceAssemblyDesc serviceAssemblyDesc,
java.util.List<ServiceUnitImpl> sus)
throws java.lang.Exception
- Throws:
java.lang.Exception
unregisterComponent
protected void unregisterComponent(ComponentImpl component)
unregisterServiceAssembly
protected void unregisterServiceAssembly(ServiceAssemblyImpl assembly)
unregisterSharedLibrary
protected void unregisterSharedLibrary(SharedLibrary library)
getInstaller
public AbstractInstaller getInstaller(java.lang.Object o)
checkPendingInstallers
protected void checkPendingInstallers()
checkPendingAssemblies
protected void checkPendingAssemblies()
lifeCycleChanged
public void lifeCycleChanged(LifeCycleEvent event)
throws javax.jbi.JBIException
- Specified by:
lifeCycleChanged in interface LifeCycleListener
- Throws:
javax.jbi.JBIException
registerDeployedComponent
protected void registerDeployedComponent(org.osgi.framework.ServiceReference reference,
javax.jbi.component.Component component)
- Register an already deployed JBI component.
If the component has been deployed using a JBI packaging, the deployer should already have
registered it, so it will do nothing. If the component has been deployed directly through
an OSGi packaging (by simply registering the component in the OSGi registry), the deployer
will perform the needed tasks.
- Parameters:
reference - component -
unregisterDeployedComponent
protected void unregisterDeployedComponent(org.osgi.framework.ServiceReference reference,
javax.jbi.component.Component component)
registerDeployedServiceAssembly
public void registerDeployedServiceAssembly(org.osgi.framework.ServiceReference reference,
DeployedAssembly assembly)
unregisterDeployedServiceAssembly
public void unregisterDeployedServiceAssembly(org.osgi.framework.ServiceReference reference,
DeployedAssembly assembly)
registerService
protected void registerService(org.osgi.framework.Bundle bundle,
java.lang.String clazz,
java.lang.Object service,
java.util.Dictionary props)
- Register and keep track of an OSGi service
- Parameters:
bundle - clazz - service - props -
registerService
protected void registerService(org.osgi.framework.Bundle bundle,
java.lang.String[] clazz,
java.lang.Object service,
java.util.Dictionary props)
unregisterServices
protected void unregisterServices(org.osgi.framework.Bundle bundle)
Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.