use of org.jboss.as.controller.SimpleOperationDefinition in project wildfly by wildfly.
the class MessageDrivenBeanResourceDefinition method registerOperations.
@Override
public void registerOperations(ManagementResourceRegistration registry) {
super.registerOperations(registry);
final SimpleOperationDefinition startDelivery = new SimpleOperationDefinitionBuilder(START_DELIVERY, getResourceDescriptionResolver()).setRuntimeOnly().build();
registry.registerOperationHandler(startDelivery, MessageDrivenBeanRuntimeHandler.INSTANCE);
final SimpleOperationDefinition stopDelivery = new SimpleOperationDefinitionBuilder(STOP_DELIVERY, getResourceDescriptionResolver()).setRuntimeOnly().build();
registry.registerOperationHandler(stopDelivery, MessageDrivenBeanRuntimeHandler.INSTANCE);
}
use of org.jboss.as.controller.SimpleOperationDefinition in project wildfly by wildfly.
the class ManagementResourceDefinition method registerOperations.
@Override
public void registerOperations(ManagementResourceRegistration resourceRegistration) {
super.registerOperations(resourceRegistration);
for (final String statisticName : statistics.getNames()) {
final ModelType modelType = getModelType(statistics.getType(statisticName));
if (statistics.isOperation(statisticName)) {
AttributeDefinition attributeDefinition = new SimpleAttributeDefinitionBuilder(statisticName, modelType, true).setXmlName(statisticName).setAllowExpression(true).setFlags(AttributeAccess.Flag.STORAGE_RUNTIME).build();
OperationStepHandler operationHandler = new AbstractMetricsHandler() {
@Override
void handle(final ModelNode response, OperationContext context, final ModelNode operation) {
Object result = statistics.getValue(statisticName, entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
if (result != null) {
setResponse(response, result, modelType);
}
}
};
SimpleOperationDefinition definition = new SimpleOperationDefinition(statisticName, descriptionResolver, attributeDefinition);
resourceRegistration.registerOperationHandler(definition, operationHandler);
}
}
}
use of org.jboss.as.controller.SimpleOperationDefinition in project wildfly by wildfly.
the class JGroupsBroadcastGroupDefinition method registerOperations.
@Override
public void registerOperations(ManagementResourceRegistration registry) {
super.registerOperations(registry);
if (registerRuntimeOnly) {
BroadcastGroupControlHandler.INSTANCE.registerOperations(registry, getResourceDescriptionResolver());
SimpleOperationDefinition op = new SimpleOperationDefinitionBuilder(GET_CONNECTOR_PAIRS_AS_JSON, getResourceDescriptionResolver()).setReadOnly().setRuntimeOnly().setReplyType(STRING).build();
registry.registerOperationHandler(op, BroadcastGroupControlHandler.INSTANCE);
}
}
use of org.jboss.as.controller.SimpleOperationDefinition in project wildfly by wildfly.
the class SocketBroadcastGroupDefinition method registerOperations.
@Override
public void registerOperations(ManagementResourceRegistration registry) {
super.registerOperations(registry);
if (registerRuntimeOnly) {
BroadcastGroupControlHandler.INSTANCE.registerOperations(registry, getResourceDescriptionResolver());
SimpleOperationDefinition op = new SimpleOperationDefinitionBuilder(GET_CONNECTOR_PAIRS_AS_JSON, getResourceDescriptionResolver()).setReadOnly().setRuntimeOnly().setReplyType(STRING).build();
registry.registerOperationHandler(op, BroadcastGroupControlHandler.INSTANCE);
}
}
use of org.jboss.as.controller.SimpleOperationDefinition in project wildfly by wildfly.
the class AbstractUpdateJndiHandler method registerOperation.
protected void registerOperation(ManagementResourceRegistration registry, ResourceDescriptionResolver resolver) {
SimpleOperationDefinition operation = new SimpleOperationDefinition(addOperation ? ADD_JNDI : REMOVE_JNDI, resolver, JNDI_BINDING);
registry.registerOperationHandler(operation, this);
}
Aggregations