|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.automation.core.impl.OperationServiceImpl
public class OperationServiceImpl
The operation registry is thread safe and optimized for modifications at startup and lookups at runtime.
Constructor Summary | |
---|---|
OperationServiceImpl()
|
Method Summary | ||
---|---|---|
CompiledChain |
compileChain(java.lang.Class<?> inputType,
OperationChain chain)
Builds the operation chain given a context. |
|
CompiledChain |
compileChain(java.lang.Class<?> inputType,
OperationParameters... chain)
Same as previous but takes an array of operation parameters |
|
|
getAdaptedValue(OperationContext ctx,
java.lang.Object toAdapt,
java.lang.Class<?> targetType)
Adapts an object to a target type if possible otherwise throws an exception. |
|
org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.ChainEntry |
getChainEntry(java.lang.String id)
|
|
java.util.List<OperationDocumentation> |
getDocumentation()
Generates a documentation model for all registered operations. |
|
OperationType |
getOperation(java.lang.String id)
Gets an operation type given its ID. |
|
OperationChain |
getOperationChain(java.lang.String id)
Gets a registered operation chain. |
|
java.util.List<OperationChain> |
getOperationChains()
Gets a list of all registered chains |
|
OperationType[] |
getOperations()
Gets all operation types that was registered. |
|
TypeAdapter |
getTypeAdapter(java.lang.Class<?> accept,
java.lang.Class<?> produce)
Gets a type adapter for the input type accept and the output type produce. |
|
static java.lang.Class<?> |
getTypeForPrimitive(java.lang.Class<?> primitiveType)
|
|
boolean |
isTypeAdaptable(java.lang.Class<?> typeToAdapt,
java.lang.Class<?> targetType)
Checks whether or not the given type is adaptable into the target type. |
|
void |
putOperation(java.lang.Class<?> type)
Registers an operation given its class. |
|
void |
putOperation(java.lang.Class<?> type,
boolean replace)
Registers an operation given its class. |
|
void |
putOperationChain(OperationChain chain)
Registers a parametrized operation chain. |
|
void |
putOperationChain(OperationChain chain,
boolean replace)
Registers a parametrized operation chain. |
|
void |
putTypeAdapter(java.lang.Class<?> accept,
java.lang.Class<?> produce,
TypeAdapter adapter)
Registers a new type adapter that can adapt an instance of the accepted type into one of the produced type. |
|
void |
removeOperation(java.lang.Class<?> key)
Removes an operation given its class. |
|
void |
removeOperationChain(java.lang.String id)
Removes a registered operation chain given its ID. |
|
void |
removeTypeAdapter(java.lang.Class<?> accept,
java.lang.Class<?> produce)
Removes a type adapter |
|
java.lang.Object |
run(OperationContext ctx,
OperationChain chain)
Builds and runs the operation chain given a context. |
|
java.lang.Object |
run(OperationContext ctx,
java.lang.String chainId)
Same as previous but for managed chains identified by an ID. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OperationServiceImpl()
Method Detail |
---|
public java.lang.Object run(OperationContext ctx, java.lang.String chainId) throws java.lang.Exception, InvalidChainException
AutomationService
run
in interface AutomationService
java.lang.Exception
InvalidChainException
public java.lang.Object run(OperationContext ctx, OperationChain chain) throws java.lang.Exception, InvalidChainException
AutomationService
InvalidChainException
is thrown.
run
in interface AutomationService
java.lang.Exception
InvalidChainException
public void putOperationChain(OperationChain chain) throws OperationException
AutomationService
run
and passing the chain ID. If a chain
having the same ID exists an exception is thrown
putOperationChain
in interface AutomationService
OperationException
public void putOperationChain(OperationChain chain, boolean replace) throws OperationException
AutomationService
run
and passing the chain ID. If the
replace attribute is true then any chain already registered under the
same id will be replaced otherwise an exception is thrown.
putOperationChain
in interface AutomationService
OperationException
public void removeOperationChain(java.lang.String id)
AutomationService
removeOperationChain
in interface AutomationService
public OperationChain getOperationChain(java.lang.String id) throws OperationNotFoundException
AutomationService
getOperationChain
in interface AutomationService
OperationNotFoundException
public java.util.List<OperationChain> getOperationChains()
AutomationService
getOperationChains
in interface AutomationService
public org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.ChainEntry getChainEntry(java.lang.String id) throws OperationException
OperationException
public void putOperation(java.lang.Class<?> type) throws OperationException
AutomationService
Operation
annotation. If an operation having the
same ID exists an exception will be thrown.
putOperation
in interface AutomationService
OperationException
public void putOperation(java.lang.Class<?> type, boolean replace) throws OperationException
AutomationService
Operation
annotation. If the
replace
argument is true then any existing operation
having the same ID will replaced with this one.
putOperation
in interface AutomationService
OperationException
public void removeOperation(java.lang.Class<?> key)
AutomationService
removeOperation
in interface AutomationService
public OperationType[] getOperations()
AutomationService
getOperations
in interface AutomationService
public OperationType getOperation(java.lang.String id) throws OperationNotFoundException
AutomationService
getOperation
in interface AutomationService
OperationNotFoundException
public CompiledChain compileChain(java.lang.Class<?> inputType, OperationChain chain) throws java.lang.Exception, InvalidChainException
AutomationService
InvalidChainException
is thrown.
The returned object can be used to run the chain.
compileChain
in interface AutomationService
java.lang.Exception
InvalidChainException
public CompiledChain compileChain(java.lang.Class<?> inputType, OperationParameters... chain) throws java.lang.Exception, InvalidChainException
AutomationService
compileChain
in interface AutomationService
java.lang.Exception
InvalidChainException
public void putTypeAdapter(java.lang.Class<?> accept, java.lang.Class<?> produce, TypeAdapter adapter)
AutomationService
putTypeAdapter
in interface AutomationService
public void removeTypeAdapter(java.lang.Class<?> accept, java.lang.Class<?> produce)
AutomationService
removeTypeAdapter
in interface AutomationService
public TypeAdapter getTypeAdapter(java.lang.Class<?> accept, java.lang.Class<?> produce)
AutomationService
getTypeAdapter
in interface AutomationService
public boolean isTypeAdaptable(java.lang.Class<?> typeToAdapt, java.lang.Class<?> targetType)
AutomationService
This is a shortcut to
getTypeAdapter(typeToAdapt, targetType) != null
isTypeAdaptable
in interface AutomationService
public <T> T getAdaptedValue(OperationContext ctx, java.lang.Object toAdapt, java.lang.Class<?> targetType) throws java.lang.Exception
AutomationService
getAdaptedValue
in interface AutomationService
java.lang.Exception
public java.util.List<OperationDocumentation> getDocumentation()
AutomationService
getDocumentation
in interface AutomationService
public static java.lang.Class<?> getTypeForPrimitive(java.lang.Class<?> primitiveType)
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |