Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.runtime.model.impl
Class ComponentInstanceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.impl.ComponentInstanceImpl
All Implemented Interfaces:
Adaptable, ComponentContext, ComponentInstance, Extensible

public class ComponentInstanceImpl
extends Object
implements ComponentInstance

Author:
Bogdan Stefanescu

Constructor Summary
ComponentInstanceImpl(RegistrationInfoImpl ri)
           
 
Method Summary
 void activate()
          Activates the implementation instance.
 void create()
           
 void deactivate()
          Deactivates the implementation instance.
 void destroy()
          Destroys this instance.
<T> T
getAdapter(Class<T> adapter)
          Returns an object which is an instance of the given class associated with this object.
 RuntimeContext getContext()
          Gets the runtime context attached to this instance.
 Object getInstance()
          Gets the actual component implementation instance.
 ComponentName getName()
          Gets the name of the component.
 Property getProperty(String property)
           
 String[] getPropertyNames()
           
 Object getPropertyValue(String property)
           
 Object getPropertyValue(String property, Object defValue)
           
 String[] getProvidedServiceNames()
          Gets the list of provided services, or null if no service is provided.
 RuntimeContext getRuntimeContext()
           
 void registerExtension(Extension extension)
          Registers the given extension.
 void registerServices()
          Register provided services as OSGi services
 void reload()
          Reload the component.
 String toString()
           
 void unregisterExtension(Extension extension)
          Unregisters the given extension.
 void unregisterServices()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentInstanceImpl

public ComponentInstanceImpl(RegistrationInfoImpl ri)
                      throws Exception
Throws:
Exception
Method Detail

getInstance

public Object getInstance()
Description copied from interface: ComponentInstance
Gets the actual component implementation instance.

Specified by:
getInstance in interface ComponentInstance
Returns:
the component implementation instance

create

public void create()
            throws Exception
Throws:
Exception

destroy

public void destroy()
             throws Exception
Description copied from interface: ComponentInstance
Destroys this instance.

Specified by:
destroy in interface ComponentInstance
Throws:
Exception - if any error occurs

getContext

public RuntimeContext getContext()
Description copied from interface: ComponentInstance
Gets the runtime context attached to this instance.

Specified by:
getContext in interface ComponentInstance
Returns:
the runtime context

getName

public ComponentName getName()
Description copied from interface: ComponentInstance
Gets the name of the component.

Specified by:
getName in interface ComponentInstance
Returns:
the component name

activate

public void activate()
              throws Exception
Description copied from interface: ComponentInstance
Activates the implementation instance.

Specified by:
activate in interface ComponentInstance
Throws:
Exception - if any error occurs during activation

deactivate

public void deactivate()
                throws Exception
Description copied from interface: ComponentInstance
Deactivates the implementation instance.

Specified by:
deactivate in interface ComponentInstance
Throws:
Exception - if any error occurs during deactivation

reload

public void reload()
            throws Exception
Description copied from interface: ComponentInstance
Reload the component. All the extensions and registries are reloaded.

Specified by:
reload in interface ComponentInstance
Throws:
Exception

registerExtension

public void registerExtension(Extension extension)
                       throws Exception
Description copied from interface: Extensible
Registers the given extension.

Specified by:
registerExtension in interface Extensible
Parameters:
extension - the extension to register
Throws:
Exception - if any error occurs

unregisterExtension

public void unregisterExtension(Extension extension)
                         throws Exception
Description copied from interface: Extensible
Unregisters the given extension.

Specified by:
unregisterExtension in interface Extensible
Parameters:
extension - the extension to unregister
Throws:
Exception - if any error occurs

getAdapter

public <T> T getAdapter(Class<T> adapter)
Description copied from interface: Adaptable
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Specified by:
getAdapter in interface Adaptable
Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

getPropertyNames

public String[] getPropertyNames()
Specified by:
getPropertyNames in interface ComponentContext

getProperty

public Property getProperty(String property)
Specified by:
getProperty in interface ComponentContext

getRuntimeContext

public RuntimeContext getRuntimeContext()
Specified by:
getRuntimeContext in interface ComponentContext

getPropertyValue

public Object getPropertyValue(String property)
Specified by:
getPropertyValue in interface ComponentContext

getPropertyValue

public Object getPropertyValue(String property,
                               Object defValue)
Specified by:
getPropertyValue in interface ComponentContext

getProvidedServiceNames

public String[] getProvidedServiceNames()
Description copied from interface: ComponentInstance
Gets the list of provided services, or null if no service is provided.

Specified by:
getProvidedServiceNames in interface ComponentInstance
Returns:
an array containing the service class names or null if no service is provided

registerServices

public void registerServices()
                      throws Exception
Register provided services as OSGi services

Throws:
Exception

unregisterServices

public void unregisterServices()
                        throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.