本文整理汇总了Java中org.jboss.as.controller.registry.ManagementResourceRegistration类的典型用法代码示例。如果您正苦于以下问题:Java ManagementResourceRegistration类的具体用法?Java ManagementResourceRegistration怎么用?Java ManagementResourceRegistration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagementResourceRegistration类属于org.jboss.as.controller.registry包,在下文中一共展示了ManagementResourceRegistration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem =
context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(MAJOR_VERSION, MINOR_VERSION));
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SubsystemDefinition.INSTANCE);
final OperationDefinition describeOp = new SimpleOperationDefinitionBuilder(DESCRIBE,
getResourceDescriptionResolver(null))
.setEntryType(OperationEntry.EntryType.PRIVATE)
.build();
registration.registerOperationHandler(describeOp, GenericSubsystemDescribeHandler.INSTANCE, false);
subsystem.registerXMLElementWriter(SmppSubsystemParser.getInstance());
// here we can register submodels
final ManagementResourceRegistration mbeans = registration.registerSubModel(SmppMbeanDefinition.INSTANCE);
}
示例2: registerOperations
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
public void registerOperations(ManagementResourceRegistration rr) {
super.registerOperations(rr);
// We always need to add a 'describe' operation
rr.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION,
GenericSubsystemDescribeHandler.INSTANCE);
rr.registerOperationHandler(
new SimpleOperationDefinitionBuilder(NestSubsystemExtension.NEST_START_OP, NestSubsystemExtension
.getResourceDescriptionResolver(null))
.addParameter(START_OP_PARAM_RESTART).build(), NestSubsystemStart.INSTANCE);
rr.registerOperationHandler(
new SimpleOperationDefinitionBuilder(NestSubsystemExtension.NEST_STOP_OP, NestSubsystemExtension
.getResourceDescriptionResolver(null))
.build(), NestSubsystemStop.INSTANCE);
rr.registerOperationHandler(
new SimpleOperationDefinitionBuilder(NestSubsystemExtension.NEST_STATUS_OP, NestSubsystemExtension
.getResourceDescriptionResolver(null))
.build(), NestSubsystemStatus.INSTANCE);
return;
}
示例3: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
ManagementResourceRegistration registration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(registration, ProcessType.EMBEDDED_SERVER);
GlobalNotifications.registerGlobalNotifications(registration, ProcessType.EMBEDDED_SERVER);
registration.registerSubModel(new TestResourceDefinition(UNCONSTRAINED_RESOURCE));
registration.registerSubModel(new TestResourceDefinition(SENSITIVE_CONSTRAINED_RESOURCE,
MY_SENSITIVE_CONSTRAINT));
registration.registerSubModel(new TestResourceDefinition(APPLICATION_CONSTRAINED_RESOURCE,
MY_APPLICATION_CONSTRAINT));
ManagementResourceRegistration mgmt = registration.registerSubModel(new TestResourceDefinition(CORE_MANAGEMENT));
mgmt.registerSubModel(new TestResourceDefinition(ACCESS_AUDIT));
}
示例4: setup
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Before
public void setup() {
root = ManagementResourceRegistration.Factory.forProcessType(ProcessType.EMBEDDED_SERVER).createRegistration(rootResource);
assertNotNull(root);
profileAReg = registerSubModel(root, profileA);
assertNotNull(profileAReg);
profileBReg = registerSubModel(root, profileB);
assertNotNull(profileBReg);
root.registerProxyController(proxyA, new TestProxyController(proxyA));
root.registerProxyController(proxyB, new TestProxyController(proxyB));
profileBReg.registerProxyController(proxyA, new TestProxyController(profileB, proxyA));
profileBReg.registerProxyController(proxyB, new TestProxyController(profileB, proxyB));
}
示例5: SubsystemRegistrationImpl
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
private SubsystemRegistrationImpl(String name, ModelVersion version,
ManagementResourceRegistration profileRegistration,
ManagementResourceRegistration deploymentsRegistration,
ExtensionRegistryType extensionRegistryType,
String extensionModuleName,
ProcessType processType) {
assert profileRegistration != null;
this.name = name;
this.profileRegistration = profileRegistration;
if (deploymentsRegistration == null){
this.deploymentsRegistration = ManagementResourceRegistration.Factory.forProcessType(processType).createRegistration(new SimpleResourceDefinition(null, NonResolvingResourceDescriptionResolver.INSTANCE));
}else {
this.deploymentsRegistration = deploymentsRegistration;
}
this.version = version;
this.extensionRegistryType = extensionRegistryType;
this.extensionModuleName = extensionModuleName;
}
示例6: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel, Resource modelControllerResource) {
ManagementResourceRegistration rootRegistration = managementModel.getRootResourceRegistration();
rootRegistration.registerOperationHandler(getOD("setup"), new SetupHandler());
rootRegistration.registerOperationHandler(getOD("composite"), CompositeOperationHandler.INSTANCE);
rootRegistration.registerOperationHandler(getOD("good"), new ModelStageGoodHandler());
rootRegistration.registerOperationHandler(getOD("block-model"), new ModelStageBlocksHandler());
rootRegistration.registerOperationHandler(getOD("block-runtime"), new RuntimeStageBlocksHandler(getSharedState()));
rootRegistration.registerOperationHandler(getOD("good-service"), new GoodServiceHandler());
rootRegistration.registerOperationHandler(getOD("block-verify"), new BlockingServiceHandler());
GlobalOperationHandlers.registerGlobalOperations(rootRegistration, processType);
GlobalNotifications.registerGlobalNotifications(rootRegistration, processType);
rootRegistration.registerSubModel(new SimpleResourceDefinition(PathElement.pathElement("child"), new NonResolvingResourceDescriptionResolver()));
this.managementControllerResource = modelControllerResource;
}
示例7: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
ManagementResourceRegistration registration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(registration, ProcessType.EMBEDDED_SERVER);
GlobalNotifications.registerGlobalNotifications(registration, ProcessType.EMBEDDED_SERVER);
registration.registerSubModel(new SimpleResourceDefinition(
new Parameters(pathElement(UNCONSTRAINED_RESOURCE), new NonResolvingResourceDescriptionResolver())
.setAddHandler(new AbstractAddStepHandler() {})
.setRemoveHandler(new AbstractRemoveStepHandler() {})));
registration.registerSubModel(new SimpleResourceDefinition(
new Parameters(pathElement(SENSITIVE_CONSTRAINED_RESOURCE), new NonResolvingResourceDescriptionResolver())
.setAddHandler(new AbstractAddStepHandler() {})
.setRemoveHandler(new AbstractRemoveStepHandler() {})
.setAccessConstraints(MY_SENSITIVE_CONSTRAINT)));
}
示例8: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
protected void initModel(ManagementModel managementModel, Resource modelControllerResource) {
ManagementResourceRegistration rootRegistration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(rootRegistration, processType);
GlobalNotifications.registerGlobalNotifications(rootRegistration, processType);
rootRegistration.registerOperationHandler(ValidateOperationHandler.DEFINITION, ValidateOperationHandler.INSTANCE);
rootRegistration.registerOperationHandler(TestUtils.SETUP_OPERATION_DEF, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
ModelNode mainModel = new ModelNode();
mainModel.get(SERVER, "serverA"); //Create an empty node to be got from the proxied model
mainModel.get("profile", "profileA").get(NAME).set("Profile A");
AbstractControllerTestBase.createModel(context, mainModel);
}
});
rootRegistration.registerSubModel(ResourceBuilder.Factory.create(PathElement.pathElement("profile", "*"), new NonResolvingResourceDescriptionResolver())
.addReadOnlyAttribute(TestUtils.createNillableAttribute("name",ModelType.STRING))
.build());
PathElement serverAElement = PathElement.pathElement(SERVER, "serverA");
rootRegistration.registerProxyController(serverAElement, createProxyController(proxy.getValue(), PathAddress.pathAddress(serverAElement)));
}
示例9: testToPathAddress
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Test
public void testToPathAddress() {
NonResolvingResourceDescriptionResolver resolver = new NonResolvingResourceDescriptionResolver();
ManagementResourceRegistration rootRegistration = ManagementResourceRegistration.Factory.forProcessType(ProcessType.EMBEDDED_SERVER).createRegistration(rootResourceDef);
ManagementResourceRegistration subsystemRegistration = rootRegistration.registerSubModel(new SimpleResourceDefinition(pathElement("subsystem", "foo"), resolver));
ManagementResourceRegistration resourceRegistration = subsystemRegistration.registerSubModel(new SimpleResourceDefinition(pathElement("resource", "resourceA"), resolver));
ManagementResourceRegistration subresourceRegistration = resourceRegistration.registerSubModel(new SimpleResourceDefinition(pathElement("subresource", "resourceB"), resolver));
PathAddress pathAddress = PathAddress.pathAddress("subsystem", "foo")
.append("resource", "resourceA")
.append("subresource", "resourceB");
ObjectName on = ObjectNameAddressUtil.createObjectName("jboss.as", pathAddress);
PathAddress convertedAddress = ObjectNameAddressUtil.toPathAddress("jboss.as", rootRegistration, on);
Assert.assertNotNull(convertedAddress);
Assert.assertEquals(pathAddress, convertedAddress);
}
示例10: initialize
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void initialize(ExtensionContext context) {
ROOT_LOGGER.debug("Initializing Deployment Scanner Extension");
if (context.getProcessType().isHostController()) {
throw DeploymentScannerLogger.ROOT_LOGGER.deploymentScannerNotForDomainMode();
}
final SubsystemRegistration subsystem = context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER, CURRENT_VERSION);
subsystem.registerXMLElementWriter(DeploymentScannerParser_2_0::new);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new DeploymentScannerSubsystemDefinition());
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
final ManagementResourceRegistration scanner = registration.registerSubModel(new DeploymentScannerDefinition(context.getPathManager()));
if (context.getProcessType().isServer()) {
final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager())
.setRelativeToAttribute(DeploymentScannerDefinition.RELATIVE_TO)
.setPathAttribute(DeploymentScannerDefinition.PATH)
.build();
scanner.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler);
}
}
示例11: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
ManagementResourceRegistration registration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(registration, processType);
registration.registerOperationHandler(new SimpleOperationDefinitionBuilder("setup", new NonResolvingResourceDescriptionResolver())
.setPrivateEntry()
.build()
, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
createModel(context, model);
}
});
GlobalNotifications.registerGlobalNotifications(registration, processType);
ManagementResourceRegistration child = registration.registerSubModel(new SimpleResourceDefinition(PathElement.pathElement("test"), new NonResolvingResourceDescriptionResolver()));
child.registerReadOnlyAttribute(TestUtils.createNillableAttribute("prop", ModelType.STRING), null);
managementModel.getRootResource().getModel().set(model);
}
示例12: initModel
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
ManagementResourceRegistration registration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(registration, ProcessType.EMBEDDED_SERVER);
GlobalNotifications.registerGlobalNotifications(registration, ProcessType.EMBEDDED_SERVER);
registration.registerSubModel(new SimpleResourceDefinition(
new Parameters(pathElement(UNCONSTRAINED_RESOURCE), new NonResolvingResourceDescriptionResolver())
.setAddHandler(new AbstractAddStepHandler() {})
.setRemoveHandler(new AbstractRemoveStepHandler() {})));
registration.registerSubModel(new SimpleResourceDefinition(
new Parameters(pathElement(SENSITIVE_CONSTRAINED_RESOURCE), new NonResolvingResourceDescriptionResolver())
.setAddHandler(new AbstractAddStepHandler() {})
.setRemoveHandler(new AbstractRemoveStepHandler() {})
.setAccessConstraints(MY_SENSITIVE_CONSTRAINT)));
}
示例13: initialize
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystem.registerXMLElementWriter(SubsytemParser_1_0.INSTANCE);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new SubsystemDefinition());
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
registration.registerSubModel(new ConfigSourceDefinition());
registration.registerSubModel(new ConfigSourceProviderDefinition());
}
示例14: initialize
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystem.registerXMLElementWriter(SubsytemParser_1_0.INSTANCE);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new SubsystemDefinition());
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
}
示例15: initialize
import org.jboss.as.controller.registry.ManagementResourceRegistration; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(Neo4jDriverDefinition.INSTANCE);
registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
subsystem.registerXMLElementWriter(parser);
}