• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Resource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: performBoottime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void performBoottime(OperationContext context, ModelNode operation, ModelNode model,
        ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers)
        throws OperationFailedException {

    ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));

    SmppService service = SmppService.INSTANCE;
    service.setModel(fullModel);

    ServiceName name = SmppService.getServiceName();
    ServiceController<SmppServiceInterface> controller = context.getServiceTarget()
            .addService(name, service)
            .addDependency(PathManagerService.SERVICE_NAME, PathManager.class, service.getPathManagerInjector())
            .addDependency(MBeanServerService.SERVICE_NAME, MBeanServer.class, service.getMbeanServer())
            .addListener(verificationHandler)
            .setInitialMode(ServiceController.Mode.ACTIVE)
            .install();
    newControllers.add(controller);

}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:23,代码来源:SubsystemAdd.java


示例2: testRemoveWithWriteAttributeSensitivity

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
private void testRemoveWithWriteAttributeSensitivity(StandardRole role, boolean success) throws Exception {
    ChildResourceDefinition def = new ChildResourceDefinition(ONE);
    def.addAttribute("test", WRITE_CONSTRAINT);
    rootRegistration.registerSubModel(def);

    Resource resourceA = Resource.Factory.create();
    resourceA.getModel().get("test").set("a");
    rootResource.registerChild(ONE_A, resourceA);

    Resource resourceB = Resource.Factory.create();
    resourceB.getModel().get("test").set("b");
    rootResource.registerChild(ONE_B, resourceB);

    ModelNode op = Util.createRemoveOperation(ONE_B_ADDR);
    op.get(OPERATION_HEADERS, "roles").set(role.toString());
    if (success) {
        executeForResult(op);
    } else {
        executeForFailure(op);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:RemoveResourceTestCase.java


示例3: removeContent

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
private void removeContent(OperationContext context, List<byte[]> removedHashes, String name) {
    Set<String> newHash;
    try {
        newHash = DeploymentUtils.getDeploymentHexHash(context.readResource(PathAddress.EMPTY_ADDRESS, false).getModel());
    } catch (Resource.NoSuchResourceException ex) {
        newHash = Collections.emptySet();
    }
    for (byte[] hash : removedHashes) {
        try {
            if (newHash.isEmpty() || !newHash.contains(HashUtil.bytesToHexString(hash))) {
                contentRepository.removeContent(ModelContentReference.fromDeploymentName(name, hash));
            } else {
                ServerLogger.ROOT_LOGGER.undeployingDeploymentHasBeenRedeployed(name);
            }
        } catch (Exception e) {
            //TODO
            ServerLogger.ROOT_LOGGER.failedToRemoveDeploymentContent(e, HashUtil.bytesToHexString(hash));
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:DeploymentRemoveHandler.java


示例4: updateOptionsAttribute

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
protected void updateOptionsAttribute(OperationContext context, ModelNode operation, String type) {

        final PathAddress operationAddress = PathAddress.pathAddress(operation.get(OP_ADDR));
        final PathAddress discoveryOptionsAddress = operationAddress.subAddress(0, operationAddress.size() - 1);
        final ModelNode discoveryOptions = Resource.Tools.readModel(context.readResourceFromRoot(discoveryOptionsAddress));

        // Get the current list of discovery options and remove the given discovery option
        // from the list to maintain the order
        final ModelNode currentList = discoveryOptions.get(ModelDescriptionConstants.OPTIONS);
        final String name = operationAddress.getLastElement().getValue();

        final ModelNode newList = new ModelNode().setEmptyList();
        for (ModelNode e : currentList.asList()) {
            final Property prop = e.asProperty();
            final String discoveryOptionType = prop.getName();
            final String discoveryOptionName = prop.getValue().get(ModelDescriptionConstants.NAME).asString();
            if (!(discoveryOptionType.equals(type) && discoveryOptionName.equals(name))) {
                newList.add(e);
            }
        }

        final ModelNode writeOp = Util.getWriteAttributeOperation(discoveryOptionsAddress, ModelDescriptionConstants.OPTIONS, newList);
        final OperationStepHandler writeHandler = context.getRootResourceRegistration().getSubModel(discoveryOptionsAddress).getOperationHandler(PathAddress.EMPTY_ADDRESS, WRITE_ATTRIBUTE_OPERATION);
        context.addStep(writeOp, writeHandler, OperationContext.Stage.MODEL);
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:AbstractDiscoveryOptionRemoveHandler.java


示例5: initModel

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void initModel(ManagementModel managementModel) {
    ManagementResourceRegistration registration = managementModel.getRootResourceRegistration();
    GlobalOperationHandlers.registerGlobalOperations(registration, processType);

    registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);

    GlobalNotifications.registerGlobalNotifications(registration, processType);

    ManagementResourceRegistration coreResourceRegistration = registration.registerSubModel(new CoreResourceDefinition());
    coreResourceRegistration.registerSubModel(new ChildResourceDefinition(CHILD));
    coreResourceRegistration.registerSubModel(new SingletonResourceDefinition(SERVICE, ASYNC));
    coreResourceRegistration.registerSubModel(new SingletonResourceDefinition(SERVICE, REMOTE));
    coreResourceRegistration.registerSubModel(new ChildResourceDefinition(DATASOURCE));
    coreResourceRegistration.registerSubModel(new SingletonResourceDefinition(DATASOURCE, DS));
    Resource model = Resource.Factory.create();
    Resource rootResource = managementModel.getRootResource();
    rootResource.registerChild(PathElement.pathElement(CORE, MODEL), model);
    model.registerChild(PathElement.pathElement(CHILD, "myChild"), Resource.Factory.create());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:SingletonResourceTestCase.java


示例6: getHostEffect

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
/** Creates an appropriate HSGE for resources in the host tree, excluding the server and server-config subtrees */
private synchronized HostServerGroupEffect getHostEffect(PathAddress address, String host, Resource root)  {
    if (requiresMapping) {
        map(root);
        requiresMapping = false;
    }
    Set<String> mapped = hostsToGroups.get(host);
    if (mapped == null) {
        // Unassigned host. Treat like an unassigned profile or socket-binding-group;
        // i.e. available to all server group scoped roles.
        // Except -- WFLY-2085 -- the master HC is not open to all s-g-s-rs
        Resource hostResource = root.getChild(PathElement.pathElement(HOST, host));
        if (hostResource != null) {
            ModelNode dcModel = hostResource.getModel().get(DOMAIN_CONTROLLER);
            if (!dcModel.hasDefined(REMOTE)) {
                mapped = Collections.emptySet(); // prevents returning HostServerGroupEffect.forUnassignedHost(address, host)
            }
        }
    }
    return mapped == null ? HostServerGroupEffect.forUnassignedHost(address, host)
            : HostServerGroupEffect.forMappedHost(address, mapped, host);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:HostServerGroupTracker.java


示例7: performBoottime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model)
        throws OperationFailedException {

    final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
    final ModelNode node = Resource.Tools.readModel(resource);
    // get the minimum set of deployment permissions.
    final ModelNode deploymentPermissionsModel = node.get(DEPLOYMENT_PERMISSIONS_PATH.getKeyValuePair());
    final ModelNode minimumPermissionsNode = MINIMUM_PERMISSIONS.resolveModelAttribute(context, deploymentPermissionsModel);
    final List<PermissionFactory> minimumSet = this.retrievePermissionSet(context, minimumPermissionsNode);

    // get the maximum set of deployment permissions.
    ModelNode maximumPermissionsNode = MAXIMUM_PERMISSIONS.resolveModelAttribute(context, deploymentPermissionsModel);
    if (!maximumPermissionsNode.isDefined())
        maximumPermissionsNode = DEFAULT_MAXIMUM_SET;
    final List<PermissionFactory> maximumSet = this.retrievePermissionSet(context, maximumPermissionsNode);

    // validate the configured permissions - the minimum set must be implied by the maximum set.
    final FactoryPermissionCollection maxPermissionCollection = new FactoryPermissionCollection(maximumSet.toArray(new PermissionFactory[maximumSet.size()]));
    final StringBuilder failedPermissions = new StringBuilder();
    for (PermissionFactory factory : minimumSet) {
        Permission permission = factory.construct();
        if (!maxPermissionCollection.implies(permission)) {
            failedPermissions.append("\n\t\t").append(permission);
        }
    }
    if (failedPermissions.length() > 0) {
        throw SecurityManagerLogger.ROOT_LOGGER.invalidSubsystemConfiguration(failedPermissions);
    }

    // install the DUPs responsible for parsing and validating security permissions found in META-INF/permissions.xml.
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
             processorTarget.addDeploymentProcessor(Constants.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_PERMISSIONS,
                     new PermissionsParserProcessor(minimumSet));
             processorTarget.addDeploymentProcessor(Constants.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_PERMISSIONS_VALIDATION,
                     new PermissionsValidationProcessor(maximumSet));
        }
    }, OperationContext.Stage.RUNTIME);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:41,代码来源:SecurityManagerSubsystemAdd.java


示例8: populateModel

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void populateModel(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {

    // For any attribute where the value in 'operation' differs from the model in the
    // parent resource, add an immediate 'write-attribute' step against the parent
    PathAddress parentAddress = context.getCurrentAddress().getParent();
    ModelNode parentModel = context.readResourceFromRoot(parentAddress, false).getModel();
    OperationStepHandler writeHandler = null;
    ModelNode baseWriteOp = null;
    for (AttributeDefinition ad : RemotingEndpointResource.ATTRIBUTES.values()) {
        String attr = ad.getName();
        ModelNode parentVal = parentModel.get(attr);
        ModelNode opVal = operation.has(attr) ? operation.get(attr) : new ModelNode();
        if (!parentVal.equals(opVal)) {
            if (writeHandler == null) {
                writeHandler = context.getRootResourceRegistration().getOperationHandler(parentAddress, WRITE_ATTRIBUTE_OPERATION);
                baseWriteOp = Util.createEmptyOperation(WRITE_ATTRIBUTE_OPERATION, parentAddress);
            }
            ModelNode writeOp = baseWriteOp.clone();
            writeOp.get(NAME).set(attr);
            writeOp.get(VALUE).set(opVal);
            context.addStep(writeOp, writeHandler, OperationContext.Stage.MODEL, true);
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:RemotingEndpointAdd.java


示例9: performRuntime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException {

    ModelNode subsystemConfig = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));

    // TODO: the root resource doesn't inlcude the runtime paramters, hence we cannot depict the host/server name & launch-type from it.
    //ModelNode systemConfig = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, false));

    // Add the service
    newControllers.add(
            RhqMetricsService.createService(
                    context.getServiceTarget(),
                    verificationHandler,
                    subsystemConfig
            )
    );
}
 
开发者ID:hawkular,项目名称:wildfly-monitor,代码行数:18,代码来源:SubsystemAdd.java


示例10: removeContentFromExplodedAndTransformOperation

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
/**
 * Remove contents from the deployment and attach a "transformed" slave operation to the operation context.
 *
 * @param context the operation context
 * @param operation the original operation
 * @param contentRepository the content repository
 * @return the hash of the uploaded deployment content
 * @throws IOException
 * @throws OperationFailedException
 */
public static byte[] removeContentFromExplodedAndTransformOperation(OperationContext context, ModelNode operation, ContentRepository contentRepository) throws OperationFailedException, ExplodedContentException {
    final Resource deploymentResource = context.readResource(PathAddress.EMPTY_ADDRESS);
    ModelNode contentItemNode = getContentItem(deploymentResource);
    final byte[] oldHash = CONTENT_HASH.resolveModelAttribute(context, contentItemNode).asBytes();
    final List<String> paths = REMOVED_PATHS.unwrap(context, operation);
    final byte[] hash = contentRepository.removeContentFromExploded(oldHash, paths);

    // Clear the contents and update with the hash
    final ModelNode slave = operation.clone();
    slave.get(CONTENT).setEmptyList().add().get(HASH).set(hash);
    slave.get(CONTENT).add().get(ARCHIVE).set(false);
    // Add the domain op transformer
    List<DomainOperationTransmuter> transformers = context.getAttachment(OperationAttachments.SLAVE_SERVER_OPERATION_TRANSMUTERS);
    if (transformers == null) {
        context.attach(OperationAttachments.SLAVE_SERVER_OPERATION_TRANSMUTERS, transformers = new ArrayList<>());
    }
    transformers.add(new CompositeOperationAwareTransmuter(slave));
    return hash;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:30,代码来源:DeploymentUploadUtil.java


示例11: log

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
public void log(boolean readOnly, ResultAction resultAction, String userId, String domainUUID, AccessMechanism accessMechanism,
        InetAddress remoteAddress, Resource resultantModel, List<ModelNode> operations) {
    if (runDisabledFastPath.get())
        return;

    config.lock();
    try {
        if (skipLogging(readOnly)) {
            return;
        }
        storeLogItem(
                AuditLogItem.createModelControllerItem(config.getAsVersion(), readOnly, config.isBooting(), resultAction, userId, domainUUID,
                        accessMechanism, remoteAddress, resultantModel, operations));
    } catch (Exception e) {
        handleLoggingException(e);
    } finally {
        applyHandlerUpdates();
        config.unlock();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ManagedAuditLoggerImpl.java


示例12: recordCapabilitiesAndRequirements

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
    Set<RuntimeCapability> capabilitySet = capabilities.isEmpty() ? context.getResourceRegistration().getCapabilities() : capabilities;

    for (RuntimeCapability capability : capabilitySet) {
        if (capability.isDynamicallyNamed()) {
            context.registerCapability(capability.fromBaseCapability(context.getCurrentAddress()));
        } else {
            context.registerCapability(capability);
        }
    }

    ModelNode model = resource.getModel();
    for (AttributeDefinition ad : attributeDefinitions) {
        if (model.hasDefined(ad.getName()) || ad.hasCapabilityRequirements()) {
            ad.addCapabilityRequirements(context, resource, model.get(ad.getName()));
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:SecurityRealmChildAddHandler.java


示例13: execute

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException {
    final ModelNode address;
    final PathAddress pa = context.getCurrentAddress();

    AuthorizationResult authResult = context.authorize(operation, DESCRIBE_EFFECTS);
    if (authResult.getDecision() != AuthorizationResult.Decision.PERMIT) {
        throw ControllerLogger.ROOT_LOGGER.unauthorized(operation.require(OP).asString(), pa, authResult.getExplanation());
    }

    if (pa.size() > 0) {
        address = new ModelNode().add(pa.getLastElement().getKey(), pa.getLastElement().getValue());
    } else {
        address = new ModelNode().setEmptyList();
    }
    final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS);
    final ModelNode result = context.getResult();
    describe(context.getAttachment(OrderedChildTypesAttachment.KEY), resource,
            address, result, context.getResourceRegistration());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:21,代码来源:GenericSubsystemDescribeHandler.java


示例14: testInsertedOrderedChildrenModelSync

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Test
public void testInsertedOrderedChildrenModelSync() throws Exception {
    //Inserts a child to the beginning
    ModelNode originalModel = readResourceRecursive();

    Resource rootResource = createMasterDcResources();
    createAndRegisterSubsystemChildFromRoot(rootResource, ORDERED_CHILD.getKey(), "pear", 0);
    ModelNode master = Resource.Tools.readModel(rootResource);

    executeTriggerSyncOperation(rootResource);
    ModelNode currentModel = readResourceRecursive();

    Assert.assertNotEquals(originalModel, currentModel);
    compare(findSubsystemResource(currentModel).get(ORDERED_CHILD.getKey()).keys(), "pear", "apple", "orange");
    compareSubsystemModels(master, currentModel);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:OrderedChildResourceSyncModelTestCase.java


示例15: recordCapabilitiesAndRequirements

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
/**
 * Record any new {@link org.jboss.as.controller.capability.RuntimeCapability capabilities} that are no longer available as
 * a result of this operation, as well as any requirements for other capabilities that no longer exist. This method is
 * invoked during {@link org.jboss.as.controller.OperationContext.Stage#MODEL}.
 * <p>
 * Any changes made by this method will automatically be discarded if the operation rolls back.
 * </p>
 * <p>
 * This default implementation deregisters any capabilities passed to the constructor.
 * </p>
 *
 * @param context the context. Will not be {@code null}
 * @param operation the operation that is executing Will not be {@code null}
 * @param resource the resource that will be removed. Will <strong>not</strong> reflect any updates made by
 * {@link #performRemove(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)} as this method
 *                 is invoked before that method is. Will not be {@code null}
 */
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
    Set<RuntimeCapability> capabilitySet = capabilities.isEmpty() ? context.getResourceRegistration().getCapabilities() : capabilities;

    for (RuntimeCapability capability : capabilitySet) {
        if (capability.isDynamicallyNamed()) {
            context.deregisterCapability(capability.getDynamicName(context.getCurrentAddress()));
        } else {
            context.deregisterCapability(capability.getName());
        }
    }
    ModelNode model = resource.getModel();
    ImmutableManagementResourceRegistration mrr = context.getResourceRegistration();
    for (String attr : mrr.getAttributeNames(PathAddress.EMPTY_ADDRESS)) {
        AttributeAccess aa = mrr.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attr);
        if (aa != null) {
            AttributeDefinition ad = aa.getAttributeDefinition();
            if (ad != null && (model.hasDefined(ad.getName()) || ad.hasCapabilityRequirements())) {
                ad.removeCapabilityRequirements(context, resource, model.get(ad.getName()));
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:AbstractRemoveStepHandler.java


示例16: performRuntime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {

    final ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
    final Set<String> outboundSocketBindings = new HashSet<>();
    ConfigurationBuilder builder = new ConfigurationBuilder();
    if (profileEntry.hasDefined(CommonAttributes.ID_NAME)) {
        builder.setDescription(profileEntry.get(CommonAttributes.ID_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
        builder.setJNDIName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
        builder.setModuleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.TRANSACTION)) {
        builder.setTransactionEnlistment(TransactionEnlistmentType.getFromStringValue(profileEntry.get(CommonAttributes.TRANSACTION).asString()));
    }
    if (profileEntry.hasDefined(CommonAttributes.HOST_DEF)) {
        ModelNode hostModels = profileEntry.get(CommonAttributes.HOST_DEF);
        for (ModelNode host : hostModels.asList()) {
            for (ModelNode hostEntry : host.get(0).asList()) {
                if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
                    String outboundSocketBindingRef = hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
                    outboundSocketBindings.add(outboundSocketBindingRef);
                }
            }
        }
    }
    if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
        builder.setSecurityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
    }
    startNeo4jDriverService(context, builder, outboundSocketBindings);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:35,代码来源:Neo4jDefinition.java


示例17: performRuntime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        throws OperationFailedException {
    ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
    Configuration configuration = getConfiguration(profileEntry);
    String outboundSocketBinding = getOutboundSocketBinding(profileEntry);

    startServices(context, configuration, outboundSocketBinding);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:10,代码来源:OrientDefinition.java


示例18: performRuntime

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {

    final ModelNode profileEntry = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
    final Set<String> outboundSocketBindings = new HashSet<>();
    ConfigurationBuilder builder = new ConfigurationBuilder();
    if (profileEntry.hasDefined(CommonAttributes.ID_NAME)) {
        builder.setDescription(profileEntry.get(CommonAttributes.ID_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.JNDI_NAME)) {
        builder.setJNDIName(profileEntry.get(CommonAttributes.JNDI_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.MODULE_NAME)) {
        builder.setModuleName(profileEntry.get(CommonAttributes.MODULE_NAME).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.DATABASE)) {
        builder.setKeyspace(profileEntry.get(CommonAttributes.DATABASE).asString());
    }
    if (profileEntry.hasDefined(CommonAttributes.SSL)) {
        builder.setWithSSL(profileEntry.get(CommonAttributes.SSL).asBoolean());
    }
    if (profileEntry.hasDefined(CommonAttributes.HOST_DEF)) {
        ModelNode hostModels = profileEntry.get(CommonAttributes.HOST_DEF);
        for (ModelNode host : hostModels.asList()) {
            for (ModelNode hostEntry : host.get(0).asList()) {
                if (hostEntry.hasDefined(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF)) {
                    String outboundSocketBindingRef = hostEntry.get(CommonAttributes.OUTBOUND_SOCKET_BINDING_REF).asString();
                    outboundSocketBindings.add(outboundSocketBindingRef);
                }
            }
        }
    }
    if (profileEntry.hasDefined(CommonAttributes.SECURITY_DOMAIN)) {
        builder.setSecurityDomain(profileEntry.get(CommonAttributes.SECURITY_DOMAIN).asString());
    }
    startCassandraDriverService(context, builder, outboundSocketBindings);
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:38,代码来源:CassandraDefinition.java


示例19: populateModel

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws  OperationFailedException {	
	resource.getModel().setEmptyObject();
	populate(operation, resource.getModel());
	
	if (context.getProcessType().equals(ProcessType.STANDALONE_SERVER) && context.isNormalServer()) {
		deployResources(context);
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:10,代码来源:TeiidAdd.java


示例20: getChild

import org.jboss.as.controller.registry.Resource; //导入依赖的package包/类
@Override
public Resource getChild(PathElement element) {
    Resource result = null;
    if (ACTIVE_OPERATION.equals(element.getKey())) {
        try {
            OperationContextImpl context = activeOperations.get(Integer.valueOf(element.getValue()));
            if (context != null) {
                result = context.getActiveOperationResource();
            }
        } catch (NumberFormatException e) {
            // just return null
        }
    }
    return result;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:16,代码来源:ModelControllerImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PKCS12Attribute类代码示例发布时间:2022-05-22
下一篇:
Java RC564Engine类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap