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


Java ClientConfigurationImpl类代码示例

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


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

示例1: createControllerClient

import org.jboss.as.controller.client.impl.ClientConfigurationImpl; //导入依赖的package包/类
/**
 * Creates the controller client.
 * 
 * @param controllerClientConfig the controller client configuration
 * @return the model controller client
 * @throws ControllerOperationException the controller operation exception
 */
private ModelControllerClient createControllerClient(final ControllerClientConfig controllerClientConfig)
        throws ControllerOperationException {
    ModelControllerClient controllerClient = null;
    try {
        final CallbackHandler authCallbackHandler = getAuthCallbackHandler(controllerClientConfig);
        final ModelControllerClientConfiguration controllerConfig = ClientConfigurationImpl.create(
                controllerClientConfig.getHost(), controllerClientConfig.getPort(), authCallbackHandler,
                controllerClientConfig.getSaslOptions());
        controllerClient = ModelControllerClient.Factory.create(controllerConfig);
    } catch (UnknownHostException uhe) {
        throw new ControllerOperationException(
                "Tried establishing connection with JBoss controller process. Unable to connect to host: "
                        + controllerClientConfig.getHost() + " at port " + controllerClientConfig.getPort(), uhe);
    }
    return controllerClient;
}
 
开发者ID:techblue,项目名称:jboss-controller-operation-executor,代码行数:24,代码来源:JBoss7ControllerOpeartionExecutor.java

示例2: main

import org.jboss.as.controller.client.impl.ClientConfigurationImpl; //导入依赖的package包/类
public static void main(String[] args) throws Throwable {
    if (args == null || args.length == 0) {
        String app_base = System.getenv("APP_BASE");
        if (app_base == null) {
            throw new IllegalArgumentException("Missing arguments and no $APP_BASE exported!");
        }
        args = new String[1];
        args[0] = app_base;
    }

    File rootDir = new File(args[0]);
    File mavenDir = new File(rootDir, "maven");
    if (!mavenDir.exists()) {
        System.out.println(String.format("No maven dir [%s], nothing to deploy.", mavenDir));
        return;
    }

    String protocol = findArg(args, "wildfly.protocol", "http-remoting");
    String address = findArg(args, "wildfly.address", "127.0.0.1");
    int port = Integer.parseInt(findArg(args, "wildfly.port", System.getenv("MANAGEMENT_PORT")));

    String username = findArg(args, "wildfly.username", null);
    String password = findArg(args, "wildfly.password", null);

    int sleep = Integer.parseInt(findArg(args, "sleep", "3000"));
    Thread.sleep(sleep); // lets wait for WF to boot up

    int timeout = Integer.parseInt(findArg(args, "timeout", String.valueOf(60 * 1000)));

    ModelControllerClient client = null;
    try {
        ModelControllerClientConfiguration configuration;
        if (username != null && password != null) {
            System.out.println(String.format("Connecting with %s/%s", username, password));
            configuration = ClientConfigurationImpl.create(protocol, address, port, new SimpleCallbackHandler(username, password), null, timeout);
        } else {
            System.out.println("No auth used.");
            configuration = ClientConfigurationImpl.create(protocol, address, port, null, null, timeout);
        }
        client = ModelControllerClient.Factory.create(configuration);
        ServerDeploymentManager deploymentManager = ServerDeploymentManager.Factory.create(client);

        File[] files = mavenDir.listFiles();
        if (files != null) {
            for (File file : files) {
                try (InputStream fs = new FileInputStream(file)) {
                    deploy(deploymentManager, file.getName(), fs);
                }
            }
        }
    } finally {
        if (client != null) {
            client.close();
        }
    }
}
 
开发者ID:fabric8io,项目名称:jube,代码行数:57,代码来源:Deployer.java

示例3: build

import org.jboss.as.controller.client.impl.ClientConfigurationImpl; //导入依赖的package包/类
/**
 * Builds the configuration object based on this builder's settings.
 *
 * @return the configuration
 */
public ModelControllerClientConfiguration build() {
   return new ClientConfigurationImpl(hostName, port, handler, saslOptions, sslContextFactory,
           Factory.createDefaultExecutor(), true, connectionTimeout, protocol, clientBindAddress, authConfigUri);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:10,代码来源:ModelControllerClientConfiguration.java


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