Modifier and Type | Field and Description |
---|---|
(package private) String |
host
Server administration interface host.
|
private static Logger |
LOGGER
Logger instance for this class.
|
(package private) int |
port
Server administration interface port.
|
private StatusResult |
result
Server administration port status check result.
|
protected TaskStateListener[] |
stateListeners
Listeners that want to know about command state.
|
private String |
TASK_NAME
Task name for logging purposes.
|
(package private) int |
timeout
Socked connecting timeout [ms].
|
private String |
TM_SUFFIX
Log message identifier suffix when using message with timestamp.
|
private long |
tmStart
Task start time.
|
Constructor and Description |
---|
AdminPortTask(GlassFishServer server,
int timeout,
TaskStateListener[] stateListeners)
Creates an instance of administration port status check.
|
Modifier and Type | Method and Description |
---|---|
private void |
closeSocket(Socket socket)
Close socket and handle
IOException that could
be thrown. |
(package private) StatusResult |
getResult()
Get last command task execution result.
|
private void |
handleIOException(IOException ioe,
String host,
int port,
String method,
String message)
Handle IO Exception caught in server administration port verification
task.
|
private void |
handleStateChange(TaskState taskState,
TaskEvent taskEvent,
String... args)
Update task state value in
Result object and notify
all registered command execution state listeners about command execution
state change. |
void |
run()
Thread main method to be executed.
|
(package private) String[] |
stateChangeArgs(String exMessage)
Build arguments for operationStateChanged method listening for state
changes.
|
(package private) static String |
tm(long tm)
Format time value in miliseconds to be printed as value in seconds
and miliseconds
s.ms |
private static final Logger LOGGER
private final String TM_SUFFIX
private final String TASK_NAME
String host
int port
int timeout
private StatusResult result
protected TaskStateListener[] stateListeners
private long tmStart
-1
means that start time was not set.AdminPortTask(GlassFishServer server, int timeout, TaskStateListener[] stateListeners)
server
- GlassFish server to be checked.timeout
- Socked connecting timeout.static String tm(long tm)
s.ms.
tm
- Time value in milisecondss.ms.
StatusResult getResult()
String[] stateChangeArgs(String exMessage)
false
display argument to operationStateChanged method
to not display GUI message about this event.
exMessage
- Exception message.private void handleStateChange(TaskState taskState, TaskEvent taskEvent, String... args)
Result
object and notify
all registered command execution state listeners about command execution
state change. This method is not responsible for setting receiveResult
value returned by GlassFish.
This method is used after task is submitted into
ExecutorService
's queue and Result object is initialized.
taskState
- New task execution state.taskEvent
- Event related to execution state change.args
- Additional arguments.private void closeSocket(Socket socket)
IOException
that could
be thrown.
socket
- Socket to be closed.private void handleIOException(IOException ioe, String host, int port, String method, String message)
ioe
- IOException
caught.host
- Server administration host.port
- Server administration port.message
- Message to be logged. Shall not be null
.Copyright © 2013. All Rights Reserved.