Search in sources :

Example 6 with SimpleOperationDefinitionBuilder

use of org.jboss.as.controller.SimpleOperationDefinitionBuilder in project wildfly by wildfly.

the class AbstractActiveMQComponentControlHandler method registerOperations.

public void registerOperations(final ManagementResourceRegistration registry, final ResourceDescriptionResolver resolver) {
    final OperationDefinition startOp = new SimpleOperationDefinitionBuilder(START, resolver).build();
    registry.registerOperationHandler(startOp, this);
    final OperationDefinition stopOp = new SimpleOperationDefinitionBuilder(STOP, resolver).build();
    registry.registerOperationHandler(stopOp, this);
}
Also used : SimpleOperationDefinitionBuilder(org.jboss.as.controller.SimpleOperationDefinitionBuilder) OperationDefinition(org.jboss.as.controller.OperationDefinition)

Example 7 with SimpleOperationDefinitionBuilder

use of org.jboss.as.controller.SimpleOperationDefinitionBuilder in project wildfly by wildfly.

the class WebMigrateOperation method registerOperations.

static void registerOperations(ManagementResourceRegistration registry, ResourceDescriptionResolver resourceDescriptionResolver) {
    registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(MIGRATE, resourceDescriptionResolver).setRuntimeOnly().setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG).setReplyParameters(MIGRATION_WARNINGS_ATTR, MIGRATION_ERROR_ATTR).build(), WebMigrateOperation.MIGRATE_INSTANCE);
    registry.registerOperationHandler(new SimpleOperationDefinitionBuilder(DESCRIBE_MIGRATION, resourceDescriptionResolver).setRuntimeOnly().setAccessConstraints(SensitiveTargetAccessConstraintDefinition.READ_WHOLE_CONFIG).setReplyParameters(MIGRATION_WARNINGS_ATTR).build(), WebMigrateOperation.DESCRIBE_MIGRATION_INSTANCE);
}
Also used : SimpleOperationDefinitionBuilder(org.jboss.as.controller.SimpleOperationDefinitionBuilder)

Example 8 with SimpleOperationDefinitionBuilder

use of org.jboss.as.controller.SimpleOperationDefinitionBuilder in project wildfly by wildfly.

the class AddressSettingsResolveHandler method registerOperationHandler.

public static void registerOperationHandler(ManagementResourceRegistration registry, ResourceDescriptionResolver resolver) {
    SimpleOperationDefinition op = new SimpleOperationDefinitionBuilder(RESOLVE_ADDRESS_SETTING, resolver).withFlags(EnumSet.of(OperationEntry.Flag.READ_ONLY, OperationEntry.Flag.RUNTIME_ONLY)).addParameter(ACTIVEMQ_ADDRESS).setReplyType(ModelType.LIST).setReplyParameters(AddressSettingDefinition.ATTRIBUTES).build();
    registry.registerOperationHandler(op, AddressSettingsResolveHandler.INSTANCE);
}
Also used : SimpleOperationDefinitionBuilder(org.jboss.as.controller.SimpleOperationDefinitionBuilder) SimpleOperationDefinition(org.jboss.as.controller.SimpleOperationDefinition)

Example 9 with SimpleOperationDefinitionBuilder

use of org.jboss.as.controller.SimpleOperationDefinitionBuilder in project wildfly by wildfly.

the class ClusterConnectionDefinition method registerOperations.

@Override
public void registerOperations(ManagementResourceRegistration registry) {
    super.registerOperations(registry);
    ClusterConnectionControlHandler.INSTANCE.registerOperations(registry, getResourceDescriptionResolver());
    final EnumSet<OperationEntry.Flag> flags = EnumSet.of(OperationEntry.Flag.READ_ONLY, OperationEntry.Flag.RUNTIME_ONLY);
    SimpleOperationDefinition getNodesDef = new SimpleOperationDefinitionBuilder(ClusterConnectionDefinition.GET_NODES, getResourceDescriptionResolver()).withFlags(flags).setReplyType(OBJECT).setReplyValueType(STRING).build();
    registry.registerOperationHandler(getNodesDef, ClusterConnectionControlHandler.INSTANCE);
}
Also used : SimpleOperationDefinitionBuilder(org.jboss.as.controller.SimpleOperationDefinitionBuilder) SimpleOperationDefinition(org.jboss.as.controller.SimpleOperationDefinition)

Example 10 with SimpleOperationDefinitionBuilder

use of org.jboss.as.controller.SimpleOperationDefinitionBuilder in project wildfly by wildfly.

the class BroadcastGroupDefinition method registerOperations.

@Override
public void registerOperations(ManagementResourceRegistration registry) {
    super.registerOperations(registry);
    BroadcastGroupControlHandler.INSTANCE.registerOperations(registry, getResourceDescriptionResolver());
    SimpleOperationDefinition op = new SimpleOperationDefinitionBuilder(GET_CONNECTOR_PAIRS_AS_JSON, getResourceDescriptionResolver()).withFlags(EnumSet.of(OperationEntry.Flag.READ_ONLY, OperationEntry.Flag.RUNTIME_ONLY)).setReplyType(STRING).build();
    registry.registerOperationHandler(op, BroadcastGroupControlHandler.INSTANCE);
}
Also used : SimpleOperationDefinitionBuilder(org.jboss.as.controller.SimpleOperationDefinitionBuilder) SimpleOperationDefinition(org.jboss.as.controller.SimpleOperationDefinition)

Aggregations

SimpleOperationDefinitionBuilder (org.jboss.as.controller.SimpleOperationDefinitionBuilder)13 OperationDefinition (org.jboss.as.controller.OperationDefinition)6 SimpleOperationDefinition (org.jboss.as.controller.SimpleOperationDefinition)4 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)3 OperationContext (org.jboss.as.controller.OperationContext)2 OperationFailedException (org.jboss.as.controller.OperationFailedException)2 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)2 PathElement (org.jboss.as.controller.PathElement)2 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2 Resource (org.jboss.as.controller.registry.Resource)2 ModelNode (org.jboss.dmr.ModelNode)2 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)1 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)1 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)1 ObjectListAttributeDefinition (org.jboss.as.controller.ObjectListAttributeDefinition)1 ObjectTypeAttributeDefinition (org.jboss.as.controller.ObjectTypeAttributeDefinition)1 PathAddress (org.jboss.as.controller.PathAddress)1 PropertiesAttributeDefinition (org.jboss.as.controller.PropertiesAttributeDefinition)1 ReloadRequiredAddStepHandler (org.jboss.as.controller.ReloadRequiredAddStepHandler)1