public class ASConnection extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
HTTP_SCHEME |
static String |
HTTPS_SCHEME |
static String |
MANAGEMENT
Deprecated.
as of 4.7. Use
MANAGEMENT_URI constant instead |
static String |
MANAGEMENT_URI |
static boolean |
verbose |
| Constructor and Description |
|---|
ASConnection(ASConnectionParams params) |
ASConnection(String host,
int port,
String user,
String password)
Deprecated.
as of RHQ 4.10, use
ASConnection(ASConnectionParams) instead |
ASConnection(String host,
int port,
String user,
String password,
Long managementConnectionTimeout)
Deprecated.
as of RHQ 4.10, use
ASConnection(ASConnectionParams) instead |
| Modifier and Type | Method and Description |
|---|---|
Result |
execute(Operation op)
Execute the passed Operation and return its Result.
|
Result |
execute(Operation op,
boolean isComplex)
Execute the passed Operation and return its Result.
|
Result |
execute(Operation op,
boolean isComplex,
int timeoutSec)
Execute the passed Operation and return its Result.
|
Result |
execute(Operation op,
int timeoutSec)
Execute the passed Operation and return its Result.
|
ComplexResult |
executeComplex(Operation op)
Execute the passed Operation and return its ComplexResult.
|
ComplexResult |
executeComplex(Operation op,
int timeoutSec)
Execute the passed Operation and return its ComplexResult.
|
org.codehaus.jackson.JsonNode |
executeRaw(Operation operation)
Execute an operation against the domain api.
|
org.codehaus.jackson.JsonNode |
executeRaw(Operation operation,
int timeoutSec)
Execute an operation against the domain api.
|
ASConnectionParams |
getAsConnectionParams() |
String |
getHost()
Deprecated.
as of RHQ 4.10, use
getAsConnectionParams() instead |
String |
getPassword()
Deprecated.
as of RHQ 4.10, use
getAsConnectionParams() instead |
int |
getPort()
Deprecated.
as of RHQ 4.10, use
getAsConnectionParams() instead |
String |
getUser()
Deprecated.
as of RHQ 4.10, use
getAsConnectionParams() instead |
static ASConnection |
newInstanceForServerPluginConfiguration(ServerPluginConfiguration serverPluginConfig)
Deprecated.
as of RHQ 4.10, use
ASConnection(ASConnectionParams) instead |
void |
shutdown() |
static void |
shutdownConnectionCleaner()
Called from
PluginLifecycleListener to shutdown the thread pool
for cleaning out the stale connections. |
public static final String HTTP_SCHEME
public static final String HTTPS_SCHEME
public static final String MANAGEMENT_URI
public static boolean verbose
@Deprecated public static final String MANAGEMENT
MANAGEMENT_URI constant instead@Deprecated public ASConnection(String host, int port, String user, String password)
ASConnection(ASConnectionParams) instead@Deprecated public ASConnection(String host, int port, String user, String password, Long managementConnectionTimeout)
ASConnection(ASConnectionParams) insteadpublic ASConnection(ASConnectionParams params)
public static void shutdownConnectionCleaner()
PluginLifecycleListener to shutdown the thread pool
for cleaning out the stale connections.
This is needed so that the thread(s) in the pool don't leak the current plugin class loader across the plugin
container restarts. The plugin classloader is the threads' context class loader and the threads live until
JVM exits (unless the thread pool is explicitly shut down). Because all the plugin classes are reloaded on
plugin container restart, the thread pool is created anew, leaving the threads from the old thread pool running
and still referencing the previous plugin class loader.
This then leads to a wonderful sneaky memory leak leading to eventual OOMEs due to depleted perm gen (which
has to keep references to all the classes from all the plugin container "runs").
Therefore we need to make sure to shut down the thread pool explicitly when it is no longer needed (which is at
the plugin container shutdown).@Deprecated public static ASConnection newInstanceForServerPluginConfiguration(ServerPluginConfiguration serverPluginConfig)
ASConnection(ASConnectionParams) insteadpublic void shutdown()
public org.codehaus.jackson.JsonNode executeRaw(Operation operation)
operation - an Operation that should be run on the domain controllerexecute(org.rhq.modules.plugins.jbossas7.json.Operation),
execute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean),
executeComplex(org.rhq.modules.plugins.jbossas7.json.Operation)public org.codehaus.jackson.JsonNode executeRaw(Operation operation, int timeoutSec)
execute(Operation).operation - an Operation that should be run on the domain controllertimeoutSec - Timeout on connect and read in secondsexecute(org.rhq.modules.plugins.jbossas7.json.Operation),
execute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean),
executeComplex(org.rhq.modules.plugins.jbossas7.json.Operation)public Result execute(Operation op)
op - Operation to executeexecute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean)public Result execute(Operation op, int timeoutSec)
op - Operation to executetimeoutSec - Timeout to wait in seconds. Default is 10 secexecute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean)public ComplexResult executeComplex(Operation op)
op - Operation to executeexecute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean)public ComplexResult executeComplex(Operation op, int timeoutSec)
op - Operation to executetimeoutSec - Timeout to wait in seconds. Default is 10 secexecute(org.rhq.modules.plugins.jbossas7.json.Operation, boolean)public Result execute(Operation op, boolean isComplex)
op - Operation to executeisComplex - should a complex result be returned?public Result execute(Operation op, boolean isComplex, int timeoutSec)
op - Operation to executeisComplex - should a complex result be returned?timeoutSec - @Deprecated public String getHost()
getAsConnectionParams() instead@Deprecated public int getPort()
getAsConnectionParams() instead@Deprecated public String getUser()
getAsConnectionParams() instead@Deprecated public String getPassword()
getAsConnectionParams() insteadpublic ASConnectionParams getAsConnectionParams()
Copyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.