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 classJavaEEContextUtilImpl.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.InstancecurrentInvocation()captures current invocation and returns it as an instanceJavaEEContextUtil.Instanceempty()Creates an empty instance, i.e.JavaEEContextUtil.InstancefromComponentId(String componentId)ClassLoadergetInvocationClassLoader()StringgetInvocationComponentId()booleanisInvocationLoaded()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.booleanmoduleMatches(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:ContextProducerCreates 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:
emptyin interfaceContextProducer- Specified by:
emptyin interfaceJavaEEContextUtil- Returns:
- new empty instance
-
currentInvocation
public JavaEEContextUtil.Instance currentInvocation()
Description copied from interface:ContextProducercaptures current invocation and returns it as an instance- Specified by:
currentInvocationin interfaceContextProducer- Specified by:
currentInvocationin interfaceJavaEEContextUtil- Returns:
- new captured instance
-
fromComponentId
public JavaEEContextUtil.Instance fromComponentId(String componentId) throws IllegalArgumentException
- Specified by:
fromComponentIdin interfaceJavaEEContextUtil- Parameters:
componentId- component id for this instance, non-null- Returns:
- new instance based on componentId
- Throws:
IllegalArgumentException
-
getInvocationClassLoader
public ClassLoader getInvocationClassLoader()
- Specified by:
getInvocationClassLoaderin interfaceContextProducer- Returns:
- Class Loader that's associated with current invocation or null if there is no current invocation
-
getInvocationComponentId
public String getInvocationComponentId()
- Specified by:
getInvocationComponentIdin interfaceContextProducer- Returns:
- component ID for the current invocation or null
-
isInvocationLoaded
public boolean isInvocationLoaded()
Description copied from interface:ContextProducerThis 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:
isInvocationLoadedin interfaceContextProducer- Returns:
- true if current invocation exists and is loaded / ready
-
moduleMatches
public boolean moduleMatches(ModuleInfo moduleInfo, String modulNameToMatch)
Description copied from interface:ContextProducerChecks if the supplied module matches the component / application ID Works for both EAR application IDs or other module (WAR, JAR) IDs- Specified by:
moduleMatchesin interfaceContextProducer- Returns:
- true if matches
-
-