Package org.nuxeo.runtime.model.impl
Class ComponentInstanceImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.impl.ComponentInstanceImpl
-
- All Implemented Interfaces:
Adaptable,ComponentContext,ComponentInstance,Extensible
public class ComponentInstanceImpl extends Object implements ComponentInstance
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classComponentInstanceImpl.OSGiServiceFactory
-
Field Summary
Fields Modifier and Type Field Description protected List<ComponentInstanceImpl.OSGiServiceFactory>factoriesprotected Objectinstanceprotected RegistrationInfori
-
Constructor Summary
Constructors Constructor Description ComponentInstanceImpl(RegistrationInfo ri)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidactivate()Activates the implementation instance.voidcreate()protected ObjectcreateInstance()voiddeactivate()Deactivates the implementation instance.voiddestroy()Destroys this instance.<T> TgetAdapter(Class<T> adapter)Returns an object which is an instance of the given class associated with this object.RuntimeContextgetContext()Gets the runtime context attached to this instance.ObjectgetInstance()Gets the actual component implementation instance.ComponentNamegetName()Gets the name of the component.PropertygetProperty(String property)String[]getPropertyNames()ObjectgetPropertyValue(String property)ObjectgetPropertyValue(String property, Object defValue)String[]getProvidedServiceNames()Gets the list of provided services, or null if no service is provided.RegistrationInfogetRegistrationInfo()Gets the Registration InfoRuntimeContextgetRuntimeContext()protected voidhandleError(String message, RuntimeMessage.Source source, String sourceId, Exception e)voidregisterExtension(Extension extension)Registers the given extension.voidregisterServices()Register provided services as OSGi servicesvoidreload()Deprecated.since 9.3, but in fact since 5.6, only usage inRegistrationInfoImplvoidstart()Starts the implementation instance.voidstop()Stops the implementation instance.StringtoString()voidunregisterExtension(Extension extension)Unregisters the given extension.voidunregisterServices()
-
-
-
Field Detail
-
instance
protected Object instance
-
ri
protected RegistrationInfo ri
-
factories
protected List<ComponentInstanceImpl.OSGiServiceFactory> factories
-
-
Constructor Detail
-
ComponentInstanceImpl
public ComponentInstanceImpl(RegistrationInfo ri)
-
-
Method Detail
-
getInstance
public Object getInstance()
Description copied from interface:ComponentInstanceGets the actual component implementation instance.- Specified by:
getInstancein interfaceComponentInstance- Returns:
- the component implementation instance
-
create
public void create()
-
createInstance
protected Object createInstance()
-
destroy
public void destroy()
Description copied from interface:ComponentInstanceDestroys this instance.- Specified by:
destroyin interfaceComponentInstance
-
getContext
public RuntimeContext getContext()
Description copied from interface:ComponentInstanceGets the runtime context attached to this instance.- Specified by:
getContextin interfaceComponentInstance- Returns:
- the runtime context
-
getName
public ComponentName getName()
Description copied from interface:ComponentInstanceGets the name of the component.- Specified by:
getNamein interfaceComponentInstance- Returns:
- the component name
-
activate
public void activate()
Description copied from interface:ComponentInstanceActivates the implementation instance.- Specified by:
activatein interfaceComponentInstance
-
deactivate
public void deactivate()
Description copied from interface:ComponentInstanceDeactivates the implementation instance.- Specified by:
deactivatein interfaceComponentInstance
-
start
public void start()
Description copied from interface:ComponentInstanceStarts the implementation instance.- Specified by:
startin interfaceComponentInstance- Since:
- 9.3
-
stop
public void stop() throws InterruptedExceptionDescription copied from interface:ComponentInstanceStops the implementation instance.- Specified by:
stopin interfaceComponentInstance- Throws:
InterruptedException- Since:
- 9.3
-
reload
@Deprecated public void reload()
Deprecated.since 9.3, but in fact since 5.6, only usage inRegistrationInfoImplDescription copied from interface:ComponentInstanceReload the component. All the extensions and registries are reloaded.- Specified by:
reloadin interfaceComponentInstance
-
registerExtension
public void registerExtension(Extension extension)
Description copied from interface:ExtensibleRegisters the given extension.- Specified by:
registerExtensionin interfaceExtensible- Parameters:
extension- the extension to register
-
unregisterExtension
public void unregisterExtension(Extension extension)
Description copied from interface:ExtensibleUnregisters the given extension.- Specified by:
unregisterExtensionin interfaceExtensible- Parameters:
extension- the extension to unregister
-
handleError
protected void handleError(String message, RuntimeMessage.Source source, String sourceId, Exception e)
-
getAdapter
public <T> T getAdapter(Class<T> adapter)
Description copied from interface:AdaptableReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.- Specified by:
getAdapterin interfaceAdaptable- Parameters:
adapter- the adapter class to look up- Returns:
- a object castable to the given class, or
nullif this object does not have an adapter for the given class
-
getPropertyNames
public String[] getPropertyNames()
- Specified by:
getPropertyNamesin interfaceComponentContext
-
getProperty
public Property getProperty(String property)
- Specified by:
getPropertyin interfaceComponentContext
-
getRuntimeContext
public RuntimeContext getRuntimeContext()
- Specified by:
getRuntimeContextin interfaceComponentContext
-
getPropertyValue
public Object getPropertyValue(String property)
- Specified by:
getPropertyValuein interfaceComponentContext
-
getPropertyValue
public Object getPropertyValue(String property, Object defValue)
- Specified by:
getPropertyValuein interfaceComponentContext
-
getProvidedServiceNames
public String[] getProvidedServiceNames()
Description copied from interface:ComponentInstanceGets the list of provided services, or null if no service is provided.- Specified by:
getProvidedServiceNamesin interfaceComponentInstance- Returns:
- an array containing the service class names or null if no service is provided
-
registerServices
public void registerServices()
Register provided services as OSGi services
-
unregisterServices
public void unregisterServices()
-
getRegistrationInfo
public RegistrationInfo getRegistrationInfo()
Description copied from interface:ComponentInstanceGets the Registration Info- Specified by:
getRegistrationInfoin interfaceComponentInstance- Returns:
- the registration info
-
-