@Service(name="microprofile-fault-tolerance-service") @RunLevel(value=10) public class FaultToleranceService extends Object implements EventListener
EventListener.Event<T>| Modifier and Type | Field and Description |
|---|---|
static String |
FALLBACK_HANDLER_METHOD_NAME |
static String |
FAULT_TOLERANCE_ENABLED_PROPERTY |
| Constructor and Description |
|---|
FaultToleranceService() |
| Modifier and Type | Method and Description |
|---|---|
void |
event(EventListener.Event event)
Process a Glassfish/Payara event
|
String |
getApplicationName(InvocationManager invocationManager,
javax.interceptor.InvocationContext invocationContext)
Gets the application name from the invocation manager.
|
Semaphore |
getBulkheadExecutionQueueSemaphore(String applicationName,
Method annotatedMethod,
int bulkheadWaitingTaskQueue)
Gets the Bulkhead Execution Queue Semaphore for a given application method, registering it to the
FaultToleranceService if it hasn't already.
|
Semaphore |
getBulkheadExecutionSemaphore(String applicationName,
Method annotatedMethod,
int bulkheadValue)
Gets the Bulkhead Execution Semaphore for a given application method, registering it to the
FaultToleranceService if it hasn't already.
|
CircuitBreakerState |
getCircuitBreakerState(String applicationName,
Method annotatedMethod,
org.eclipse.microprofile.faulttolerance.CircuitBreaker circuitBreaker)
Gets the CircuitBreakerState object for a given application name and method.
|
javax.enterprise.concurrent.ManagedExecutorService |
getManagedExecutorService()
Gets the configured ManagedExecutorService.
|
javax.enterprise.concurrent.ManagedScheduledExecutorService |
getManagedScheduledExecutorService()
Gets the configured ManagedScheduledExecutorService.
|
Boolean |
isFaultToleranceEnabled(String applicationName,
org.eclipse.microprofile.config.Config config)
Checks whether fault tolerance is enabled for a given application, setting its enabled value if it doesn't
already have one.
|
void |
postConstruct() |
void |
traceFaultToleranceEvent(RequestEvent requestEvent,
InvocationManager invocationManager,
javax.interceptor.InvocationContext invocationContext) |
public static final String FAULT_TOLERANCE_ENABLED_PROPERTY
public static final String FALLBACK_HANDLER_METHOD_NAME
@PostConstruct public void postConstruct()
public void event(EventListener.Event event)
EventListenerevent in interface EventListenerpublic Boolean isFaultToleranceEnabled(String applicationName, org.eclipse.microprofile.config.Config config)
applicationName - The application to check if Fault Tolerance is enabled for.config - The application config to check for any override values when setting the enabled status for an
unregistered application.public javax.enterprise.concurrent.ManagedExecutorService getManagedExecutorService()
throws NamingException
NamingException - If the default ManagedExecutorService couldn't be foundpublic javax.enterprise.concurrent.ManagedScheduledExecutorService getManagedScheduledExecutorService()
throws NamingException
NamingException - If the default ManagedScheduledExecutorService couldn't be foundpublic Semaphore getBulkheadExecutionSemaphore(String applicationName, Method annotatedMethod, int bulkheadValue)
applicationName - The name of the applicationannotatedMethod - The method that's annotated with @BulkheadbulkheadValue - The value parameter of the Bulkhead annotationpublic Semaphore getBulkheadExecutionQueueSemaphore(String applicationName, Method annotatedMethod, int bulkheadWaitingTaskQueue)
applicationName - The name of the applicationannotatedMethod - The method that's annotated with @Bulkhead and @AsynchronousbulkheadWaitingTaskQueue - The waitingTaskQueue parameter of the Bulkhead annotationpublic CircuitBreakerState getCircuitBreakerState(String applicationName, Method annotatedMethod, org.eclipse.microprofile.faulttolerance.CircuitBreaker circuitBreaker)
applicationName - The application nameannotatedMethod - The method annotated with @CircuitBreakercircuitBreaker - The @CircuitBreaker annotation from the annotated methodpublic String getApplicationName(InvocationManager invocationManager, javax.interceptor.InvocationContext invocationContext)
invocationManager - The invocation manager to get the application name frominvocationContext - The context of the current invocationpublic void traceFaultToleranceEvent(RequestEvent requestEvent, InvocationManager invocationManager, javax.interceptor.InvocationContext invocationContext)
Copyright © 2018. All rights reserved.