當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelNode類代碼示例

本文整理匯總了Java中org.jboss.dmr.ModelNode的典型用法代碼示例。如果您正苦於以下問題:Java ModelNode類的具體用法?Java ModelNode怎麽用?Java ModelNode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ModelNode類屬於org.jboss.dmr包,在下文中一共展示了ModelNode類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: get

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
public static synchronized KubernetesVersion get() {
	if (INSTANCE != null) {
		return INSTANCE;
	}

	try {
		String versionJson = HttpClient.get(TestConfiguration.masterUrl() + "/version").response();
		ModelNode version = ModelNode.fromJSONString(versionJson);
		int major = Integer.parseInt(version.get("major").asString());
		int minor = Integer.parseInt(version.get("minor").asString());
		INSTANCE = new KubernetesVersion(major, minor);
	} catch (Exception e) {
		LOGGER.error("Error getting Kubernetes version from master", e);
		INSTANCE = new KubernetesVersion(0, 0);
	}

	return INSTANCE;
}
 
開發者ID:xtf-cz,項目名稱:xtf,代碼行數:19,代碼來源:KubernetesVersion.java

示例2: requestNewToken

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
/**
 * Request new token from sso instance
 *
 * @return this instance
 * @throws IOException in case of request failure
 */
public TokenHolder requestNewToken() throws IOException {
	final String params = buildParams();
	final String url = ssoAuthUrl + "/realms/" + realm + "/protocol/openid-connect/token";

	log.info("Token request: {}", url);
	log.info("Request params: {} ", params);
	final String response = HttpClient.post(url)
		.data(params, ContentType.APPLICATION_FORM_URLENCODED)
		.response();

	ModelNode tokenResponse = ModelNode.fromJSONString(response);
	log.debug("Token response: {}", tokenResponse);

	return new TokenHolder(tokenResponse);
}
 
開發者ID:xtf-cz,項目名稱:xtf,代碼行數:22,代碼來源:SsoTokenRequestor.java

示例3: performBoottime

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException {

    MicroProfileConfigLogger.ROOT_LOGGER.activatingSubsystem();

    ConfigProviderService.install(context);

    //Add deployment processors here
    //Remove this if you don't need to hook into the deployers, or you can add as many as you like
    //see SubDeploymentProcessor for explanation of the phases
    context.addStep(new AbstractDeploymentChainStep() {
        public void execute(DeploymentProcessorTarget processorTarget) {
            processorTarget.addDeploymentProcessor(SubsystemExtension.SUBSYSTEM_NAME, DependencyProcessor.PHASE, DependencyProcessor.PRIORITY, new DependencyProcessor());
            processorTarget.addDeploymentProcessor(SubsystemExtension.SUBSYSTEM_NAME, SubsystemDeploymentProcessor.PHASE, SubsystemDeploymentProcessor.PRIORITY, new SubsystemDeploymentProcessor());

        }
    }, OperationContext.Stage.RUNTIME);

}
 
開發者ID:wildfly-extras,項目名稱:wildfly-microprofile-config,代碼行數:23,代碼來源:SubsystemAdd.java

示例4: setData

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
private Map<String,Object> setData(ModelNode model) {
    if (!model.isDefined()) {
        return null;
    }
    Map<String, Object> data = new HashMap<>();
    for (String key : model.keys()) {
        final ModelNode modelValue = model.get(key);
        final Object value;
        switch (modelValue.getType()) {
            case LONG:
                value = modelValue.asLong();
                break;
            case BOOLEAN:
                value = modelValue.asBoolean();
                break;
            default:
                value = modelValue.asString();
        }
        data.put(key, value);
    }
    return data;
}
 
開發者ID:jmesnil,項目名稱:wildfly-microprofile-health,代碼行數:23,代碼來源:WildFlyResponseFactory.java

示例5: computeResult

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
public static ModelNode computeResult(Collection<HealthCheckResponse> statuses) {
   ModelNode result = new ModelNode();
   boolean globalOutcome = true;
   result.get("checks").setEmptyList();
   for (HealthCheckResponse status : statuses) {
      ModelNode responseNode = new ModelNode();
      responseNode.get("name").set(status.getName());
      HealthCheckResponse.State state = status.getState();
      globalOutcome = globalOutcome & state == UP;
      responseNode.get("state").set(state.toString());
      if (status.getData().isPresent()) {
         responseNode.get("data").setEmptyObject();
         Map<String, Object> attributes = status.getData().get();
         for (Map.Entry<String, Object> entry : attributes.entrySet()) {
            responseNode.get("data").get(entry.getKey()).set(entry.getValue().toString());
         }
      }
      result.get("checks").add(responseNode);
   }
   result.get("outcome").set(globalOutcome ? "UP" : "DOWN");
   return result;
}
 
開發者ID:jmesnil,項目名稱:wildfly-microprofile-health,代碼行數:23,代碼來源:CheckOperation.java

示例6: performBoottime

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws
        OperationFailedException {

    runtimeValidator.validate(operation.resolve());
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            final int PARSE_NEO4J_DRIVER                          = 0x4C00;
            final int DEPENDENCIES_NEO4J_DRIVER                   = 0x1F10;
            // TODO: use Phase.PARSE_NEO4J_DRIVER
            processorTarget.addDeploymentProcessor(Neo4jDriverExtension.SUBSYSTEM_NAME, Phase.PARSE, PARSE_NEO4J_DRIVER, new DriverScanDependencyProcessor("neo4jsubsystem"));
            // TODO: use Phase.DEPENDENCIES_NEO4J_DRIVER
            processorTarget.addDeploymentProcessor(Neo4jDriverExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, DEPENDENCIES_NEO4J_DRIVER, DriverDependencyProcessor.getInstance());
        }
    }, OperationContext.Stage.RUNTIME);

    startNeo4jDriverSubsysteService(context);

}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:19,代碼來源:Neo4jDriverSubsystemAdd.java

示例7: performBoottime

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model)
        throws OperationFailedException {
    runtimeValidator.validate(operation.resolve());
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            final int PARSE_ORIENT_DRIVER                         = 0x4C01;
            final int DEPENDENCIES_ORIENT_DRIVER                  = 0x1F11;
            // TODO: use Phase.PARSE_ORIENT_DRIVER
            processorTarget.addDeploymentProcessor(OrientDriverExtension.SUBSYSTEM_NAME, Phase.PARSE,
                    PARSE_ORIENT_DRIVER, new DriverScanDependencyProcessor("orientdbsubsystem"));
            // TODO: use Phase.DEPENDENCIES_ORIENT_DRIVER
            processorTarget.addDeploymentProcessor(OrientDriverExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES,
                    DEPENDENCIES_ORIENT_DRIVER, DriverDependencyProcessor.getInstance());
        }
    }, OperationContext.Stage.RUNTIME);

    startOrientSubsystemService(context);
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:19,代碼來源:OrientDriverSubsystemAdd.java

示例8: performBoottime

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws
        OperationFailedException {

    runtimeValidator.validate(operation.resolve());
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            final int PARSE_CASSANDRA_DRIVER                      = 0x4C02;
            final int DEPENDENCIES_CASSANDRA_DRIVER               = 0x1F12;
            // TODO: use Phase.PARSE_CASSANDRA_DRIVER
            processorTarget.addDeploymentProcessor(CassandraDriverExtension.SUBSYSTEM_NAME, Phase.PARSE, PARSE_CASSANDRA_DRIVER, new DriverScanDependencyProcessor("cassandrasubsystem"));
            // TODO: use Phase.DEPENDENCIES_CASSANDRA_DRIVER
            processorTarget.addDeploymentProcessor(CassandraDriverExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, DEPENDENCIES_CASSANDRA_DRIVER, DriverDependencyProcessor.getInstance());
        }
    }, OperationContext.Stage.RUNTIME);

    startCassandraDriverSubsysteService(context);
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:18,代碼來源:CassandraDriverSubsystemAdd.java

示例9: setup

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "neo4j");
    address.add("neo4j", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("org.neo4j.driver:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:17,代碼來源:CustomModuleTestCase.java

示例10: setup

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "orientdb");
    address.add("orient", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("com.orientechnologies:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:17,代碼來源:CustomModuleTestCase.java

示例11: setup

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "cassandra");
    address.add("cassandra", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("com.datastax.cassandra.driver-core:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:17,代碼來源:CustomModuleTestCase.java

示例12: setup

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
@Override
public final void setup(final ManagementClient managementClient, final String containerId) throws Exception {
    setManagementClient(managementClient);
    ModelNode address = new ModelNode();
    address.add("subsystem", "mongodb");
    address.add("mongo", "default");
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).set(address);
    operation.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("module");
    operation.get(VALUE).set("org.mongodb.driver:test");
    ModelNode result = executeOperation(operation);
    reload();
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:17,代碼來源:CustomModuleTestCase.java

示例13: performBoottime

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model) throws
        OperationFailedException {

    runtimeValidator.validate(operation.resolve());
    context.addStep(new AbstractDeploymentChainStep() {
        protected void execute(DeploymentProcessorTarget processorTarget) {
            final int PARSE_MONGO_DRIVER                          = 0x4C03;
            final int DEPENDENCIES_MONGO_DRIVER                   = 0x1F13;
            // TODO: use Phase.PARSE_MONGO_DRIVER
            processorTarget.addDeploymentProcessor(MongoDriverExtension.SUBSYSTEM_NAME, Phase.PARSE, PARSE_MONGO_DRIVER, new DriverScanDependencyProcessor("mongodbsubsystem"));
            // TODO: use Phase.DEPENDENCIES_MONGO_DRIVER
            processorTarget.addDeploymentProcessor(MongoDriverExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, DEPENDENCIES_MONGO_DRIVER, DriverDependencyProcessor.getInstance());
        }
    }, OperationContext.Stage.RUNTIME);

    startMongoDriverSubsysteService(context);
}
 
開發者ID:wildfly,項目名稱:wildfly-nosql,代碼行數:18,代碼來源:MongoDriverSubsystemAdd.java

示例14: tearDown

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
@Override
public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
    ModelNode[] steps = new ModelNode[5];
    steps[0] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_UNDERTOW_HTTPS_LISTENER, ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION);
    steps[0].get(ModelDescriptionConstants.NAME).set("verify-client");

    steps[1] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_SECURITY_SECURITY_DOMAIN_CLIENT_CERT, ModelDescriptionConstants.REMOVE);

    steps[2] = DMRUtils.createOpNode(ADDRESS_SUBSYSTEM_SECURITY_SECURITY_DOMAIN_CERTIFICATE_TRUST_DOMAIN, ModelDescriptionConstants.REMOVE);

    steps[3] = DMRUtils.createOpNode(ADDRESS_SYSTEM_PROPERTY_TRUST_STORE, ModelDescriptionConstants.REMOVE);
    steps[4] = DMRUtils.createOpNode(ADDRESS_SYSTEM_PROPERTY_TRUST_STORE_PASSWORD, ModelDescriptionConstants.REMOVE);

    ModelNode compositeNode = DMRUtils.createCompositeNode(steps);
    managementClient.getControllerClient().execute(compositeNode);

    UserManager.removeApplicationUser(APPLICATION_USER);
    UserManager.revokeRoleFromApplicationUser(APPLICATION_USER, APPLICATION_ROLE);
}
 
開發者ID:wildfly-extras,項目名稱:wildfly-camel-examples,代碼行數:20,代碼來源:CxfWsCdiSecureExampleTest.java

示例15: executeReload

import org.jboss.dmr.ModelNode; //導入依賴的package包/類
private static void executeReload(ModelControllerClient client, boolean adminOnly) {
    ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).setEmptyList();
    operation.get(OP).set("reload");
    operation.get("admin-only").set(adminOnly);
    try {
        ModelNode result = client.execute(operation);
        if (!"success".equals(result.get(ClientConstants.OUTCOME).asString())) {
            fail("Reload operation didn't finished successfully: " + result.asString());
        }
    } catch(IOException e) {
        final Throwable cause = e.getCause();
        if (!(cause instanceof ExecutionException) && !(cause instanceof CancellationException)) {
            throw new RuntimeException(e);
        } // else ignore, this might happen if the channel gets closed before we got the response
    }
}
 
開發者ID:wildfly-extras,項目名稱:wildfly-camel-examples,代碼行數:18,代碼來源:ServerReload.java


注:本文中的org.jboss.dmr.ModelNode類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。