Package org.jboss.as.ejb3.suspend
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
FieldsModifier and TypeFieldDescriptionstatic final org.jboss.msc.service.ServiceNameEJBSuspendHandlerService nameFields inherited from interface org.jboss.as.server.suspend.ServerActivity
DEFAULT_EXECUTION_GROUP, HIGHEST_EXECUTION_GROUP, LOWEST_EXECUTION_GROUPFields inherited from interface org.jboss.msc.service.Service
NULLFields inherited from interface org.jboss.as.server.suspend.SuspendableActivity
COMPLETED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptInvocation(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.voidafterCompletion(int status) Notifies handler that an active transaction has completed.voidNotifies handler that an active transaction is about to complete.voidenableGracefulTxnShutdown(boolean gracefulTxnShutdown) Sets a new value forgracefulTxnShutdown.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.getValue()Returns service value.voidNotifies handler that an active invocation is complete.booleanIndicates if Jakarta Enterprise Beans subsystem is suspended.voidpreSuspend(org.jboss.as.server.suspend.ServerActivityCallback listener) Pre suspend.voidresume()Notifies local transaction context that server is resumed, and restarts deployment controller.voidstart(org.jboss.msc.service.StartContext context) Starts the service.voidstop(org.jboss.msc.service.StopContext context) Stops the service.voidsuspended(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.voidtransactionCreated(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, waitMethods 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_NAMEEJBSuspendHandlerService 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 forgracefulTxnShutdown.- 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
Returns service value.- Specified by:
getValuein interfaceorg.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:
startin interfaceorg.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:
stopin interfaceorg.jboss.msc.Service- Parameters:
context- stop context
-
preSuspend
public void preSuspend(org.jboss.as.server.suspend.ServerActivityCallback listener) Pre suspend. Do nothing.- Specified by:
preSuspendin interfaceorg.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:
suspendedin interfaceorg.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:
resumein interfaceorg.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:
trueif 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:
transactionCreatedin interfaceorg.wildfly.transaction.client.CreationListener
-
beforeCompletion
public void beforeCompletion()Notifies handler that an active transaction is about to complete.- Specified by:
beforeCompletionin interfacejakarta.transaction.Synchronization
-
afterCompletion
public void afterCompletion(int status) Notifies handler that an active transaction has completed.- Specified by:
afterCompletionin interfacejakarta.transaction.Synchronization
-
isSuspended
public boolean isSuspended()Indicates if Jakarta Enterprise Beans subsystem is suspended.- Returns:
trueif Jakarta Enterprise Beans susbsystem suspension is started (regardless of whether it completed or not)
-