Class ManagementClient
- java.lang.Object
-
- org.jboss.as.arquillian.container.ManagementClient
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ManagementClient extends Object implements Closeable
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.
- Author:
- Aslak Knutsen
-
-
Constructor Summary
Constructors Constructor Description ManagementClient(org.jboss.as.controller.client.ModelControllerClient client, String mgmtAddress, int managementPort, String protocol)ManagementClient(org.jboss.as.controller.client.ModelControllerClient client, CommonContainerConfiguration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.jboss.as.controller.client.ModelControllerClientgetControllerClient()Returns the client used to connect to the server.StringgetMgmtAddress()intgetMgmtPort()StringgetMgmtProtocol()org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaDatagetProtocolMetaData(String deploymentName)Gets the meta-data.URIgetRemoteEjbURL()Returns the URI for EJB's.JMXServiceURLgetRemoteJMXURL()URIgetWebUri()booleanisClosed()Checks whether or not the client has been closed.booleanisServerInRunningState()Checks whether or not the server is running.
-
-
-
Constructor Detail
-
ManagementClient
public ManagementClient(org.jboss.as.controller.client.ModelControllerClient client, String mgmtAddress, int managementPort, String protocol)
-
ManagementClient
public ManagementClient(org.jboss.as.controller.client.ModelControllerClient client, CommonContainerConfiguration config)
-
-
Method Detail
-
getControllerClient
public org.jboss.as.controller.client.ModelControllerClient getControllerClient()
Returns the client used to connect to the server.- Returns:
- the client
- Throws:
IllegalStateException- if this has been closed
-
getWebUri
public URI getWebUri()
- Returns:
- The base URI or the web susbsystem. Usually http://localhost:8080
- Throws:
IllegalStateException- if this has been closed
-
getProtocolMetaData
public org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData getProtocolMetaData(String deploymentName)
Gets the meta-data.- Returns:
- the meta-data
- Throws:
IllegalStateException- if this has been closed
-
isServerInRunningState
public boolean isServerInRunningState()
Checks whether or not the server is running.Note that if this client has been closed the state of the server cannot be checked.
- Returns:
trueif the server is running, otherwisefalse- Throws:
IllegalStateException- if this has been closed
-
isClosed
public boolean isClosed()
Checks whether or not the client has been closed.- Returns:
trueif the client has been closed otherwisefalse
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getRemoteJMXURL
public JMXServiceURL getRemoteJMXURL()
-
getMgmtPort
public int getMgmtPort()
-
getMgmtAddress
public String getMgmtAddress()
-
getMgmtProtocol
public String getMgmtProtocol()
-
getRemoteEjbURL
public URI getRemoteEjbURL()
Returns the URI for EJB's.- Returns:
- the resolved EJB URI
- Throws:
IllegalStateException- if this has been closed
-
-