Tabnine Logo
ManagementClient
Code IndexAdd Tabnine to your IDE (free)

How to use
ManagementClient
in
org.jboss.as.arquillian.container

Best Java code snippets using org.jboss.as.arquillian.container.ManagementClient (Showing top 20 results out of 315)

origin: org.wildfly/wildfly-testsuite-shared

  @Override
  protected ModelControllerClient getModelControllerClient() {
    return managementClient.getControllerClient();
  }
}
origin: org.wildfly.arquillian/wildfly-arquillian-common

/**
 * Resets the client. {@linkplain #close() Closes} open resources and resets flags so that the client itself can be
 * reinitialized later if desired.
 */
void reset() {
  close();
  initialized = false;
  closed = false;
}
origin: org.wildfly.arquillian/wildfly-arquillian-common

private ModelNode executeForResult(final ModelNode operation) throws Exception {
  checkState();
  final ModelNode result = client.execute(operation);
  checkSuccessful(result, operation);
  return result.get(RESULT);
}
origin: org.wildfly/wildfly-testsuite-shared

public static void executeReloadAndWaitForCompletion(ManagementClient managementClient) {
  executeReloadAndWaitForCompletion(managementClient.getControllerClient(), TIMEOUT, false, managementClient.getMgmtAddress(), managementClient.getMgmtPort());
}
origin: org.jboss.as/jboss-as-arquillian-common

public ProtocolMetaData getProtocolMetaData(String deploymentName) {
  URI webURI = getWebUri();
  ProtocolMetaData metaData = new ProtocolMetaData();
  metaData.addContext(new JMXContext(getConnection()));
  HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
  metaData.addContext(context);
  try {
    ModelNode deploymentNode = readResource(createDeploymentAddress(deploymentName));
    if (isWebArchive(deploymentName)) {
      extractWebArchiveContexts(context, deploymentNode);
    } else if (isEnterpriseArchive(deploymentName)) {
      extractEnterpriseArchiveContexts(context, deploymentNode);
    }
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return metaData;
}
origin: org.wildfly.arquillian/wildfly-arquillian-common

/**
 * Gets the meta-data.
 *
 * @return the meta-data
 *
 * @throws IllegalStateException if this has been {@linkplain #close() closed}
 */
public ProtocolMetaData getProtocolMetaData(String deploymentName) {
  init();
  ProtocolMetaData metaData = new ProtocolMetaData();
  metaData.addContext(new JMXContext(getConnection()));
  if (undertowSubsystemPresent) {
    URI webURI = getWebUri();
    HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
    metaData.addContext(context);
    try {
      final ModelNode deploymentNode = readDeploymentNode(deploymentName);
      if (isWebArchive(deploymentName)) {
        extractWebArchiveContexts(context, deploymentNode);
      } else if (isEnterpriseArchive(deploymentName)) {
        extractEnterpriseArchiveContexts(context, deploymentNode);
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  return metaData;
}
origin: org.jboss.as/jboss-as-arquillian-protocol-jmx

    port,
    getCallbackHandler());
current = new ManagementClient(modelControllerClient, address, port);
origin: org.wildfly/wildfly-arquillian-common

private void extractEnterpriseArchiveContexts(HTTPContext context, ModelNode deploymentNode) {
  if (deploymentNode.hasDefined(SUBDEPLOYMENT)) {
    for (ModelNode subdeployment : deploymentNode.get(SUBDEPLOYMENT).asList()) {
      String deploymentName = subdeployment.keys().iterator().next();
      if (isWebArchive(deploymentName)) {
        extractWebArchiveContexts(context, deploymentName, subdeployment.get(deploymentName));
      }
    }
  }
}
origin: org.wildfly.arquillian/wildfly-arquillian-common

sbgOp.get(OP).set(READ_CHILDREN_NAMES_OPERATION);
sbgOp.get(CHILD_TYPE).set("socket-binding-group");
final ModelNode socketBindingGroups = executeForResult(sbgOp);
final String socketBindingGroupName = socketBindingGroups.asList().get(0).asString();
final ModelNode operation = new ModelNode();
operation.get(OP).set(READ_RESOURCE_OPERATION);
operation.get("include-runtime").set(true);
ModelNode binding = executeForResult(operation);
if (host == null) {
  host = formatIP(binding.get("bound-address").asString());
  port = defined(binding.get("bound-port"),
      socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
origin: org.wildfly/wildfly-arquillian-common

private URI getBinding(final String protocol, final String socketBinding) {
  try {
    final String socketBindingGroupName = rootNode.get("socket-binding-group").keys().iterator().next();
    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName);
    operation.get(OP_ADDR).get("socket-binding").set(socketBinding);
    operation.get(OP).set(READ_RESOURCE_OPERATION);
    operation.get("include-runtime").set(true);
    ModelNode binding = executeForResult(operation);
    String ip = binding.get("bound-address").asString();
    //it appears some system can return a binding with the zone specifier on the end
    if (ip.contains(":") && ip.contains("%")) {
      ip = ip.split("%")[0];
    }
    final int port = defined(binding.get("bound-port"), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
    return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(ip) + ":" + port);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: org.jboss.as/jboss-as-arquillian-common

private ModelNode executeForResult(final ModelNode operation) throws Exception {
  final ModelNode result = client.execute(operation);
  checkSuccessful(result, operation);
  return result.get(RESULT);
}
origin: org.wildfly/wildfly-arquillian-common

private ModelNode readResource(ModelNode address) throws Exception {
  final ModelNode operation = new ModelNode();
  operation.get(OP).set(READ_RESOURCE_OPERATION);
  operation.get(RECURSIVE).set("true");
  operation.get(OP_ADDR).set(address);
  return executeForResult(operation);
}
origin: org.jboss.as/jboss-as-arquillian-common

private void extractWebArchiveContexts(HTTPContext context, ModelNode deploymentNode) {
  extractWebArchiveContexts(context, deploymentNode.get(NAME).asString(), deploymentNode);
}
origin: org.wildfly/wildfly-arquillian-common

public ProtocolMetaData getProtocolMetaData(String deploymentName) {
  URI webURI = getWebUri();
  ProtocolMetaData metaData = new ProtocolMetaData();
  metaData.addContext(new JMXContext(getConnection()));
  HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
  metaData.addContext(context);
  try {
    ModelNode deploymentNode = readResource(createDeploymentAddress(deploymentName));
    if (isWebArchive(deploymentName)) {
      extractWebArchiveContexts(context, deploymentNode);
    } else if (isEnterpriseArchive(deploymentName)) {
      extractEnterpriseArchiveContexts(context, deploymentNode);
    }
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  return metaData;
}
origin: wildfly/wildfly-arquillian

/**
 * Gets the meta-data.
 *
 * @return the meta-data
 *
 * @throws IllegalStateException if this has been {@linkplain #close() closed}
 */
public ProtocolMetaData getProtocolMetaData(String deploymentName) {
  init();
  ProtocolMetaData metaData = new ProtocolMetaData();
  metaData.addContext(new JMXContext(getConnection()));
  if (undertowSubsystemPresent) {
    URI webURI = getWebUri();
    HTTPContext context = new HTTPContext(webURI.getHost(), webURI.getPort());
    metaData.addContext(context);
    try {
      final ModelNode deploymentNode = readDeploymentNode(deploymentName);
      if (isWebArchive(deploymentName)) {
        extractWebArchiveContexts(context, deploymentNode);
      } else if (isEnterpriseArchive(deploymentName)) {
        extractEnterpriseArchiveContexts(context, deploymentNode);
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
  return metaData;
}
origin: org.wildfly.arquillian/wildfly-arquillian-protocol-jmx

  builder.setAuthenticationConfigUri(URI.create(authenticationConfig));
current = new ManagementClient(ModelControllerClient.Factory.create(builder.build()), address, port, protocol);
origin: org.jboss.as/jboss-as-arquillian-common

private void extractEnterpriseArchiveContexts(HTTPContext context, ModelNode deploymentNode) {
  if (deploymentNode.hasDefined(SUBDEPLOYMENT)) {
    for (ModelNode subdeployment : deploymentNode.get(SUBDEPLOYMENT).asList()) {
      String deploymentName = subdeployment.keys().iterator().next();
      if (isWebArchive(deploymentName)) {
        extractWebArchiveContexts(context, deploymentName, subdeployment.get(deploymentName));
      }
    }
  }
}
origin: wildfly/wildfly-arquillian

sbgOp.get(OP).set(READ_CHILDREN_NAMES_OPERATION);
sbgOp.get(CHILD_TYPE).set("socket-binding-group");
final ModelNode socketBindingGroups = executeForResult(sbgOp);
final String socketBindingGroupName = socketBindingGroups.asList().get(0).asString();
final ModelNode operation = new ModelNode();
operation.get(OP).set(READ_RESOURCE_OPERATION);
operation.get("include-runtime").set(true);
ModelNode binding = executeForResult(operation);
if (host == null) {
  host = formatIP(binding.get("bound-address").asString());
  port = defined(binding.get("bound-port"),
      socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
origin: org.jboss.as/jboss-as-arquillian-common

private URI getBinding(final String protocol, final String socketBinding) {
  try {
    //TODO: resolve socket binding group correctly
    final String socketBindingGroupName = rootNode.get("socket-binding-group").keys().iterator().next();
    final ModelNode operation = new ModelNode();
    operation.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName);
    operation.get(OP_ADDR).get("socket-binding").set(socketBinding);
    operation.get(OP).set(READ_ATTRIBUTE_OPERATION);
    operation.get(NAME).set("bound-address");
    String ip = executeForResult(operation).asString();
    //it appears some system can return a binding with the zone specifier on the end
    if(ip.contains(":") && ip.contains("%")) {
      ip = ip.split("%")[0];
    }
    final ModelNode portOp = new ModelNode();
    portOp.get(OP_ADDR).get("socket-binding-group").set(socketBindingGroupName);
    portOp.get(OP_ADDR).get("socket-binding").set(socketBinding);
    portOp.get(OP).set(READ_ATTRIBUTE_OPERATION);
    portOp.get(NAME).set("bound-port");
    final int port = defined(executeForResult(portOp), socketBindingGroupName + " -> " + socketBinding + " -> bound-port is undefined").asInt();
    return URI.create(protocol + "://" + NetworkUtils.formatPossibleIpv6Address(ip) + ":" + port);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}
origin: org.wildfly/wildfly-arquillian-common

private ModelNode executeForResult(final ModelNode operation) throws Exception {
  final ModelNode result = client.execute(operation);
  checkSuccessful(result, operation);
  return result.get(RESULT);
}
org.jboss.as.arquillian.containerManagementClient

Javadoc

A helper class to join management related operations, like extract sub system ip/port (web/jmx) and deployment introspection.

Instances of this type are not thread-safe.

Most used methods

  • getControllerClient
    Returns the client used to connect to the server.
  • <init>
  • close
  • checkSuccessful
  • defined
  • executeForResult
  • extractEnterpriseArchiveContexts
    Expects the deploymentNode to bit a list of addresses which contain a result of the subsystem model.
  • extractWebArchiveContexts
  • getConnection
  • getProtocolMetaData
    Gets the meta-data.
  • getRemoteEjbURL
    Returns the URI for EJB's.
  • getRemoteJMXURL
  • getRemoteEjbURL,
  • getRemoteJMXURL,
  • getWebUri,
  • isEnterpriseArchive,
  • isWebArchive,
  • toContextName,
  • createDeploymentAddress,
  • getBinding,
  • isServerInRunningState,
  • readResource

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • startActivity (Activity)
  • getSystemService (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Collectors (java.util.stream)
  • JCheckBox (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now