本文整理汇总了Java中org.jboss.as.controller.ResourceBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ResourceBuilder类的具体用法?Java ResourceBuilder怎么用?Java ResourceBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResourceBuilder类属于org.jboss.as.controller包,在下文中一共展示了ResourceBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerChildren
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
@Override
public void registerChildren(ManagementResourceRegistration profileSub1Reg) {
super.registerChildren(profileSub1Reg);
ResourceDefinition profileSub1RegType1Def = ResourceBuilder.Factory.create(PathElement.pathElement("type1", "*"),
new NonResolvingResourceDescriptionResolver())
.addReadOnlyAttribute(createAttribute("name", ModelType.STRING))
.addReadOnlyAttribute(createAttribute("value", ModelType.INT))
.build();
profileSub1Reg.registerSubModel(profileSub1RegType1Def);
ResourceDefinition profileSub1RegType2Def = ResourceBuilder.Factory.create(PathElement.pathElement("type2", "other"),
new NonResolvingResourceDescriptionResolver())
.addReadOnlyAttribute(createAttribute("name", ModelType.STRING))
.addReadOnlyAttribute(SimpleAttributeDefinitionBuilder.create("default", ModelType.STRING).setRequired(false).setDefaultValue(new ModelNode("Default string")).build())
.build();
profileSub1Reg.registerSubModel(profileSub1RegType2Def);
}
示例2: initModel
import org.jboss.as.controller.ResourceBuilder; //导入依赖的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)));
}
示例3: initialize
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem("test", ModelVersion.create(1));
ResourceBuilder builder = ResourceBuilder.Factory.create(SUBSYSTEM_PATH, new NonResolvingResourceDescriptionResolver())
.setAddOperation(TestSubystemAdd.INSTANCE)
.pushChild(getChildElement())
.setAddOperation(TestChildAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadOnlyAttribute(ATTR)
.pop();
subsystem.registerSubsystemModel(builder.build());
}
示例4: initialize
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
public void initialize(ExtensionContext context) {
// Register the subsystem and operation handlers
SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, BPM_PLATFORM_SUBSYSTEM_MAJOR_VERSION, BPM_PLATFORM_SUBSYSTEM_MINOR_VERSION);
subsystem.registerXMLElementWriter(parser);
// build resource definitions
ResourceBuilder processEnginesResource = ResourceBuilder.Factory.create(PROCESS_ENGINES_PATH, getResourceDescriptionResolver(ModelConstants.PROCESS_ENGINES))
.setAddOperation(ProcessEngineAdd.INSTANCE)
.setRemoveOperation(ProcessEngineRemove.INSTANCE);
ResourceBuilder jobAcquisitionResource = ResourceBuilder.Factory.create(JOB_ACQUISTIONS_PATH, getResourceDescriptionResolver(ModelConstants.JOB_ACQUISITIONS))
.setAddOperation(JobAcquisitionAdd.INSTANCE)
.setRemoveOperation(JobAcquisitionRemove.INSTANCE);
ResourceBuilder jobExecutorResource = ResourceBuilder.Factory.create(JOB_EXECUTOR_PATH, getResourceDescriptionResolver(ModelConstants.JOB_EXECUTOR))
.setAddOperation(JobExecutorAdd.INSTANCE)
.setRemoveOperation(JobExecutorRemove.INSTANCE)
.pushChild(jobAcquisitionResource).pop();
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(SUBSYSTEM_NAME), BpmPlatformSubsystemAdd.INSTANCE, BpmPlatformSubsystemRemove.INSTANCE)
.pushChild(processEnginesResource).pop()
.pushChild(jobExecutorResource).pop()
.build();
subsystem.registerSubsystemModel(subsystemResource);
}
示例5: initialize
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void initialize(final ExtensionContext context) {
// log SwitchYard notification message (includes version information)
LOGGER.info(Versions.getSwitchYardNotification());
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, 1, 0);
subsystem.registerXMLElementWriter(SwitchYardSubsystemWriter.getInstance());
ResourceBuilder securityConfigsResource = ResourceBuilder.Factory.create(SECURITY_CONFIG_PATH, getResourceDescriptionResolver(SECURITY_CONFIG))
.setAddOperation(SwitchYardSecurityConfigAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder modulesResource = ResourceBuilder.Factory.create(MODULE_PATH, getResourceDescriptionResolver(MODULE))
.setAddOperation(SwitchYardModuleAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.IMPLCLASS, null, new ReloadRequiredWriteAttributeHandler(Attributes.IMPLCLASS))
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder extensionsResource = ResourceBuilder.Factory.create(EXTENSION_PATH, getResourceDescriptionResolver(EXTENSION))
.setAddOperation(SwitchYardExtensionAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE);
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), SwitchYardSubsystemAdd.INSTANCE, ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(Attributes.SOCKET_BINDING))
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES))
.addOperation(Operations.GET_VERSION, SwitchYardSubsystemGetVersion.INSTANCE)
.addOperation(Operations.LIST_APPLICATIONS, SwitchYardSubsystemListApplications.INSTANCE)
.addOperation(Operations.LIST_REFERENCES, SwitchYardSubsystemListReferences.INSTANCE)
.addOperation(Operations.LIST_SERVICES, SwitchYardSubsystemListServices.INSTANCE)
.addOperation(Operations.READ_APPLICATION, SwitchYardSubsystemReadApplication.INSTANCE)
.addOperation(Operations.READ_REFERENCE, SwitchYardSubsystemReadReference.INSTANCE)
.addOperation(Operations.READ_SERVICE, SwitchYardSubsystemReadService.INSTANCE)
.addOperation(Operations.USES_ARTIFACT, SwitchYardSubsystemUsesArtifact.INSTANCE)
.addOperation(Operations.SHOW_METRICS, SwitchYardSubsystemShowMetrics.INSTANCE)
.addOperation(Operations.RESET_METRICS, SwitchYardSubsystemResetMetrics.INSTANCE)
.addOperation(Operations.STOP_GATEWAY, SwitchYardSubsystemStopGateway.INSTANCE)
.addOperation(Operations.START_GATEWAY, SwitchYardSubsystemStartGateway.INSTANCE)
.addOperation(Operations.UPDATE_THROTTLING, SwitchYardSubsystemUpdateThrottling.INSTANCE)
.pushChild(securityConfigsResource).pop()
.pushChild(modulesResource).pop()
.pushChild(extensionsResource).pop()
.build();
subsystem.registerSubsystemModel(subsystemResource);
final ManagementResourceRegistration registration = subsystem.registerDeploymentModel(new SimpleResourceDefinition(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployment")));
registration.registerSubModel(new SimpleResourceDefinition(PathElement.pathElement(SwitchYardModelConstants.APPLICATION), getResourceDescriptionResolver()));
}
示例6: initialize
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void initialize(final ExtensionContext context) {
// log SwitchYard notification message (includes version information)
LOGGER.info(Versions.getSwitchYardNotification());
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1, 0));
subsystem.registerXMLElementWriter(SwitchYardSubsystemWriter.getInstance());
ResourceBuilder securityConfigsResource = ResourceBuilder.Factory.create(SECURITY_CONFIG_PATH, getResourceDescriptionResolver(SECURITY_CONFIG))
.setAddOperation(SwitchYardSecurityConfigAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder modulesResource = ResourceBuilder.Factory.create(MODULE_PATH, getResourceDescriptionResolver(MODULE))
.setAddOperation(SwitchYardModuleAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.IMPLCLASS, null, new ReloadRequiredWriteAttributeHandler(Attributes.IMPLCLASS))
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES));
ResourceBuilder extensionsResource = ResourceBuilder.Factory.create(EXTENSION_PATH, getResourceDescriptionResolver(EXTENSION))
.setAddOperation(SwitchYardExtensionAdd.INSTANCE)
.setRemoveOperation(ReloadRequiredRemoveStepHandler.INSTANCE);
ResourceDefinition subsystemResource = ResourceBuilder.Factory.createSubsystemRoot(SUBSYSTEM_PATH, getResourceDescriptionResolver(), SwitchYardSubsystemAdd.INSTANCE, ReloadRequiredRemoveStepHandler.INSTANCE)
.addReadWriteAttribute(Attributes.SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(Attributes.SOCKET_BINDING))
.addReadWriteAttribute(Attributes.PROPERTIES, null, new ReloadRequiredWriteAttributeHandler(Attributes.PROPERTIES))
.addOperation(Operations.GET_VERSION, SwitchYardSubsystemGetVersion.INSTANCE)
.addOperation(Operations.LIST_APPLICATIONS, SwitchYardSubsystemListApplications.INSTANCE)
.addOperation(Operations.LIST_REFERENCES, SwitchYardSubsystemListReferences.INSTANCE)
.addOperation(Operations.LIST_SERVICES, SwitchYardSubsystemListServices.INSTANCE)
.addOperation(Operations.READ_APPLICATION, SwitchYardSubsystemReadApplication.INSTANCE)
.addOperation(Operations.READ_REFERENCE, SwitchYardSubsystemReadReference.INSTANCE)
.addOperation(Operations.READ_SERVICE, SwitchYardSubsystemReadService.INSTANCE)
.addOperation(Operations.USES_ARTIFACT, SwitchYardSubsystemUsesArtifact.INSTANCE)
.addOperation(Operations.SHOW_METRICS, SwitchYardSubsystemShowMetrics.INSTANCE)
.addOperation(Operations.RESET_METRICS, SwitchYardSubsystemResetMetrics.INSTANCE)
.addOperation(Operations.STOP_GATEWAY, SwitchYardSubsystemStopGateway.INSTANCE)
.addOperation(Operations.START_GATEWAY, SwitchYardSubsystemStartGateway.INSTANCE)
.addOperation(Operations.UPDATE_THROTTLING, SwitchYardSubsystemUpdateThrottling.INSTANCE)
.pushChild(securityConfigsResource).pop()
.pushChild(modulesResource).pop()
.pushChild(extensionsResource).pop()
.build();
subsystem.registerSubsystemModel(subsystemResource);
final ManagementResourceRegistration registration = subsystem.registerDeploymentModel(new SimpleResourceDefinition(SUBSYSTEM_PATH, getResourceDescriptionResolver(DEPLOYMENT)));
ResourceBuilder applicationResource = ResourceBuilder.Factory.create(PathElement.pathElement(SwitchYardModelConstants.APPLICATION), getResourceDescriptionResolver(DEPLOYMENT, APPLICATION))
.setRuntime()
.addReadOnlyAttribute(Operations.NAME)
.addReadOnlyAttribute(Operations.SERVICES)
.addReadOnlyAttribute(Operations.REFERENCES)
.addReadOnlyAttribute(Operations.COMPONENT_SERVICES)
.addReadOnlyAttribute(Operations.TRANSFORMERS)
.addReadOnlyAttribute(Operations.ARTIFACTS)
.addReadOnlyAttribute(Operations.VALIDATORS)
.addReadOnlyAttribute(Operations.PROPERTIES);
registration.registerSubModel(applicationResource.build());
}
示例7: ModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
ModelControllerService(final ProcessType processType, final ManagedAuditLogger auditLogger, final DelegatingConfigurableAuthorizer authorizer) {
super(processType, new EmptyConfigurationPersister(), new ControlledProcessState(true),
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(),
auditLogger, authorizer);
}
示例8: ModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
ModelControllerService(final ProcessType processType, final ManagedAuditLogger auditLogger) {
super(processType, new EmptyConfigurationPersister(), new ControlledProcessState(true),
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(),
auditLogger);
}
示例9: TestModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
protected TestModelControllerService(final ConfigurationPersister configurationPersister, final ControlledProcessState processState) {
this(ProcessType.EMBEDDED_SERVER, configurationPersister, processState,
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(),
AuditLogger.NO_OP_LOGGER);
}
示例10: ModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
public ModelControllerService(final ManagedAuditLogger auditLogger) {
super(AbstractControllerTestBase.this.processType, new EmptyConfigurationPersister(), new ControlledProcessState(true),
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build(),
auditLogger, initializer, capabilityRegistry);
}
示例11: ModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
public ModelControllerService(final ProcessType processType) {
super(processType, new EmptyConfigurationPersister(), new ControlledProcessState(true),
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build()
);
}
示例12: initModel
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
System.setProperty("boolean-value", "true");
System.setProperty("long-value", "1000");
System.setProperty("string-value", "wildfly");
System.setProperty("double-value", "1.0");
System.setProperty("int-value", "100");
System.setProperty("bytes-value", "wildfly");
System.setProperty("bigint-value", "100");
System.setProperty("bigdec-value", "10.0");
ManagementResourceRegistration rootRegistration = managementModel.getRootResourceRegistration();
GlobalOperationHandlers.registerGlobalOperations(rootRegistration, processType);
rootRegistration.registerOperationHandler(SETUP_OP_DEF, new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
final ModelNode model = new ModelNode();
//Atttributes
model.get("profile", "profileA", NAME).set("profileA");
model.get("profile", "profileA", "subsystem", "subsystem1", BOOLEAN_ATT_NAME).set(true);
model.get("profile", "profileA", "subsystem", "subsystem1", LONG_ATT_NAME).set(1000L);
model.get("profile", "profileB", NAME).set("profileB");
model.get("profile", "profileB", "subsystem", "subsystem1", BOOLEAN_ATT_NAME).set(new ValueExpression("${boolean-value}"));
model.get("profile", "profileB", "subsystem", "subsystem1", LONG_ATT_NAME).set(new ValueExpression("${long-value}"));
model.get("profile", "profilType", NAME).set("profilType");
model.get("profile", "profilType", "subsystem", "subsystem1", BOOLEAN_ATT_NAME).set(true);
model.get("profile", "profilType", "subsystem", "subsystem1", LONG_ATT_NAME).set(1000L);
model.get("profile", "profilType", "subsystem", "subsystem1", STRING_ATT_NAME).set("wildfly");
model.get("profile", "profilType", "subsystem", "subsystem1", DOUBLE_ATT_NAME).set(1.0D);
model.get("profile", "profilType", "subsystem", "subsystem1", INT_ATT_NAME).set(100);
model.get("profile", "profilType", "subsystem", "subsystem1", BYTES_ATT_NAME).set("wildfly".getBytes(UTF_8));
model.get("profile", "profilType", "subsystem", "subsystem1", BIGINT_ATT_NAME).set(new BigInteger("100"));
model.get("profile", "profilType", "subsystem", "subsystem1", BIGDEC_ATT_NAME).set(new BigDecimal("10.0"));
createModel(context, model);
}
}
);
GlobalNotifications.registerGlobalNotifications(rootRegistration, processType);
ResourceDefinition profileDef = ResourceBuilder.Factory.create(PathElement.pathElement("profile", "*"),
new NonResolvingResourceDescriptionResolver())
.addReadOnlyAttribute(SimpleAttributeDefinitionBuilder.create(NAME, ModelType.STRING, false).setMinSize(1).build())
.pushChild(PathElement.pathElement("subsystem", "subsystem1"))
.addReadWriteAttribute(BOOLEAN_ATT, null, handler)
.addReadWriteAttribute(LONG_ATT, null, handler)
.addReadWriteAttribute(STRING_ATT, null, handler)
.addReadWriteAttribute(DOUBLE_ATT, null, handler)
.addReadWriteAttribute(INT_ATT, null, handler)
.addReadWriteAttribute(BYTES_ATT, null, handler)
.addReadWriteAttribute(BIGINT_ATT, null, handler)
.addReadWriteAttribute(BIGDEC_ATT, null, handler)
.pop()
.build();
rootRegistration.registerSubModel(profileDef);
}
示例13: MainModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
MainModelControllerService(final ControlledProcessState processState) {
super(ProcessType.EMBEDDED_SERVER, new NullConfigurationPersister(), processState,
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build());
}
示例14: ProxyModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
ProxyModelControllerService(final ControlledProcessState processState) {
super(ProcessType.EMBEDDED_SERVER, new NullConfigurationPersister(), processState,
ResourceBuilder.Factory.create(PathElement.pathElement("root"), new NonResolvingResourceDescriptionResolver()).build());
}
示例15: PlatformMBeanTestModelControllerService
import org.jboss.as.controller.ResourceBuilder; //导入依赖的package包/类
/**
* Construct a new instance.
*
*/
protected PlatformMBeanTestModelControllerService() {
super(ProcessType.EMBEDDED_SERVER, new RunningModeControl(RunningMode.NORMAL), new NullConfigurationPersister(), new ControlledProcessState(true),
ResourceBuilder.Factory.create(PathElement.pathElement("root"),new NonResolvingResourceDescriptionResolver()).build(), null, ExpressionResolver.TEST_RESOLVER,
AuditLogger.NO_OP_LOGGER, new DelegatingConfigurableAuthorizer(), new ManagementSecurityIdentitySupplier(), new CapabilityRegistry(true));
}