public DeploymentManagerTarget(URI deployURI, String username, String password) {
   ROOT_LOGGER.debugf("new DeploymentManagerTarget: %s", deployURI);
   try {
     URIParser parser = new URIParser(deployURI);
     String serverHost = parser.getParameter("serverHost");
     String serverPort = parser.getParameter("serverPort");
     String host = serverHost != null ? serverHost : "127.0.0.1";
     Integer port = serverPort != null ? Integer.parseInt(serverPort) : 9999;
     if (username != null && password != null) {
       this.modelControllerClient =
           ModelControllerClient.Factory.create(
               host, port, getCallbackHandler(username, password));
     } else {
       this.modelControllerClient = ModelControllerClient.Factory.create(host, port);
     }
     this.deploymentManager = ServerDeploymentManager.Factory.create(modelControllerClient);
     this.deployURI = deployURI;
   } catch (UnknownHostException ex) {
     throw new IllegalArgumentException(MESSAGES.cannotConnectToManagementTarget(deployURI), ex);
   }
 }
Exemplo n.º 2
0
 public RemoteDeployer() throws IOException {
   deploymentManager = ServerDeploymentManager.Factory.create(address, PORT);
 }