Class JSEServiceChannel

  • All Implemented Interfaces:
    com.anaptecs.jeaf.core.servicechannel.api.ServiceChannel

    public abstract class JSEServiceChannel
    extends AbstractServiceChannel
    Core implementation of JEAF's service channel interface. This class is a minimum implementation of a service channel and so does not support environment specific features such as transactions or remote calls. The implementation of this class is intended to just support local / in JVM service calls. Instances of this class are state less and support multi threading.
    Version:
    1.0
    Author:
    JEAF Development Team
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected JSEServiceChannel​(com.anaptecs.jeaf.core.servicechannel.api.LifecycleManager pLifecycleManager)
      Initialize object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.anaptecs.jeaf.xfun.api.health.HealthCheckResult checkService​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceClass, com.anaptecs.jeaf.xfun.api.health.CheckLevel pCheckLevel)
      Method checks the state of the passed service.
      protected com.anaptecs.jeaf.core.api.ServiceInvocationContext createServiceInvocationContext​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pTargetServiceClass, com.anaptecs.jeaf.core.api.Component pComponent, com.anaptecs.jeaf.xfun.api.info.ApplicationInfo pInvokingApplication, com.anaptecs.jeaf.core.api.SessionContext pSessionContext)
      Method creates a new instance of a service invocation context object.
      java.io.Serializable executeCommandTxMandatory​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      java.io.Serializable executeCommandTxNever​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      java.io.Serializable executeCommandTxNotSupported​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      java.io.Serializable executeCommandTxRequired​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      java.io.Serializable executeCommandTxRequiresNew​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      java.io.Serializable executeCommandTxSupports​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
      Method executes the passed command.
      protected void releasingTxContext​(com.anaptecs.jeaf.core.api.TxContext pTxContext)
      Method will be called whenever a previously created transaction context is about to be released.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSEServiceChannel

        protected JSEServiceChannel​(com.anaptecs.jeaf.core.servicechannel.api.LifecycleManager pLifecycleManager)
        Initialize object. Currently no actions are performed.
        Parameters:
        pLifecycleManager - Lifecycle manager to which this service channel belongs to. The parameter must not be null.
    • Method Detail

      • createServiceInvocationContext

        protected final com.anaptecs.jeaf.core.api.ServiceInvocationContext createServiceInvocationContext​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pTargetServiceClass,
                                                                                                           com.anaptecs.jeaf.core.api.Component pComponent,
                                                                                                           com.anaptecs.jeaf.xfun.api.info.ApplicationInfo pInvokingApplication,
                                                                                                           com.anaptecs.jeaf.core.api.SessionContext pSessionContext)
        Method creates a new instance of a service invocation context object. Depending on the current context the method will either return a new CoreRootContext or CoreServiceInvocationContext object.
        Specified by:
        createServiceInvocationContext in class AbstractServiceChannel
        Parameters:
        pTargetServiceClass - Class object of service interface that is called. The parameter must not be null.
        pComponent - Component to which the represented service call belongs to. The parameter must not be null.
        pTransactionBehavior - Transaction behavior which is used for the current service call. The parameter must not be null.
        pInvokingApplication - Information about the invoking application. The parameter must not be null.
        Returns:
        ServiceInvocationContext Created service invocation context object. The method never returns null.
        See Also:
        AbstractServiceChannel#createServiceInvocationContext()
      • releasingTxContext

        protected void releasingTxContext​(com.anaptecs.jeaf.core.api.TxContext pTxContext)
        Method will be called whenever a previously created transaction context is about to be released. This means depending on the transactions state that is will either be committed or rolled back (see TxContext.getRollbackOnly()). It depends on the concrete implementation of the service channel, whether actions have to performed or not. The method will be called before the transaction context will be released and become invalid. This class only provides an empty implementation.
        Specified by:
        releasingTxContext in class AbstractServiceChannel
        Parameters:
        pTxContext - Transaction context that will be released. The parameter is never used since this service channel implementation does not support transactions.
      • executeCommandTxNotSupported

        public final java.io.Serializable executeCommandTxNotSupported​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                                throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                       com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior NOT_SUPPORTED. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxNotSupported(Command)
      • executeCommandTxSupports

        public final java.io.Serializable executeCommandTxSupports​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                            throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                   com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior SUPPORTS. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxSupports(Command)
      • executeCommandTxRequired

        public final java.io.Serializable executeCommandTxRequired​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                            throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                   com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior REQUIRED. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxRequired(Command)
      • executeCommandTxRequiresNew

        public final java.io.Serializable executeCommandTxRequiresNew​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                               throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                      com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior REQUIRES_NEW. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxRequiresNew(Command)
      • executeCommandTxMandatory

        public final java.io.Serializable executeCommandTxMandatory​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                             throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                    com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior MANDATORY. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxMandatory(Command)
      • executeCommandTxNever

        public final java.io.Serializable executeCommandTxNever​(com.anaptecs.jeaf.core.servicechannel.api.Command pCommand)
                                                         throws com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException,
                                                                com.anaptecs.jeaf.xfun.api.errorhandling.SystemException
        Method executes the passed command. For this implementation of a service channel this means that a local (in VM) method call will be performed. This method call through the service channel should be executed with transaction behavior NEVER. However this service channel implementation currently does not support transactions.
        Parameters:
        pCommand - Command object that should be executed. The command objects contains all parameters that are required to perform the corresponding service call. The parameter must not be null.
        Returns:
        Serializable Result of the command execution. Since JEAF supports distributed environments all results must be serializable.
        Throws:
        com.anaptecs.jeaf.xfun.api.errorhandling.ApplicationException - Services may throw an ApplicationException in order to indicate an application specific problem.The current transaction will not be automatically rollbacked.
        com.anaptecs.jeaf.xfun.api.errorhandling.SystemException - Service may throw a SystemException in order to indicate technical problems. In the case of an system exception the current transaction will be rollbacked.
        See Also:
        ServiceChannel.executeCommandTxNever(Command)
      • checkService

        public final com.anaptecs.jeaf.xfun.api.health.HealthCheckResult checkService​(java.lang.Class<? extends com.anaptecs.jeaf.core.api.Service> pServiceClass,
                                                                                      com.anaptecs.jeaf.xfun.api.health.CheckLevel pCheckLevel)
        Method checks the state of the passed service. Method checks the current state of the service implementation that provides the passed service interface. This method call through the service channel should be executed with transaction behavior REQUIRES_NEW. However this service channel implementation currently does not support transactions.
        Parameters:
        pService - Service whose state should be checked. The parameter must not be null.
        pCheckLevel - Level of check that should be performed. The parameter must not be null.
        Returns:
        HealthCheckResult Object describing the result of the check. The method may return null. This means that the service does not implement any checks.