use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.
the class SingletonResourceDefinition method register.
@Override
public void register(SubsystemRegistration parentRegistration) {
ManagementResourceRegistration registration = parentRegistration.registerSubsystemModel(this);
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(Capability.class);
ResourceServiceHandler handler = new SingletonServiceHandler();
new DeploymentChainContributingResourceRegistration(descriptor, handler, this).register(registration);
new SingletonPolicyResourceDefinition().register(registration);
}
use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.
the class StringKeyedJDBCStoreResourceDefinition method register.
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
ManagementResourceRegistration registration = super.register(parent);
parent.registerAlias(STRING_JDBC_PATH, new SimpleAliasEntry(registration));
registration.registerReadWriteAttribute(DeprecatedAttribute.TABLE.getDefinition(), LEGACY_READ_TABLE_HANDLER, LEGACY_WRITE_TABLE_HANDLER);
new StringTableResourceDefinition().register(registration);
return registration;
}
use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.
the class OffHeapMemoryResourceDefinition method register.
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
ManagementResourceRegistration registration = super.register(parent);
parent.registerAlias(BINARY_PATH, new SimpleAliasEntry(registration));
return registration;
}
use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.
the class StorePropertyResourceDefinition method register.
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
ManagementResourceRegistration registration = parent.registerSubModel(this);
AbstractAddStepHandler addHandler = new AbstractAddStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) {
operationDeprecated(context, operation);
context.createResource(PathAddress.EMPTY_ADDRESS);
String name = context.getCurrentAddressValue();
String value = operation.get(VALUE.getName()).asString();
PathAddress storeAddress = context.getCurrentAddress().getParent();
ModelNode putOperation = Operations.createMapPutOperation(storeAddress, StoreResourceDefinition.Attribute.PROPERTIES, name, value);
context.addStep(putOperation, MapOperations.MAP_PUT_HANDLER, context.getCurrentStage());
}
};
this.registerAddOperation(registration, addHandler);
AbstractRemoveStepHandler removeHandler = new AbstractRemoveStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) {
operationDeprecated(context, operation);
context.removeResource(PathAddress.EMPTY_ADDRESS);
String name = context.getCurrentAddressValue();
PathAddress storeAddress = context.getCurrentAddress().getParent();
ModelNode putOperation = Operations.createMapRemoveOperation(storeAddress, StoreResourceDefinition.Attribute.PROPERTIES, name);
context.addStep(putOperation, MapOperations.MAP_REMOVE_HANDLER, context.getCurrentStage());
}
};
this.registerRemoveOperation(registration, removeHandler);
OperationStepHandler readHandler = new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) {
operationDeprecated(context, operation);
PathAddress storeAddress = context.getCurrentAddress().getParent();
String key = context.getCurrentAddressValue();
ModelNode getOperation = Operations.createMapGetOperation(storeAddress, StoreResourceDefinition.Attribute.PROPERTIES, key);
context.addStep(getOperation, MapOperations.MAP_GET_HANDLER, context.getCurrentStage());
}
};
OperationStepHandler writeHandler = new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) {
operationDeprecated(context, operation);
PathAddress storeAddress = context.getCurrentAddress().getParent();
String key = context.getCurrentAddressValue();
String value = Operations.getAttributeValue(operation).asString();
ModelNode putOperation = Operations.createMapPutOperation(storeAddress, StoreResourceDefinition.Attribute.PROPERTIES, key, value);
context.addStep(putOperation, MapOperations.MAP_PUT_HANDLER, context.getCurrentStage());
}
};
registration.registerReadWriteAttribute(VALUE, readHandler, writeHandler);
return registration;
}
use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.
the class ChannelResourceDefinition method register.
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
ManagementResourceRegistration registration = parent.registerSubModel(this);
ServiceValueExecutorRegistry<JChannel> executors = new ServiceValueExecutorRegistry<>();
ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(Capability.class).addCapabilities(CLUSTERING_CAPABILITIES.values()).addAlias(DeprecatedAttribute.STATS_ENABLED, Attribute.STATISTICS_ENABLED).setAddOperationTransformation(new AddOperationTransformation()).addRuntimeResourceRegistration(new ChannelRuntimeResourceRegistration(executors));
ResourceServiceHandler handler = new ChannelServiceHandler(executors);
new SimpleResourceRegistration(descriptor, handler).register(registration);
if (registration.isRuntimeOnlyRegistrationValid()) {
new MetricHandler<>(new ChannelMetricExecutor(executors), ChannelMetric.class).register(registration);
}
new ForkResourceDefinition(executors).register(registration);
return registration;
}
Aggregations