Class AbstractOperationFactory
java.lang.Object
org.tentackle.pdo.AbstractOperationFactory
- All Implemented Interfaces:
OperationFactory
- Direct Known Subclasses:
DefaultOperationFactory
Base implementation of a
OperationFactory.- Author:
- harald
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Operation<T>>
TCreates an operation without any domain context or session.<T extends Operation<T>>
Tcreate(Class<T> clazz, DomainContext context) Creates an operation.<T extends Operation<T>>
Tcreate(Class<T> clazz, DomainContext context, DomainOperation<T> domainDelegate) Creates an operation for a given domain delegate.<T extends Operation<T>>
Tcreate(Class<T> clazz, PersistentOperation<T> persistenceDelegate) Creates an operation for a given persistence delegate.<T extends Operation<T>>
Tcreate(Class<T> clazz, PersistentOperation<T> persistenceDelegate, DomainOperation<T> domainDelegate) Creates an operation for given delegates.<T extends Operation<T>>
TCreates an operation.<T extends Operation<T>>
Tcreate(Class<T> clazz, Session session, DomainOperation<T> domainDelegate) Creates an operation for a given domain delegate.<T extends Operation<T>>
TCreates an operation without any domain context or session.<T extends Operation<T>>
Tcreate(String className, DomainContext context) Creates an operation.<T extends Operation<T>>
Tcreate(String className, DomainContext context, DomainOperation<T> domainDelegate) Creates an operation for a given domain delegate.<T extends Operation<T>>
Tcreate(String className, PersistentOperation<T> persistenceDelegate) Creates an operation for a given persistence delegate.<T extends Operation<T>>
Tcreate(String className, PersistentOperation<T> persistenceDelegate, DomainOperation<T> domainDelegate) Creates an operation for given delegates.<T extends Operation<T>>
TCreates an operation for a session only.<T extends Operation<T>>
Tcreate(String className, Session session, DomainOperation<T> domainDelegate) Creates an operation for a given domain delegate.<T extends Operation<T>>
Tcreate(T op) Creates an operation.<T extends Operation<T>>
TCreates an operation within a sub context.
If the current context is already within the given context name, the result is equivalent toOperationFactory.create(Operation).<T extends Operation<T>>
DomainOperation<T> createDomainDelegate(String className) Creates the delegate implementing the domain layer.protected <T extends Operation<T>>
OperationInvocationHandler<T> createInvocationHandler(Class<T> clazz) Creates an operation invocation handler for given class.
Override this method if you need an application-specific invocation handler.<T extends Operation<T>>
PersistentOperation<T> createPersistenceDelegate(String className) Creates the delegate implementing the persistence layer.<T extends Operation<T>>
Class<DomainOperation<T>> getDomainClass(String className) Gets the class implementing the domain layer.abstract org.tentackle.reflect.ClassMapperGets the domain class mapper associated to this factory.
The classmapper usually maps interfaces (domain + persistence) to the domain implementation.<T extends Operation<T>>
Class<PersistentOperation<T>> getPersistenceClass(String className) Gets the class implementing the persistence layer.abstract org.tentackle.reflect.ClassMapperGets the persistence class mapper associated to this factory.
The classmapper usually maps interfaces (domain + persistence) to the persistence implementation.
-
Constructor Details
-
AbstractOperationFactory
public AbstractOperationFactory()Parent constructor.
-
-
Method Details
-
getPersistenceMapper
public abstract org.tentackle.reflect.ClassMapper getPersistenceMapper()Gets the persistence class mapper associated to this factory.
The classmapper usually maps interfaces (domain + persistence) to the persistence implementation.- Returns:
- the mapper for the persistence classes
-
getDomainMapper
public abstract org.tentackle.reflect.ClassMapper getDomainMapper()Gets the domain class mapper associated to this factory.
The classmapper usually maps interfaces (domain + persistence) to the domain implementation.- Returns:
- the mapper for the domain classes
-
createInvocationHandler
protected <T extends Operation<T>> OperationInvocationHandler<T> createInvocationHandler(Class<T> clazz) throws ClassNotFoundException Creates an operation invocation handler for given class.
Override this method if you need an application-specific invocation handler.- Type Parameters:
T- the operation type- Parameters:
clazz- the operation interface- Returns:
- the invocation handler
- Throws:
ClassNotFoundException- if clazz not found- See Also:
-
create
Description copied from interface:OperationFactoryCreates an operation.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacecontext- the domain context- Returns:
- the created operation
-
create
Description copied from interface:OperationFactoryCreates an operation.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacecontext- the domain context- Returns:
- the created operation
-
create
Description copied from interface:OperationFactoryCreates an operation.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
op- the operation- Returns:
- the created operation belonging to the same class as the given
opand in same context.
-
create
Description copied from interface:OperationFactoryCreates an operation within a sub context.
If the current context is already within the given context name, the result is equivalent toOperationFactory.create(Operation).- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
op- the operationcontextName- the context name- Returns:
- the created operation belonging to the same class as the given
opin a sub context of given name
-
create
Description copied from interface:OperationFactoryCreates an operation.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacesession- the session- Returns:
- the created operation
-
create
Description copied from interface:OperationFactoryCreates an operation for a session only.Note: the application must set the context.
- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacesession- the session- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(Class<T> clazz, PersistentOperation<T> persistenceDelegate) Description copied from interface:OperationFactoryCreates an operation for a given persistence delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacepersistenceDelegate- the persistence delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(String className, PersistentOperation<T> persistenceDelegate) Description copied from interface:OperationFactoryCreates an operation for a given persistence delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacepersistenceDelegate- the persistence delegate- Returns:
- the created operation
-
create
Description copied from interface:OperationFactoryCreates an operation without any domain context or session.Note: the application must set the context.
- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interface- Returns:
- the created operation
-
create
Description copied from interface:OperationFactoryCreates an operation without any domain context or session.Note: the application must set the context.
- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interface- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(Class<T> clazz, DomainContext context, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for a given domain delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacecontext- the domain contextdomainDelegate- the domain delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(String className, DomainContext context, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for a given domain delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacecontext- the domain contextdomainDelegate- the domain delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(Class<T> clazz, Session session, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for a given domain delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacesession- the sessiondomainDelegate- the domain delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(String className, Session session, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for a given domain delegate.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacesession- the sessiondomainDelegate- the domain delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(Class<T> clazz, PersistentOperation<T> persistenceDelegate, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for given delegates.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
clazz- the class of the operation, usually an interfacepersistenceDelegate- the persistence delegatedomainDelegate- the domain delegate- Returns:
- the created operation
-
create
public <T extends Operation<T>> T create(String className, PersistentOperation<T> persistenceDelegate, DomainOperation<T> domainDelegate) Description copied from interface:OperationFactoryCreates an operation for given delegates.- Specified by:
createin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interfacepersistenceDelegate- the persistence delegatedomainDelegate- the domain delegate- Returns:
- the created operation
-
getPersistenceClass
Description copied from interface:OperationFactoryGets the class implementing the persistence layer.- Specified by:
getPersistenceClassin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interface- Returns:
- the persistence class
-
getDomainClass
Description copied from interface:OperationFactoryGets the class implementing the domain layer.- Specified by:
getDomainClassin interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interface- Returns:
- the domain class
-
createPersistenceDelegate
Description copied from interface:OperationFactoryCreates the delegate implementing the persistence layer.- Specified by:
createPersistenceDelegatein interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interface- Returns:
- the persistent delegate
-
createDomainDelegate
Description copied from interface:OperationFactoryCreates the delegate implementing the domain layer.- Specified by:
createDomainDelegatein interfaceOperationFactory- Type Parameters:
T- the operation type- Parameters:
className- the name of operation-class, usually an interface- Returns:
- the domain delegate
-