Package org.jppf.node
Class AbstractNode
java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.node.AbstractNode
- All Implemented Interfaces:
Runnable,org.jppf.node.Node,NodeInternal
- Direct Known Subclasses:
AbstractCommonNode
public abstract class AbstractNode
extends org.jppf.utils.concurrent.ThreadSynchronization
implements NodeInternal
Abstract implementation of the
Node interface.- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.jppf.utils.TypedPropertiesThe configuration of this node.protected org.jppf.serialization.SerializationHelperUtility for deserialization and serialization.protected final org.jppf.utils.hooks.HookFactoryTo create and invoke hook instances.protected booleanDetermines whether JMX management and monitoring is enabled for this node.protected org.jppf.management.JMXServerThe jmx server that handles administration and monitoring functions for this node.protected LifeCycleEventHandlerHandles the firing of node life cycle events and the listeners that subscribe to these events.protected NodeConnection<?>Get the connection used by this node.protected NodeIOThe object responsible for this node's I/O.protected org.jppf.serialization.ObjectSerializerUtility for deserialization and serialization.protected org.jppf.management.JPPFSystemInformationThis node's system information.protected final StringThis node's universal identifier.Fields inherited from class org.jppf.utils.concurrent.ThreadSynchronization
stopped -
Constructor Summary
ConstructorsConstructorDescriptionAbstractNode(String uuid, org.jppf.utils.TypedProperties configuration, org.jppf.utils.hooks.HookFactory hookFactory) Initialize this node. -
Method Summary
Modifier and TypeMethodDescriptionorg.jppf.utils.TypedPropertiesintorg.jppf.serialization.SerializationHelperGet the utility for deserialization and serialization.org.jppf.utils.hooks.HookFactoryGet the factory that creates and invoke hook instances for this node.org.jppf.management.JMXServerGet the JMX connector server associated with the node.Get the object that manages the node life cycle events.org.jppf.management.JPPFManagementInfoGet the connection used by this node.Determine whether this node is currently shutting down.org.jppf.management.JPPFSystemInformationgetUuid()protected booleanDetermines whether JMX management and monitoring is enabled for this node.booleanbooleanresetTaskClassLoader(Object... params) This implementation does nothing.voidsetExecutedTaskCount(int taskCount) Set the total number of tasks executed.voidsetJPPFClassLoader(AbstractJPPFClassLoader jppfClassLoader) protected voidUpdate the current system information.Methods inherited from class org.jppf.utils.concurrent.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUpMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.node.Node
isAndroid, isDotnetCapable, isLocal, isOfflineMethods inherited from interface org.jppf.node.NodeInternal
closeDataChannel, getClassLoaderManager, getExecutionManager, getNodeConfigNotifier, initDataChannel, stopNode
-
Field Details
-
helper
protected org.jppf.serialization.SerializationHelper helperUtility for deserialization and serialization. -
serializer
protected org.jppf.serialization.ObjectSerializer serializerUtility for deserialization and serialization. -
uuid
This node's universal identifier. -
systemInformation
protected org.jppf.management.JPPFSystemInformation systemInformationThis node's system information. -
nodeConnection
Get the connection used by this node. -
nodeIO
The object responsible for this node's I/O. -
configuration
protected final org.jppf.utils.TypedProperties configurationThe configuration of this node. -
jmxEnabled
protected boolean jmxEnabledDetermines whether JMX management and monitoring is enabled for this node. -
lifeCycleEventHandler
Handles the firing of node life cycle events and the listeners that subscribe to these events. -
jmxServer
protected org.jppf.management.JMXServer jmxServerThe jmx server that handles administration and monitoring functions for this node. -
hookFactory
protected final org.jppf.utils.hooks.HookFactory hookFactoryTo create and invoke hook instances.
-
-
Constructor Details
-
AbstractNode
public AbstractNode(String uuid, org.jppf.utils.TypedProperties configuration, org.jppf.utils.hooks.HookFactory hookFactory) Initialize this node.- Parameters:
uuid- this node's uuid.configuration- the configuration of this node.hookFactory- used to create and invoke hook instances.
-
-
Method Details
-
getNodeConnection
Get the connection used by this node.- Specified by:
getNodeConnectionin interfaceNodeInternal- Returns:
- a
NodeConnectioninstance.
-
getExecutedTaskCount
public int getExecutedTaskCount()- Specified by:
getExecutedTaskCountin interfaceorg.jppf.node.Node
-
setExecutedTaskCount
public void setExecutedTaskCount(int taskCount) Set the total number of tasks executed.- Parameters:
taskCount- the number of tasks as an int.
-
getHelper
public org.jppf.serialization.SerializationHelper getHelper()Get the utility for deserialization and serialization.- Returns:
- a
SerializationHelperinstance.
-
getJmxServer
Get the JMX connector server associated with the node.The default implementation throws a
JPPFUnsupportedOperationException. It is up to concrete implementations to override it.This implementation throws a
JPPFUnsupportedOperationException. It is up to subclasses to implement it.- Specified by:
getJmxServerin interfaceNodeInternal- Returns:
- a JMXServer instance.
- Throws:
Exception- if any error occurs.
-
getUuid
- Specified by:
getUuidin interfaceorg.jppf.node.Node
-
updateSystemInformation
protected void updateSystemInformation()Update the current system information. -
getSystemInformation
public org.jppf.management.JPPFSystemInformation getSystemInformation()- Specified by:
getSystemInformationin interfaceorg.jppf.node.Node
-
resetTaskClassLoader
This implementation does nothing.- Specified by:
resetTaskClassLoaderin interfaceorg.jppf.node.Node- Parameters:
params- not used.- Returns:
null.
-
getShuttingDown
Determine whether this node is currently shutting down.- Returns:
- an
AtomicBooleaninstance whose value istrue</code> if the node is shutting down, <code>falseotherwise.
-
getJPPFClassLoader
- Returns:
- the main node class loader.
-
setJPPFClassLoader
- Parameters:
jppfClassLoader- the main node class loader.
-
getManagementInfo
public org.jppf.management.JPPFManagementInfo getManagementInfo()- Specified by:
getManagementInfoin interfaceorg.jppf.node.Node
-
getConfiguration
public org.jppf.utils.TypedProperties getConfiguration()- Specified by:
getConfigurationin interfaceorg.jppf.node.Node
-
isJmxEnabled
protected boolean isJmxEnabled()Determines whether JMX management and monitoring is enabled for this node.- Returns:
- true if JMX is enabled, false otherwise.
-
getLifeCycleEventHandler
Description copied from interface:NodeInternalGet the object that manages the node life cycle events.- Specified by:
getLifeCycleEventHandlerin interfaceNodeInternal- Returns:
- a
LifeCycleEventHandlerinstance.
-
isMasterNode
public boolean isMasterNode()- Specified by:
isMasterNodein interfaceorg.jppf.node.Node
-
isSlaveNode
public boolean isSlaveNode()- Specified by:
isSlaveNodein interfaceorg.jppf.node.Node
-
getMasterNodeUuid
- Specified by:
getMasterNodeUuidin interfaceorg.jppf.node.Node
-
getNodeIO
- Returns:
- the object responsible for this node's I/O.
-
getHookFactory
public org.jppf.utils.hooks.HookFactory getHookFactory()Get the factory that creates and invoke hook instances for this node.- Returns:
- a
HookFactoryinstance.
-