public abstract class RunnerAsadmin extends RunnerJava
Modifier and Type | Field and Description |
---|---|
private String |
asadminJar
Asadmin JAR path (relative under GlassFish home).
|
private static Logger |
LOGGER
Logger instance for this class.
|
private static String |
PASSWORD_FILE_PARAM
Specifies the name, including the full path, of a file that contains
password entries.
|
protected PasswordFile |
passwordFile
Support for
asadmin --passwordfile
file format. |
protected ProcessIOContent |
processIO
Process IO processing.
|
protected ResultString |
result
GlassFish administration command result.
|
protected Reader |
stdErr
Process standard error output.
|
protected Writer |
stdIn
Process standard input.
|
protected Reader |
stdOut
Process standard output.
|
private static String |
USER_PARAM
Specifies the administrator username.
|
command, JAR_PARAM, javaVMExe, PARAM_ASSIGN_VALUE, PARAM_SEPARATOR, QUERY_SEPARATOR
auth, FALSE_VALUE, HTTP_CONNECTION_TIMEOUT, HTTP_RETRY_DELAY, ITEM_SEPARATOR, path, query, retry, server, silentFailureAllowed, stateListeners, TRUE_VALUE
Constructor and Description |
---|
RunnerAsadmin(GlassFishServer server,
Command command,
String query)
Constructs an instance of administration command executor using
command line asadmin interface.
|
Modifier and Type | Method and Description |
---|---|
(package private) String |
buildProcessArgs()
Build process execution arguments.
|
Result |
call()
GlassFish server administration command execution call.
|
protected abstract ProcessIOContent |
createProcessIOContent()
Create internal
ProcessIOContent object corresponding
to command execution IO. |
protected Result |
createResult()
Create
ResultString object corresponding
to String command execution value to be returned. |
(package private) Future<? extends Result> |
execute()
Execute an arbitrary server command.
|
(package private) Future<? extends Result> |
execute(ExecutorService executor)
Execute an arbitrary server command using provided executor.
|
private static String |
extractPath(GlassFishServer server)
Extracts asadmin JAR path from GlassFish server entity object.
|
protected boolean |
processResponse()
Extracts result value from internal storage.
|
protected boolean |
readResponse(InputStream in,
HttpURLConnection hconn)
Reads response from server and stores internally.
|
acceptsGzip, constructCommandUrl, getDoOutput, getJavaSEConfig, getRequestMethod, getServerConfig, handleSend, setJavaEnvironment, setProcessCurrentDir, verifyJavaVM
getCommand, getCommandWithQuery, getContentType, getQuery, getResult, handleReceive, handleSecureConnection, handleStateChange, isSilentFailureAllowed, parallelExecutor, prepareHttpConnection, serializedExecutor, setReadyState, setSilentFailureAllowed, setStateListeners, stateChangeArgs, stateChangeArgs, toBoolean, toString
private static final Logger LOGGER
private static final String USER_PARAM
private static final String PASSWORD_FILE_PARAM
protected ResultString result
ExecutorService
's queue. Method call()
is responsible for correct TaskState
and receiveResult value
handling.private final String asadminJar
protected Writer stdIn
protected Reader stdOut
protected Reader stdErr
protected ProcessIOContent processIO
protected PasswordFile passwordFile
asadmin
--passwordfile
file format.public RunnerAsadmin(GlassFishServer server, Command command, String query)
server
- GlassFish server entity object.command
- GlassFish server administration command entity.query
- Query string for this command.private static String extractPath(GlassFishServer server)
server
- GlassFish server entity object.protected abstract ProcessIOContent createProcessIOContent()
ProcessIOContent
object corresponding
to command execution IO.protected Result createResult()
ResultString
object corresponding
to String
command execution value to be returned.
createResult
in class Runner
String
command execution value to be returned.protected boolean readResponse(InputStream in, HttpURLConnection hconn)
readResponse
in class Runner
in
- Stream to read data from.false
.CommandException
- in case of stream error.protected boolean processResponse()
processResponse
in class Runner
false
.String buildProcessArgs()
Future<? extends Result> execute(ExecutorService executor)
public Result call()
executor's serialization queue.
Attempts to start local GalssFish DAS directly using java
executable.
Copyright © 2013. All Rights Reserved.