Class AbstractOperationFactory

java.lang.Object
org.tentackle.pdo.AbstractOperationFactory
All Implemented Interfaces:
OperationFactory
Direct Known Subclasses:
DefaultOperationFactory

public abstract class AbstractOperationFactory extends Object implements OperationFactory
Base implementation of a OperationFactory.
Author:
harald
  • 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

      public <T extends Operation<T>> T create(Class<T> clazz, DomainContext context)
      Description copied from interface: OperationFactory
      Creates an operation.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      context - the domain context
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(String className, DomainContext context)
      Description copied from interface: OperationFactory
      Creates an operation.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      context - the domain context
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(T op)
      Description copied from interface: OperationFactory
      Creates an operation.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      op - the operation
      Returns:
      the created operation belonging to the same class as the given op and in same context.
    • create

      public <T extends Operation<T>> T create(T op, String contextName)
      Description copied from interface: OperationFactory
      Creates an operation within a sub context.
      If the current context is already within the given context name, the result is equivalent to OperationFactory.create(Operation).
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      op - the operation
      contextName - the context name
      Returns:
      the created operation belonging to the same class as the given op in a sub context of given name
    • create

      public <T extends Operation<T>> T create(Class<T> clazz, Session session)
      Description copied from interface: OperationFactory
      Creates an operation.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      session - the session
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(String className, Session session)
      Description copied from interface: OperationFactory
      Creates an operation for a session only.

      Note: the application must set the context.

      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      session - the session
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(Class<T> clazz, PersistentOperation<T> persistenceDelegate)
      Description copied from interface: OperationFactory
      Creates an operation for a given persistence delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      persistenceDelegate - the persistence delegate
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(String className, PersistentOperation<T> persistenceDelegate)
      Description copied from interface: OperationFactory
      Creates an operation for a given persistence delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      persistenceDelegate - the persistence delegate
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(Class<T> clazz)
      Description copied from interface: OperationFactory
      Creates an operation without any domain context or session.

      Note: the application must set the context.

      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      Returns:
      the created operation
    • create

      public <T extends Operation<T>> T create(String className)
      Description copied from interface: OperationFactory
      Creates an operation without any domain context or session.

      Note: the application must set the context.

      Specified by:
      create in interface OperationFactory
      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: OperationFactory
      Creates an operation for a given domain delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      context - the domain context
      domainDelegate - 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: OperationFactory
      Creates an operation for a given domain delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      context - the domain context
      domainDelegate - 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: OperationFactory
      Creates an operation for a given domain delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      session - the session
      domainDelegate - 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: OperationFactory
      Creates an operation for a given domain delegate.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      session - the session
      domainDelegate - 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: OperationFactory
      Creates an operation for given delegates.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      clazz - the class of the operation, usually an interface
      persistenceDelegate - the persistence delegate
      domainDelegate - 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: OperationFactory
      Creates an operation for given delegates.
      Specified by:
      create in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      persistenceDelegate - the persistence delegate
      domainDelegate - the domain delegate
      Returns:
      the created operation
    • getPersistenceClass

      public <T extends Operation<T>> Class<PersistentOperation<T>> getPersistenceClass(String className)
      Description copied from interface: OperationFactory
      Gets the class implementing the persistence layer.
      Specified by:
      getPersistenceClass in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      Returns:
      the persistence class
    • getDomainClass

      public <T extends Operation<T>> Class<DomainOperation<T>> getDomainClass(String className)
      Description copied from interface: OperationFactory
      Gets the class implementing the domain layer.
      Specified by:
      getDomainClass in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      Returns:
      the domain class
    • createPersistenceDelegate

      public <T extends Operation<T>> PersistentOperation<T> createPersistenceDelegate(String className)
      Description copied from interface: OperationFactory
      Creates the delegate implementing the persistence layer.
      Specified by:
      createPersistenceDelegate in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      Returns:
      the persistent delegate
    • createDomainDelegate

      public <T extends Operation<T>> DomainOperation<T> createDomainDelegate(String className)
      Description copied from interface: OperationFactory
      Creates the delegate implementing the domain layer.
      Specified by:
      createDomainDelegate in interface OperationFactory
      Type Parameters:
      T - the operation type
      Parameters:
      className - the name of operation-class, usually an interface
      Returns:
      the domain delegate