|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.ThreadSynchronization
org.jppf.node.AbstractMonitoredNode
public abstract class AbstractMonitoredNode
Abstract implementation of the MonitoredNode interface.
| Field Summary | |
|---|---|
protected AtomicInteger |
executingCount
Holds the count of currently executing tasks. |
protected SerializationHelper |
helper
Utility for deserialization and serialization. |
protected List<NodeListener> |
listeners
The list of listeners that receive notifications from this node. |
protected boolean |
notifying
This flag is true if there is at least one listener, and false otherwise. |
protected ObjectSerializer |
serializer
Utility for deserialization and serialization. |
protected SocketWrapper |
socketClient
Wrapper around the underlying server connection. |
protected SocketInitializer |
socketInitializer
Used to synchronize access to the underlying socket from multiple threads. |
protected String |
uuid
This node's universal identifier. |
| Fields inherited from class org.jppf.utils.ThreadSynchronization |
|---|
stopped |
| Constructor Summary | |
|---|---|
AbstractMonitoredNode()
|
|
| Method Summary | |
|---|---|
void |
addNodeListener(NodeListener listener)
Add a listener to the list of listener for this node. |
void |
decrementExecutingCount()
Decrement the count of currently executing tasks and determine whether an idle notification should be sent. |
void |
fireNodeEvent(int nbTasks)
Create an event for the execution of a specified number of tasks. |
void |
fireNodeEvent(NodeEventType eventType)
Notify all listeners that an event has occurred. |
SerializationHelper |
getHelper()
Get the utility for deserialization and serialization. |
SocketWrapper |
getSocketWrapper()
Get the underlying socket wrapper used by this node. |
int |
getTaskCount()
Get the total number of tasks executed. |
void |
incrementExecutingCount()
Increment the count of currently executing tasks and determine whether a busy notification should be sent. |
boolean |
isNotifying()
Determine whether this node has at least one listener to notify of internal events. |
void |
removeNodeListener(NodeListener listener)
Remove a listener from the list of listener for this node. |
void |
setSocketWrapper(SocketWrapper wrapper)
Get the underlying socket wrapper used by this node. |
void |
setTaskCount(int taskCount)
Set the total number of tasks executed. |
abstract void |
stopNode(boolean closeSocket)
Stop this node and release the resources it is using. |
| 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 SerializationHelper helper
protected ObjectSerializer serializer
protected SocketWrapper socketClient
protected SocketInitializer socketInitializer
protected List<NodeListener> listeners
protected boolean notifying
protected String uuid
protected AtomicInteger executingCount
| Constructor Detail |
|---|
public AbstractMonitoredNode()
| Method Detail |
|---|
public void addNodeListener(NodeListener listener)
addNodeListener in interface MonitoredNodelistener - the listener to add.MonitoredNode.addNodeListener(org.jppf.node.event.NodeListener)public void removeNodeListener(NodeListener listener)
removeNodeListener in interface MonitoredNodelistener - the listener to remove.MonitoredNode.removeNodeListener(org.jppf.node.event.NodeListener)public void fireNodeEvent(NodeEventType eventType)
fireNodeEvent in interface MonitoredNodeeventType - the type of the event as an enumerated value.MonitoredNode.fireNodeEvent(org.jppf.node.event.NodeEventType)public void fireNodeEvent(int nbTasks)
fireNodeEvent in interface MonitoredNodenbTasks - the number of tasks as an int.MonitoredNode.fireNodeEvent(int)public SocketWrapper getSocketWrapper()
getSocketWrapper in interface MonitoredNodeSocketWrapper instance.public void setSocketWrapper(SocketWrapper wrapper)
setSocketWrapper in interface MonitoredNodewrapper - a SocketWrapper instance.public boolean isNotifying()
public abstract void stopNode(boolean closeSocket)
stopNode in interface MonitoredNodecloseSocket - determines whether the underlying socket should be closed.MonitoredNode.stopNode(boolean)public int getTaskCount()
public void setTaskCount(int taskCount)
taskCount - the number of tasks as an int.public SerializationHelper getHelper()
SerializationHelper instance.public void decrementExecutingCount()
public void incrementExecutingCount()
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||