Package pl.morgwai.base.servlet.scopes
Class ContextTrackingExecutor
- java.lang.Object
-
- pl.morgwai.base.guice.scopes.ContextTrackingExecutor
-
- pl.morgwai.base.servlet.scopes.ContextTrackingExecutor
-
- All Implemented Interfaces:
Executor
public class ContextTrackingExecutor extends ContextTrackingExecutor
AContextTrackingExecutor
with additionalexecute(httpResponse, task)
andexecute(wsConnection, task)
methods that send503
/TRY_AGAIN_LATER
if the task is rejected. This can happen due to an overload or a shutdown.Instances can be created using
ServletModule.newContextTrackingExecutor(...)
helper methods family.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class pl.morgwai.base.guice.scopes.ContextTrackingExecutor
ContextTrackingExecutor.NamedThreadFactory
-
-
Field Summary
-
Fields inherited from class pl.morgwai.base.guice.scopes.ContextTrackingExecutor
log
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Awaitable.WithUnit
awaitableOfAwaitTermination()
Optional<List<Runnable>>
enforceTermination(long timeout, TimeUnit unit)
Deprecated.This method will throwRuntimeException
.void
execute(HttpServletResponse response, Runnable task)
Callsexecute(task)
and if it's rejected, sendsHttpServletResponse.SC_SERVICE_UNAVAILABLE
toresponse
.void
execute(Session connection, Runnable task)
Callsexecute(task)
and if it's rejected, closesconnection
withCloseReason.CloseCodes.TRY_AGAIN_LATER
.void
shutdown()
Deprecated.This method will throwRuntimeException
.List<Runnable>
shutdownNow()
Deprecated.This method will throwRuntimeException
.-
Methods inherited from class pl.morgwai.base.guice.scopes.ContextTrackingExecutor
awaitTermination, awaitTermination, execute, execute, executeWithinAll, executeWithinAll, getActiveContexts, getName, getPoolSize, isShutdown, isTerminated, toString
-
-
-
-
Method Detail
-
execute
public void execute(HttpServletResponse response, Runnable task)
Callsexecute(task)
and if it's rejected, sendsHttpServletResponse.SC_SERVICE_UNAVAILABLE
toresponse
.
-
execute
public void execute(Session connection, Runnable task)
Callsexecute(task)
and if it's rejected, closesconnection
withCloseReason.CloseCodes.TRY_AGAIN_LATER
.
-
awaitableOfAwaitTermination
public Awaitable.WithUnit awaitableOfAwaitTermination()
-
shutdown
@Deprecated public void shutdown()
Deprecated.This method will throwRuntimeException
. Executors obtained fromServletModule
are shutdown automatically at app shutdown.- Overrides:
shutdown
in classContextTrackingExecutor
-
enforceTermination
@Deprecated public Optional<List<Runnable>> enforceTermination(long timeout, TimeUnit unit)
Deprecated.This method will throwRuntimeException
. Executors obtained fromServletModule
are shutdown automatically at app shutdown.- Overrides:
enforceTermination
in classContextTrackingExecutor
-
shutdownNow
@Deprecated public List<Runnable> shutdownNow()
Deprecated.This method will throwRuntimeException
. Executors obtained fromServletModule
are shutdown automatically at app shutdown.- Overrides:
shutdownNow
in classContextTrackingExecutor
-
-