|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.ThreadSynchronization
org.jppf.comm.recovery.AbstractRecoveryConnection
public abstract class AbstractRecoveryConnection
Common abstract super class for a connection dedicated to receovery from hardware fialure of a remote peer.
| Field Summary | |
|---|---|
protected boolean |
initialized
Determines whether the initial handshake has been performed. |
protected int |
maxRetries
Maximum number of failed write/read attempts on a connection before the remote peer is considered dead. |
protected boolean |
ok
Determines whether this connection is ok after is has been checked. |
protected int |
socketReadTimeout
Maximum wait time on a response from the remote peer. |
protected SocketWrapper |
socketWrapper
Connection to a client. |
protected String |
uuid
The JPPF node or client uuid. |
| Fields inherited from class org.jppf.utils.ThreadSynchronization |
|---|
stopped |
| Constructor Summary | |
|---|---|
AbstractRecoveryConnection()
|
|
| Method Summary | |
|---|---|
abstract void |
close()
Close this client and release any resources it is using. |
String |
getUuid()
Get the uuid of the remote peer. |
boolean |
isInitialized()
Determine whether the initial handshake has been performed. |
boolean |
isOk()
Determine whether this connection is ok after is has been checked. |
protected String |
receiveMessage()
Read a message form the remote peer. |
protected String |
receiveMessage(int maxRetries,
int socketReadTimeout)
Read a message from the remote peer. |
void |
sendMessage(String message)
Send a message to the remote peer. |
void |
setInitialized(boolean initialized)
Specify whether the initial handshake has been performed. |
void |
setOk(boolean ok)
Specifiy whether this connection is ok after is has been checked. |
| Methods inherited from class org.jppf.utils.ThreadSynchronization |
|---|
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Field Detail |
|---|
protected SocketWrapper socketWrapper
protected int maxRetries
protected int socketReadTimeout
protected String uuid
protected boolean ok
protected boolean initialized
| Constructor Detail |
|---|
public AbstractRecoveryConnection()
| Method Detail |
|---|
protected String receiveMessage()
throws Exception
socketReadTimeout specified
in the configuration. If the timeout expires maxRetries times in a row, the connection
is also considered broken.
Exception - if any error occurs.
protected String receiveMessage(int maxRetries,
int socketReadTimeout)
throws Exception
socketReadTimeout specified
in the configuration. If the timeout expires maxRetries times in a row, the connection
is also considered broken.
maxRetries - maximum number of attempts to read a response form the rmeote peer.socketReadTimeout - timeout for each attempt.
Exception - if any error occurs.
public void sendMessage(String message)
throws Exception
message - the message to send.
Exception - if any error occurs while sending the message.public abstract void close()
public String getUuid()
public boolean isOk()
public void setOk(boolean ok)
ok - true if the connection is ok, false otherwise.public boolean isInitialized()
true if the initial handshake was done, false otherwise.public void setInitialized(boolean initialized)
initialized - true if the initial handshake was done, false otherwise.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||