Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation.server
Class AutomationServerComponent

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.automation.server.AutomationServerComponent
All Implemented Interfaces:
AutomationServer, Adaptable, Component, Extensible

public class AutomationServerComponent
extends DefaultComponent
implements AutomationServer

Author:
Bogdan Stefanescu

Constructor Summary
AutomationServerComponent()
           
 
Method Summary
 boolean accept(String name, boolean isChain, HttpServletRequest req)
          Checks if the given operation name is allowed in a REST call.
 void activate(ComponentContext context)
          Activates the component.
 void addBinding(RestBinding binding)
          Registers a new operation binding.
 void deactivate(ComponentContext context)
          Deactivates the component.
<T> T
getAdapter(Class<T> adapter)
          Returns an object which is an instance of the given class associated with this object.
 RestBinding[] getBindings()
          Gets an array of registered bindings.
 RestBinding getChainBinding(String name)
          Gets a binding given a chain name.
 ObjectCodecService getCodecs()
           
 RestBinding getOperationBinding(String name)
          Gets a binding given an operation.
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 RestBinding removeBinding(RestBinding binding)
          Removes a binding for the given operation name.
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
applicationStarted, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutomationServerComponent

public AutomationServerComponent()
Method Detail

activate

public void activate(ComponentContext context)
              throws Exception
Description copied from interface: Component
Activates the component.

This method is called by the runtime when a component is activated.

Specified by:
activate in interface Component
Overrides:
activate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

deactivate

public void deactivate(ComponentContext context)
                throws Exception
Description copied from interface: Component
Deactivates the component.

This method is called by the runtime when a component is deactivated.

Specified by:
deactivate in interface Component
Overrides:
deactivate in class DefaultComponent
Parameters:
context - the runtime context
Throws:
Exception - if an error occurs during activation

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

unregisterContribution

public void unregisterContribution(Object contribution,
                                   String extensionPoint,
                                   ComponentInstance contributor)
                            throws Exception
Overrides:
unregisterContribution in class DefaultComponent
Throws:
Exception

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
Overrides:
getAdapter in class DefaultComponent
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

getCodecs

public ObjectCodecService getCodecs()

getOperationBinding

public RestBinding getOperationBinding(String name)
Description copied from interface: AutomationServer
Gets a binding given an operation.

Specified by:
getOperationBinding in interface AutomationServer
Parameters:
name - the operation name.

getChainBinding

public RestBinding getChainBinding(String name)
Description copied from interface: AutomationServer
Gets a binding given a chain name.

Specified by:
getChainBinding in interface AutomationServer
Parameters:
name - the chain name

getBindings

public RestBinding[] getBindings()
Description copied from interface: AutomationServer
Gets an array of registered bindings.

Specified by:
getBindings in interface AutomationServer

addBinding

public void addBinding(RestBinding binding)
Description copied from interface: AutomationServer
Registers a new operation binding.

Specified by:
addBinding in interface AutomationServer
Parameters:
binding - the new binding to register

removeBinding

public RestBinding removeBinding(RestBinding binding)
Description copied from interface: AutomationServer
Removes a binding for the given operation name.

Specified by:
removeBinding in interface AutomationServer
Parameters:
binding - the binding to remove
Returns:
the removed binding if any, otherwise null

accept

public boolean accept(String name,
                      boolean isChain,
                      HttpServletRequest req)
Description copied from interface: AutomationServer
Checks if the given operation name is allowed in a REST call.

Specified by:
accept in interface AutomationServer

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.