当前位置: 首页>>代码示例>>Java>>正文


Java SimpleResourceDefinition类代码示例

本文整理汇总了Java中org.jboss.as.controller.SimpleResourceDefinition的典型用法代码示例。如果您正苦于以下问题:Java SimpleResourceDefinition类的具体用法?Java SimpleResourceDefinition怎么用?Java SimpleResourceDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SimpleResourceDefinition类属于org.jboss.as.controller包,在下文中一共展示了SimpleResourceDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testToPathAddress

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的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);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:ObjectNameAddressUtilTestCase.java

示例2: registerOverrideModel

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
@Override
public ManagementResourceRegistration registerOverrideModel(String name, OverrideDescriptionProvider descriptionProvider) {
    Assert.checkNotNullParam("name", name);
    Assert.checkNotNullParam("descriptionProvider", descriptionProvider);

    if (parent == null) {
        throw ControllerLogger.ROOT_LOGGER.cannotOverrideRootRegistration();
    }

    if (!PathElement.WILDCARD_VALUE.equals(valueString)) {
        throw ControllerLogger.ROOT_LOGGER.cannotOverrideNonWildCardRegistration(valueString);
    }
    PathElement pe = PathElement.pathElement(parent.getKeyName(), name);

    final SimpleResourceDefinition rd = new SimpleResourceDefinition(pe, new OverrideDescriptionCombiner(getModelDescription(PathAddress.EMPTY_ADDRESS), descriptionProvider)) {

        @Override
        public List<AccessConstraintDefinition> getAccessConstraints() {
            return AbstractResourceRegistration.this.getAccessConstraints();
        }
    };
    return parent.getParent().registerSubModel(rd);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:AbstractResourceRegistration.java

示例3: setupResources

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
private void setupResources(boolean isA, boolean isB) {

        a.setConfiguredApplication(isA);
        b.setConfiguredApplication(isB);

        ResourceDefinition rootRd = new SimpleResourceDefinition(null, new NonResolvingResourceDescriptionResolver()) {
            @Override
            public List<AccessConstraintDefinition> getAccessConstraints() {
                return rootResourceConstraints;
            }
        };
        ManagementResourceRegistration rootRegistration = ManagementResourceRegistration.Factory.forProcessType(ProcessType.EMBEDDED_SERVER).createRegistration(rootRd);
        rootRegistration.registerOperationHandler(WRITE_CONFIG_DEF, NoopOperationStepHandler.WITHOUT_RESULT, true);

        PathElement childPE = PathElement.pathElement("child");
        ResourceDefinition childRd = new SimpleResourceDefinition(childPE, new NonResolvingResourceDescriptionResolver()) {
            @Override
            public List<AccessConstraintDefinition> getAccessConstraints() {
                return childResourceConstraints;
            }
        };
        ManagementResourceRegistration childRegistration = rootRegistration.registerSubModel(childRd);
        rootTarget = TargetResource.forStandalone(PathAddress.EMPTY_ADDRESS, rootRegistration, Resource.Factory.create());
        childTarget = TargetResource.forStandalone(PathAddress.pathAddress(childPE), childRegistration, Resource.Factory.create());
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:ApplicationTypeConstraintUnitTestCase.java

示例4: setupResources

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
private void setupResources() {
    ResourceDefinition rootRd = new SimpleResourceDefinition(null, new NonResolvingResourceDescriptionResolver()) {
        @Override
        public List<AccessConstraintDefinition> getAccessConstraints() {
            return rootResourceConstraints;
        }
    };
    ManagementResourceRegistration rootRegistration = ManagementResourceRegistration.Factory.forProcessType(ProcessType.EMBEDDED_SERVER).createRegistration(rootRd);
    rootRegistration.registerOperationHandler(READ_CONFIG_DEF, NoopOperationStepHandler.WITH_RESULT, true);
    PathElement childPE = PathElement.pathElement("child");
    ResourceDefinition childRd = new SimpleResourceDefinition(childPE, new NonResolvingResourceDescriptionResolver()) {
        @Override
        public List<AccessConstraintDefinition> getAccessConstraints() {
            return childResourceConstraints;
        }
    };
    ManagementResourceRegistration childRegistration = rootRegistration.registerSubModel(childRd);

    rootTarget = TargetResource.forStandalone(PathAddress.EMPTY_ADDRESS, rootRegistration, Resource.Factory.create());
    childTarget = TargetResource.forStandalone(PathAddress.pathAddress(childPE), childRegistration, Resource.Factory.create());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:SensitiveTargetConstraintUnitTestCase.java

示例5: initModel

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的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)));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:FilteredReadChildrenResourcesTestCase.java

示例6: initModel

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的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)));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:FilteredReadChildrenNamesTestCase.java

示例7: testInheritedAccessConstraints

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
@Test
public void testInheritedAccessConstraints() {

    ResourceDefinition rootRd = new SimpleResourceDefinition(new Parameters(null, new NonResolvingResourceDescriptionResolver())
        .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.EXTENSIONS, ApplicationTypeAccessConstraintDefinition.DEPLOYMENT));
    ManagementResourceRegistration root = ManagementResourceRegistration.Factory.forProcessType(ProcessType.EMBEDDED_SERVER).createRegistration(rootRd);

    List<AccessConstraintDefinition> acds = root.getAccessConstraints();
    assertEquals(2, acds.size());
    assertTrue(acds.contains(SensitiveTargetAccessConstraintDefinition.EXTENSIONS));
    assertTrue(acds.contains(ApplicationTypeAccessConstraintDefinition.DEPLOYMENT));

    ResourceDefinition childRd = new SimpleResourceDefinition(
            new Parameters(PathElement.pathElement("child"), new NonResolvingResourceDescriptionResolver())
                .setAccessConstraints(SensitiveTargetAccessConstraintDefinition.SECURITY_DOMAIN, ApplicationTypeAccessConstraintDefinition.DEPLOYMENT));
    ManagementResourceRegistration child = root.registerSubModel(childRd);
    acds = child.getAccessConstraints();
    assertEquals(4, acds.size());
    assertTrue(acds.contains(SensitiveTargetAccessConstraintDefinition.EXTENSIONS));
    assertTrue(acds.contains(SensitiveTargetAccessConstraintDefinition.SECURITY_DOMAIN));
    assertTrue(acds.contains(ApplicationTypeAccessConstraintDefinition.DEPLOYMENT));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:CoreManagementResourceRegistrationUnitTestCase.java

示例8: setup

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
@Before
public void setup() {
    root = ManagementResourceRegistration.Factory.forProcessType(ProcessType.HOST_CONTROLLER).createRegistration(new SimpleResourceDefinition(null, new NonResolvingResourceDescriptionResolver()));
    proxyController = new ProxyController() {
        @Override
        public PathAddress getProxyNodeAddress() {
            return PathAddress.pathAddress(PROXY_ELEMENT);
        }

        @Override
        public void execute(ModelNode operation, OperationMessageHandler handler, ProxyOperationControl control, OperationAttachments attachments, BlockingTimeout blockingTimeout) {
            throw new UnsupportedOperationException();
        }
    };
    root.registerProxyController(PROXY_ELEMENT, proxyController);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:ProxyControllerRegistrationUnitTestCase.java

示例9: initModel

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的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);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ReadResourceChildOrderingTestCase.java

示例10: initialize

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
@Override
public void initialize(ExtensionContext context) {
    final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1));
    SimpleResourceDefinition subsystemResource = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(
            PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME),
            new NonResolvingResourceDescriptionResolver())
    );
    final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(subsystemResource);
    //We always need to add an 'add' operation
    registration.registerOperationHandler(
            SimpleOperationDefinitionBuilder.of(ADD, NonResolvingResourceDescriptionResolver.INSTANCE)
                .setParameters(addAttributes)
                .build(),
            new AbstractAddStepHandler(addAttributes));

    //We always need to add a 'describe' operation
    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    subsystem.registerXMLElementWriter(parser);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:ValidateSubsystemExtension.java

示例11: TestModelControllerService11_0_0

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
TestModelControllerService11_0_0(final Extension mainExtension, final ControllerInitializer controllerInitializer,
                                 final AdditionalInitialization additionalInit, final RunningModeControl runningModeControl, final ExtensionRegistry extensionRegistry,
                                 final StringConfigurationPersister persister, final ModelTestOperationValidatorFilter validateOpsFilter, final boolean registerTransformers) {
    super(AdditionalInitializationUtil.getProcessType(additionalInit), runningModeControl, extensionRegistry.getTransformerRegistry(), persister, validateOpsFilter,
            new SimpleResourceDefinition(null, new NonResolvingResourceDescriptionResolver()), new ControlledProcessState(true), Controller90x.INSTANCE);
    this.mainExtension = mainExtension;
    this.additionalInit = additionalInit;
    this.controllerInitializer = controllerInitializer;
    this.extensionRegistry = extensionRegistry;
    this.runningModeControl = runningModeControl;
    this.registerTransformers = registerTransformers;
}
 
开发者ID:wildfly,项目名称:wildfly-legacy-test,代码行数:13,代码来源:TestModelControllerService11_0_0.java

示例12: TestModelControllerService10_0_0

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
TestModelControllerService10_0_0(final Extension mainExtension, final ControllerInitializer controllerInitializer,
                                 final AdditionalInitialization additionalInit, final RunningModeControl runningModeControl, final ExtensionRegistry extensionRegistry,
                                 final StringConfigurationPersister persister, final ModelTestOperationValidatorFilter validateOpsFilter, final boolean registerTransformers) {
    super(AdditionalInitializationUtil.getProcessType(additionalInit), runningModeControl, extensionRegistry.getTransformerRegistry(), persister, validateOpsFilter,
            new SimpleResourceDefinition(null, new NonResolvingResourceDescriptionResolver()), new ControlledProcessState(true), Controller90x.INSTANCE);
    this.mainExtension = mainExtension;
    this.additionalInit = additionalInit;
    this.controllerInitializer = controllerInitializer;
    this.extensionRegistry = extensionRegistry;
    this.runningModeControl = runningModeControl;
    this.registerTransformers = registerTransformers;
}
 
开发者ID:wildfly,项目名称:wildfly-legacy-test,代码行数:13,代码来源:TestModelControllerService10_0_0.java

示例13: DirContextDefinition

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
DirContextDefinition() {
    super(new SimpleResourceDefinition.Parameters(PathElement.pathElement(ElytronDescriptionConstants.DIR_CONTEXT), ElytronExtension.getResourceDescriptionResolver(ElytronDescriptionConstants.DIR_CONTEXT))
            .setAddHandler(ADD)
            .setRemoveHandler(REMOVE)
            .setAddRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES)
            .setRemoveRestartLevel(OperationEntry.Flag.RESTART_RESOURCE_SERVICES)
            .setCapabilities(DIR_CONTEXT_RUNTIME_CAPABILITY));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:9,代码来源:DirContextDefinition.java

示例14: forDomain

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
static ResourceDefinition forDomain() {
    return new SimpleResourceDefinition(new Parameters(PATH, DomainManagementResolver.getResolver(CORE, MANAGEMENT, SERVICE, CONFIGURATION_CHANGES))
            .setAddHandler(new OperationStepHandler() {
                @Override
                public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                    String warning = DomainManagementLogger.ROOT_LOGGER.removedBrokenResource(context.getCurrentAddress().toCLIStyleString());
                    DomainManagementLogger.ROOT_LOGGER.warn(warning);
                    context.getResult().add(warning);
                }

            })
            .setDeprecatedSince(ModelVersion.create(4, 2)));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:14,代码来源:LegacyConfigurationChangeResourceDefinition.java

示例15: bootEmptyConfig

import org.jboss.as.controller.SimpleResourceDefinition; //导入依赖的package包/类
private boolean bootEmptyConfig() throws OperationFailedException, ConfigurationPersistenceException {
    HostControllerLogger.ROOT_LOGGER.debug("Invoking initial empty config host controller boot");
    boolean ok = boot(Collections.emptyList(), true, true);
    // until a host is added with the host add op, there is no root description provider delegate. We just install a non-resolving one for now, so the
    // CLI doesn't get a lot of NPEs from :read-resource-description etc.
    SimpleResourceDefinition def = new SimpleResourceDefinition(new SimpleResourceDefinition.Parameters(null, new NonResolvingResourceDescriptionResolver()));
    rootResourceDefinition.setFakeDelegate(def);
    // just initialize the persister and return, we have to wait for /host=foo:add()
    hostControllerConfigurationPersister.initializeDomainConfigurationPersister(false);
    return ok;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:DomainModelControllerService.java


注:本文中的org.jboss.as.controller.SimpleResourceDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。