Class EJBSuspendHandlerService

java.lang.Object
org.jboss.as.ejb3.suspend.EJBSuspendHandlerService
All Implemented Interfaces:
jakarta.transaction.Synchronization, org.jboss.as.server.suspend.ServerActivity, org.jboss.as.server.suspend.SuspendableActivity, org.jboss.msc.Service, org.jboss.msc.service.Service<EJBSuspendHandlerService>, org.jboss.msc.value.Value<EJBSuspendHandlerService>, org.wildfly.transaction.client.CreationListener

public class EJBSuspendHandlerService extends Object implements org.jboss.msc.service.Service<EJBSuspendHandlerService>, org.jboss.as.server.suspend.ServerActivity, org.wildfly.transaction.client.CreationListener, jakarta.transaction.Synchronization
Controls shutdown indicating whether a remote request should be accepted or not.
Author:
Flavia Rainone
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.wildfly.transaction.client.CreationListener

    org.wildfly.transaction.client.CreationListener.CreatedBy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.jboss.msc.service.ServiceName
    EJBSuspendHandlerService name

    Fields inherited from interface org.jboss.as.server.suspend.ServerActivity

    DEFAULT_EXECUTION_GROUP, HIGHEST_EXECUTION_GROUP, LOWEST_EXECUTION_GROUP

    Fields inherited from interface org.jboss.msc.service.Service

    NULL

    Fields inherited from interface org.jboss.as.server.suspend.SuspendableActivity

    COMPLETED
  • Constructor Summary

    Constructors
    Constructor
    Description
    EJBSuspendHandlerService(boolean gracefulTxnShutdown)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    acceptInvocation(org.jboss.invocation.InterceptorContext context)
    Indicates if a invocation should be accepted: which will happen only if server is not suspended, or if the invocation involves a still active transaction.
    void
    afterCompletion(int status)
    Notifies handler that an active transaction has completed.
    void
    Notifies handler that an active transaction is about to complete.
    void
    enableGracefulTxnShutdown(boolean gracefulTxnShutdown)
    Sets a new value for gracefulTxnShutdown.
    org.jboss.msc.value.InjectedValue<DeploymentRepository>
    Returns deployment repository injected value.
    org.jboss.msc.value.InjectedValue<org.wildfly.transaction.client.LocalTransactionContext>
    Returns local transaction context injected value.
    org.jboss.msc.value.InjectedValue<org.jboss.as.server.suspend.SuspendController>
    Returns suspend controller injected value.
    Returns service value.
    void
    Notifies handler that an active invocation is complete.
    boolean
    Indicates if Jakarta Enterprise Beans subsystem is suspended.
    void
    preSuspend(org.jboss.as.server.suspend.ServerActivityCallback listener)
    Pre suspend.
    void
    Notifies local transaction context that server is resumed, and restarts deployment controller.
    void
    start(org.jboss.msc.service.StartContext context)
    Starts the service.
    void
    stop(org.jboss.msc.service.StopContext context)
    Stops the service.
    void
    suspended(org.jboss.as.server.suspend.ServerActivityCallback listener)
    Notifies local transaction context that server is suspended, and only completes suspension if there are no active invocations nor transactions.
    void
    transactionCreated(org.wildfly.transaction.client.AbstractTransaction transaction, org.wildfly.transaction.client.CreationListener.CreatedBy createdBy)
    Notifies handler that a new transaction has been created.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.jboss.as.server.suspend.ServerActivity

    getExecutionGroup, prepare, resume, suspend
  • Field Details

    • SERVICE_NAME

      public static final org.jboss.msc.service.ServiceName SERVICE_NAME
      EJBSuspendHandlerService name
  • Constructor Details

    • EJBSuspendHandlerService

      public EJBSuspendHandlerService(boolean gracefulTxnShutdown)
      Constructor.
      Parameters:
      gracefulTxnShutdown - value of model attribute
  • Method Details

    • enableGracefulTxnShutdown

      public void enableGracefulTxnShutdown(boolean gracefulTxnShutdown)
      Sets a new value for gracefulTxnShutdown.
      Parameters:
      gracefulTxnShutdown - new value of the model attribute
    • getSuspendControllerInjectedValue

      public org.jboss.msc.value.InjectedValue<org.jboss.as.server.suspend.SuspendController> getSuspendControllerInjectedValue()
      Returns suspend controller injected value.
      Returns:
      suspend controller injected value
    • getLocalTransactionContextInjectedValue

      public org.jboss.msc.value.InjectedValue<org.wildfly.transaction.client.LocalTransactionContext> getLocalTransactionContextInjectedValue()
      Returns local transaction context injected value.
      Returns:
      local transaction context injected value
    • getDeploymentRepositoryInjectedValue

      public org.jboss.msc.value.InjectedValue<DeploymentRepository> getDeploymentRepositoryInjectedValue()
      Returns deployment repository injected value.
      Returns:
      local transaction context injected value
    • getValue

      public EJBSuspendHandlerService getValue()
      Returns service value.
      Specified by:
      getValue in interface org.jboss.msc.value.Value<EJBSuspendHandlerService>
    • start

      public void start(org.jboss.msc.service.StartContext context)
      Starts the service. Registers server activity, sets transaction listener on local transaction context, and creates and installs deployment controller service.
      Specified by:
      start in interface org.jboss.msc.Service
      Parameters:
      context - start context
    • stop

      public void stop(org.jboss.msc.service.StopContext context)
      Stops the service. Unregisters service activity and clears transaction listener.
      Specified by:
      stop in interface org.jboss.msc.Service
      Parameters:
      context - stop context
    • preSuspend

      public void preSuspend(org.jboss.as.server.suspend.ServerActivityCallback listener)
      Pre suspend. Do nothing.
      Specified by:
      preSuspend in interface org.jboss.as.server.suspend.ServerActivity
      Parameters:
      listener - callback listener
    • suspended

      public void suspended(org.jboss.as.server.suspend.ServerActivityCallback listener)
      Notifies local transaction context that server is suspended, and only completes suspension if there are no active invocations nor transactions.
      Specified by:
      suspended in interface org.jboss.as.server.suspend.ServerActivity
      Parameters:
      listener - callback listener
    • resume

      public void resume()
      Notifies local transaction context that server is resumed, and restarts deployment controller.
      Specified by:
      resume in interface org.jboss.as.server.suspend.ServerActivity
    • acceptInvocation

      public boolean acceptInvocation(org.jboss.invocation.InterceptorContext context) throws jakarta.transaction.SystemException
      Indicates if a invocation should be accepted: which will happen only if server is not suspended, or if the invocation involves a still active transaction.
      Parameters:
      context - interceptor context
      Returns:
      true if invocation can be accepted by invoking interceptor
      Throws:
      jakarta.transaction.SystemException
    • invocationComplete

      public void invocationComplete()
      Notifies handler that an active invocation is complete.
    • transactionCreated

      public void transactionCreated(org.wildfly.transaction.client.AbstractTransaction transaction, org.wildfly.transaction.client.CreationListener.CreatedBy createdBy)
      Notifies handler that a new transaction has been created.
      Specified by:
      transactionCreated in interface org.wildfly.transaction.client.CreationListener
    • beforeCompletion

      public void beforeCompletion()
      Notifies handler that an active transaction is about to complete.
      Specified by:
      beforeCompletion in interface jakarta.transaction.Synchronization
    • afterCompletion

      public void afterCompletion(int status)
      Notifies handler that an active transaction has completed.
      Specified by:
      afterCompletion in interface jakarta.transaction.Synchronization
    • isSuspended

      public boolean isSuspended()
      Indicates if Jakarta Enterprise Beans subsystem is suspended.
      Returns:
      true if Jakarta Enterprise Beans susbsystem suspension is started (regardless of whether it completed or not)