Package fish.payara.appserver.context
Class JavaEEContextUtilImpl
- java.lang.Object
-
- fish.payara.appserver.context.JavaEEContextUtilImpl
-
- All Implemented Interfaces:
Serializable
,ContextProducer
,JavaEEContextUtil
@Service public class JavaEEContextUtilImpl extends Object implements JavaEEContextUtil, Serializable
utility to create / push Java EE thread context- Author:
- lprimak
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
JavaEEContextUtilImpl.InstanceImpl
-
Nested classes/interfaces inherited from interface org.glassfish.internal.api.ContextProducer
ContextProducer.Closeable
-
Nested classes/interfaces inherited from interface org.glassfish.internal.api.JavaEEContextUtil
JavaEEContextUtil.Context, JavaEEContextUtil.Instance
-
-
Constructor Summary
Constructors Constructor Description JavaEEContextUtilImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JavaEEContextUtil.Instance
currentInvocation()
captures current invocation and returns it as an instanceJavaEEContextUtil.Instance
empty()
Creates an empty instance, i.e.JavaEEContextUtil.Instance
fromComponentId(String componentId)
ClassLoader
getInvocationClassLoader()
String
getInvocationComponentId()
boolean
isInvocationLoaded()
This is different from class loaded, as there are some situations where class is loaded but initialization is not complete, such as CDI initializations, extensions start, etc.boolean
moduleMatches(ModuleInfo moduleInfo, String modulNameToMatch)
Checks if the supplied module matches the component / application ID Works for both EAR application IDs or other module (WAR, JAR) IDs
-
-
-
Method Detail
-
empty
public JavaEEContextUtil.Instance empty()
Description copied from interface:ContextProducer
Creates an empty instance, i.e. if the empty context is pushed on top of another context, the other context will be 'suppressed' for the duration of this context- Specified by:
empty
in interfaceContextProducer
- Specified by:
empty
in interfaceJavaEEContextUtil
- Returns:
- new empty instance
-
currentInvocation
public JavaEEContextUtil.Instance currentInvocation()
Description copied from interface:ContextProducer
captures current invocation and returns it as an instance- Specified by:
currentInvocation
in interfaceContextProducer
- Specified by:
currentInvocation
in interfaceJavaEEContextUtil
- Returns:
- new captured instance
-
fromComponentId
public JavaEEContextUtil.Instance fromComponentId(String componentId) throws IllegalArgumentException
- Specified by:
fromComponentId
in interfaceJavaEEContextUtil
- Parameters:
componentId
- component id for this instance, non-null- Returns:
- new instance based on componentId
- Throws:
IllegalArgumentException
-
getInvocationClassLoader
public ClassLoader getInvocationClassLoader()
- Specified by:
getInvocationClassLoader
in interfaceContextProducer
- Returns:
- Class Loader that's associated with current invocation or null if there is no current invocation
-
getInvocationComponentId
public String getInvocationComponentId()
- Specified by:
getInvocationComponentId
in interfaceContextProducer
- Returns:
- component ID for the current invocation or null
-
isInvocationLoaded
public boolean isInvocationLoaded()
Description copied from interface:ContextProducer
This is different from class loaded, as there are some situations where class is loaded but initialization is not complete, such as CDI initializations, extensions start, etc.- Specified by:
isInvocationLoaded
in interfaceContextProducer
- Returns:
- true if current invocation exists and is loaded / ready
-
moduleMatches
public boolean moduleMatches(ModuleInfo moduleInfo, String modulNameToMatch)
Description copied from interface:ContextProducer
Checks if the supplied module matches the component / application ID Works for both EAR application IDs or other module (WAR, JAR) IDs- Specified by:
moduleMatches
in interfaceContextProducer
- Returns:
- true if matches
-
-