use of org.jboss.modcluster.ModClusterServiceMBean in project wildfly by wildfly.
the class LegacyProxyHandler method executeRuntimeStep.
@Override
protected void executeRuntimeStep(OperationContext context, ModelNode op) throws OperationFailedException {
String name = Operations.getName(op);
LegacyProxyOperation operation = this.operations.get(name);
PathAddress proxyAddress = LegacyMetricOperationsRegistration.translateProxyPath(context, context.getCurrentAddress());
ServiceName serviceName = ProxyConfigurationResourceDefinition.Capability.SERVICE.getServiceName(proxyAddress);
FunctionExecutor<ModClusterServiceMBean> executor = this.executors.get(serviceName);
if (executor != null) {
executor.execute(new ExceptionFunction<ModClusterServiceMBean, Void, OperationFailedException>() {
@Override
public Void apply(ModClusterServiceMBean service) throws OperationFailedException {
operation.execute(context, op, service);
return null;
}
});
} else {
context.completeStep(OperationContext.ResultHandler.NOOP_RESULT_HANDLER);
}
}
use of org.jboss.modcluster.ModClusterServiceMBean in project wildfly by wildfly.
the class ProxyOperationExecutor method execute.
@Override
public ModelNode execute(OperationContext context, ModelNode operation, Operation<ModClusterServiceMBean> executable) throws OperationFailedException {
ServiceName serviceName = ProxyConfigurationResourceDefinition.Capability.SERVICE.getDefinition().getCapabilityServiceName(context.getCurrentAddress());
FunctionExecutor<ModClusterServiceMBean> executor = this.executors.get(serviceName);
return (executor != null) ? executor.execute(new OperationFunction<>(context, operation, Function.identity(), executable)) : null;
}
use of org.jboss.modcluster.ModClusterServiceMBean in project wildfly by wildfly.
the class ModClusterSubsystemResourceDefinition method register.
@SuppressWarnings("deprecation")
@Override
public void register(SubsystemRegistration parent) {
ManagementResourceRegistration registration = parent.registerSubsystemModel(this);
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver());
ServiceValueExecutorRegistry<ModClusterServiceMBean> registry = new ServiceValueExecutorRegistry<>();
ResourceServiceHandler handler = new ModClusterSubsystemServiceHandler(registry);
new SimpleResourceRegistration(descriptor, handler).register(registration);
new ProxyConfigurationResourceDefinition(registry).register(registration);
// Deprecated legacy operations which are exposed at the wrong location
if (parent.isRuntimeOnlyRegistrationValid()) {
new LegacyProxyHandler(registry).register(registration);
}
}
Aggregations