Class PathInfoHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractRuntimeOnlyHandler
-
- org.jboss.as.controller.services.path.PathInfoHandler
-
- All Implemented Interfaces:
OperationStepHandler
public class PathInfoHandler extends AbstractRuntimeOnlyHandler
Handler for file usage metric which contains the total size of a folder and the usable space (as in Java nio).- Author:
- Emmanuel Hugonnet (c) 2015 Red Hat, inc.
- See Also:
FileStore.getUsableSpace()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathInfoHandler.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
executeRuntimeStep(OperationContext context, org.jboss.dmr.ModelNode operation)
Compute the file usage metric which contains the total size of a folder and the usable space (as in Java nio).static void
registerOperation(ManagementResourceRegistration resourceRegistration, PathInfoHandler handler)
protected boolean
requiresRuntime(OperationContext context)
Gets whether theOperationContext.Stage.RUNTIME
step should be added to callAbstractRuntimeOnlyHandler.executeRuntimeStep(OperationContext, ModelNode)
.-
Methods inherited from class org.jboss.as.controller.AbstractRuntimeOnlyHandler
execute, resourceMustExist
-
-
-
-
Method Detail
-
requiresRuntime
protected boolean requiresRuntime(OperationContext context)
Description copied from class:AbstractRuntimeOnlyHandler
Gets whether theOperationContext.Stage.RUNTIME
step should be added to callAbstractRuntimeOnlyHandler.executeRuntimeStep(OperationContext, ModelNode)
. This default implementation will returntrue
for a normal server running in normal (non admin-only) mode. If running on a host controller, it will returntrue
if it is the active copy of the host controller subsystem. Subclasses that perform no runtime update could override and returnfalse
. This method is invoked duringOperationContext.Stage.MODEL
.- Overrides:
requiresRuntime
in classAbstractRuntimeOnlyHandler
- Parameters:
context
- operation context- Returns:
true
if a step to invokeexecuteRuntimeStep
should be added;false
otherwise.- See Also:
OperationContext.isDefaultRequiresRuntime()
-
executeRuntimeStep
protected void executeRuntimeStep(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
Compute the file usage metric which contains the total size of a folder and the usable space (as in Java nio).- Specified by:
executeRuntimeStep
in classAbstractRuntimeOnlyHandler
- Parameters:
context
- the operation contextoperation
- the operation being executed- Throws:
OperationFailedException
- See Also:
FileStore.getUsableSpace()
-
registerOperation
public static void registerOperation(ManagementResourceRegistration resourceRegistration, PathInfoHandler handler)
-
-