Class WorkContextHandlerImpl
- java.lang.Object
-
- com.sun.enterprise.connectors.work.context.WorkContextHandlerImpl
-
- All Implemented Interfaces:
WorkContextHandler
@Service @PerLookup public class WorkContextHandlerImpl extends Object implements WorkContextHandler
Handles work contexts submitted as part of the work instance- Since:
- GlassFish v3
- Author:
- Jagadish Ramu
-
-
Constructor Summary
Constructors Constructor Description WorkContextHandlerImpl()
WorkContextHandlerImpl(ConnectorRuntime runtime, ClassLoader cl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canContainerHandleContext(String contextClassName)
checks whether the container can handle the contextClass in question.static void
debug(String message)
static jakarta.resource.spi.work.ExecutionContext
getExecutionContext(jakarta.resource.spi.work.Work work)
void
init(String raName, ClassLoader cl)
initialize the work-context-handlerboolean
isContextSupported(boolean strict, String workContextClassName)
indicates whether the provided workContextClass is supported by the containerboolean
isContextSupported(Class contextClass)
void
setupContext(jakarta.resource.spi.work.ExecutionContext ec, WorkCoordinator wc, OneWork work)
setup the work context or execution context for the workvoid
validateWork(jakarta.resource.spi.work.Work work, jakarta.resource.spi.work.ExecutionContext ec)
validate the submitted work
-
-
-
Constructor Detail
-
WorkContextHandlerImpl
public WorkContextHandlerImpl()
-
WorkContextHandlerImpl
public WorkContextHandlerImpl(ConnectorRuntime runtime, ClassLoader cl)
-
-
Method Detail
-
init
public void init(String raName, ClassLoader cl)
initialize the work-context-handler- Specified by:
init
in interfaceWorkContextHandler
- Parameters:
raName
- resource-adapter namecl
- class-loader of the resource-adapter
-
isContextSupported
public boolean isContextSupported(boolean strict, String workContextClassName)
indicates whether the provided workContextClass is supported by the container- Specified by:
isContextSupported
in interfaceWorkContextHandler
- Parameters:
strict
- indicates whether the type-check need to be strict or not i.e., exact type or its super-class typeworkContextClassName
- work context class name- Returns:
- boolean indicating whether the workContextClass is supported or not
-
canContainerHandleContext
public boolean canContainerHandleContext(String contextClassName)
checks whether the container can handle the contextClass in question. If the exact class type is not supported, container will look for any of its super-class If any of the super-class is available, it is indicated as 'can handle'- Parameters:
contextClassName
- work context class name- Returns:
- boolean indicating whether the contextClass is supported or not
-
validateWork
public void validateWork(jakarta.resource.spi.work.Work work, jakarta.resource.spi.work.ExecutionContext ec) throws jakarta.resource.spi.work.WorkCompletedException, jakarta.resource.spi.work.WorkRejectedException
validate the submitted work- Parameters:
work
- work instance to be validatedec
- ExecutionContext- Throws:
jakarta.resource.spi.work.WorkCompletedException
- when a submitted context is not supportedjakarta.resource.spi.work.WorkRejectedException
- when validation fails
-
setupContext
public void setupContext(jakarta.resource.spi.work.ExecutionContext ec, WorkCoordinator wc, OneWork work) throws jakarta.resource.spi.work.WorkCompletedException
setup the work context or execution context for the work- Parameters:
ec
- ExecutionContextwc
- Work coordinator- Throws:
jakarta.resource.spi.work.WorkCompletedException
-
debug
public static void debug(String message)
-
getExecutionContext
public static jakarta.resource.spi.work.ExecutionContext getExecutionContext(jakarta.resource.spi.work.Work work)
-
isContextSupported
public boolean isContextSupported(Class contextClass)
-
-