public class LoggingProfileDeploymentProcessor extends Object implements DeploymentUnitProcessor
Modifier and Type | Field and Description |
---|---|
static AttachmentKey<org.jboss.logmanager.LogContext> |
LOG_CONTEXT_KEY |
protected WildFlyLogContextSelector |
logContextSelector |
Constructor and Description |
---|
LoggingProfileDeploymentProcessor(WildFlyLogContextSelector logContextSelector) |
Modifier and Type | Method and Description |
---|---|
void |
deploy(DeploymentPhaseContext phaseContext)
Perform a single step in processing the deployment phase.
|
protected static List<DeploymentUnit> |
getSubDeployments(DeploymentUnit deploymentUnit) |
static boolean |
hasRegisteredLogContext(DeploymentUnit deploymentUnit)
Checks the deployment to see if it has a registered
log context . |
protected void |
processDeployment(DeploymentPhaseContext phaseContext,
DeploymentUnit deploymentUnit,
ResourceRoot root)
Processes the deployment.
|
protected void |
registerLogContext(DeploymentUnit deploymentUnit,
org.jboss.modules.Module module,
org.jboss.logmanager.LogContext logContext) |
protected static void |
safeClose(Closeable closable) |
void |
undeploy(DeploymentUnit context)
Undo the deployment processing.
|
protected void |
unregisterLogContext(DeploymentUnit deploymentUnit,
org.jboss.modules.Module module) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deploy, undeploy
public static final AttachmentKey<org.jboss.logmanager.LogContext> LOG_CONTEXT_KEY
protected final WildFlyLogContextSelector logContextSelector
public LoggingProfileDeploymentProcessor(WildFlyLogContextSelector logContextSelector)
protected void processDeployment(DeploymentPhaseContext phaseContext, DeploymentUnit deploymentUnit, ResourceRoot root) throws DeploymentUnitProcessingException
phaseContext
- the phase contextdeploymentUnit
- the deployment unitroot
- the root resourceDeploymentUnitProcessingException
- if an error occurs during processingpublic final void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException
DeploymentUnitProcessor
Data stored on the phase context only exists until the end of the phase. The deployment unit context
which is persistent is available via context.getDeploymentUnitContext()
.
deploy
in interface DeploymentUnitProcessor
phaseContext
- the deployment unit contextDeploymentUnitProcessingException
- if an error occurs during processingpublic final void undeploy(DeploymentUnit context)
DeploymentUnitProcessor
deploy()
; however, if
the deploy()
method added services, they need not be removed here (they will automatically be removed).
This method should avoid throwing exceptions; any exceptions thrown are logged and ignored. Implementations of this
method cannot assume that the deployment process has (or has not) proceeded beyond the current processor, nor can they
assume that the undeploy()
method will be called from the same thread as the deploy()
method.
undeploy
in interface DeploymentUnitProcessor
context
- the deployment unit contextprotected void registerLogContext(DeploymentUnit deploymentUnit, org.jboss.modules.Module module, org.jboss.logmanager.LogContext logContext)
protected void unregisterLogContext(DeploymentUnit deploymentUnit, org.jboss.modules.Module module)
protected static List<DeploymentUnit> getSubDeployments(DeploymentUnit deploymentUnit)
protected static void safeClose(Closeable closable)
public static boolean hasRegisteredLogContext(DeploymentUnit deploymentUnit)
log context
.deploymentUnit
- the deployment unit to checktrue
if the deployment unit has a log context, otherwise false
Copyright © 2023 JBoss by Red Hat. All rights reserved.