Package org.jppf.client
Class AbstractJPPFClient
java.lang.Object
org.jppf.client.AbstractJPPFClient
- All Implemented Interfaces:
AutoCloseable,EventListener,ClientConnectionStatusListener
- Direct Known Subclasses:
AbstractGenericClient
public abstract class AbstractJPPFClient
extends Object
implements ClientConnectionStatusListener, AutoCloseable
This class provides an API to submit execution requests and administration commands,
and request server information data.
It has its own unique identifier, used by the nodes, to determine whether classes from the submitting application should be dynamically reloaded or not, depending on whether the uuid has changed or not.
It has its own unique identifier, used by the nodes, to determine whether classes from the submitting application should be dynamically reloaded or not, depending on whether the uuid has changed or not.
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.jppf.utils.TypedPropertiesThe JPPF configuration properties.protected static StringName of the SerializationHelper implementation class for the JCA connector. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractJPPFClient(String uuid) Initialize this client with a specified application UUID. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener to the list of listeners to this client.voidclose()Close this client and release all the resources it is using.findConnectionPool(int poolId) Find the connection pool with the specified id.findConnectionPool(int priority, int poolId) Find the connection pool with the specified priority and id.findConnectionPool(String name) Find the connection pool with the specified id.findConnectionPools(String pattern) Find the connection pools whose name matches the specifiedregular expression.Find the connection pools that pass the specified filter.findConnectionPools(JPPFClientConnectionStatus... statuses) Find the connection pools that have a least one connection matching one of the specified statuses.intGet count of all client connections handled by this JPPFClient.getClientConnection(int priority, JPPFClientConnectionStatus... statuses) Get a connection with the specified priority that matches one of the specified statuses.org.jppf.utils.TypedPropertiesGet JPPF configuration properties.Get a pool with at least oneactiveconnection and with the highest possible priority.Get a list of existing connection pools, ordered by descending priority.getConnectionPools(int priority) Get a set of existing connection pools with the specified priority.Get a list of all priorities for the currently existing pools, ordered by descending priority.protected StringGet the name of the serialization helper implementation class name to use.getUuid()Get the unique universal identifier for this JPPF client.booleanisClosed()Determine whether this JPPF client is closed.booleanDetermine whether this client is resetting.voidRemove a listener from the list of listeners to this client.voidInvoked when the status of a client connection has changed.
-
Field Details
-
JCA_SERIALIZATION_HELPER
Name of the SerializationHelper implementation class for the JCA connector. -
config
protected org.jppf.utils.TypedProperties configThe JPPF configuration properties.
-
-
Constructor Details
-
AbstractJPPFClient
Initialize this client with a specified application UUID.- Parameters:
uuid- the unique identifier for this local client.
-
-
Method Details
-
getConfig
public org.jppf.utils.TypedProperties getConfig()Get JPPF configuration properties. These properties are unmodifiable.- Returns:
TypedPropertiesinstance. With JPPF configuration.
-
getAllConnectionsCount
public int getAllConnectionsCount()Get count of all client connections handled by this JPPFClient.- Returns:
- count of
JPPFClientConnectioninstances.
-
getClientConnection
public JPPFClientConnection getClientConnection(int priority, JPPFClientConnectionStatus... statuses) Get a connection with the specified priority that matches one of the specified statuses.- Parameters:
priority- the priority of the connetion to find.statuses- a set of statuses, one of which must match the status of the connection to find.- Returns:
- a
JPPFClientConnectionthat matches one of the specified statuses, ornullif none could be found. - Since:
- 4.2
-
statusChanged
Invoked when the status of a client connection has changed.- Specified by:
statusChangedin interfaceClientConnectionStatusListener- Parameters:
event- the event to notify of.
-
close
public void close()Close this client and release all the resources it is using.- Specified by:
closein interfaceAutoCloseable
-
addConnectionPoolListener
Add a listener to the list of listeners to this client.- Parameters:
listener- the listener to add.
-
removeConnectionPoolListener
Remove a listener from the list of listeners to this client.- Parameters:
listener- the listener to remove.
-
getUuid
Get the unique universal identifier for this JPPF client.- Returns:
- the uuid as a string.
-
isClosed
public boolean isClosed()Determine whether this JPPF client is closed.- Returns:
trueif this client is closed,falseotherwise.
-
getSerializationHelperClassName
Get the name of the serialization helper implementation class name to use.- Returns:
- the fully qualified class name of a
SerializationHelperimplementation.
-
findConnectionPool
Find the connection pool with the specified priority and id.- Parameters:
priority- the priority of the pool, helps speedup the search.poolId- the id of the pool to find.- Returns:
- a
JPPFConnectionPoolinstance, ornullif no pool witht he specified id could be found. - Since:
- 4.1
-
findConnectionPool
Find the connection pool with the specified id.- Parameters:
poolId- the id of the pool to find.- Returns:
- a
JPPFConnectionPoolinstance, ornullif no pool with the specified id could be found. - Since:
- 4.1
-
findConnectionPool
Find the connection pool with the specified id.- Parameters:
name- the name of the pool to find.- Returns:
- a
JPPFConnectionPoolinstance, ornullif no pool with the specified name could be found. - Since:
- 4.1
-
findConnectionPools
Find the connection pools that have a least one connection matching one of the specified statuses.- Parameters:
statuses- a set of statuses of which at least one must be matched by at least one connection in any of the returned pools.- Returns:
- a list of
JPPFConnectionPoolinstances, possibly empty if none were found matching the specified statuses. The pools in the list are ordered by descending priority. - Since:
- 4.2
-
findConnectionPools
public List<JPPFConnectionPool> findConnectionPools(ConnectionPoolFilter<JPPFConnectionPool> filter) Find the connection pools that pass the specified filter.- Parameters:
filter- an implementation of theConnectionPoolFilterinterface. Anullvalue is interpreted as no filter (all pools are accepted).- Returns:
- a list of
JPPFConnectionPoolinstances, possibly empty if none passed the specified filter. The pools in the list are ordered by descending priority. - Since:
- 4.2
-
findConnectionPools
Find the connection pools whose name matches the specifiedregular expression.- Parameters:
pattern- the regular expression to match against.- Returns:
- a list of
JPPFConnectionPoolinstances whose name match the input pattern, possibly empty but nevernull. - Since:
- 4.2
-
getConnectionPool
Get a pool with at least oneactiveconnection and with the highest possible priority.- Returns:
- a
JPPFConnectionPoolinstance, ornullif no pool was found with an active connection. - Since:
- 4.2
-
getConnectionPools
Get a set of existing connection pools with the specified priority.- Parameters:
priority- the priority of the pool, helps speedup the search.- Returns:
- a list of
JPPFConnectionPoolinstances, possibly empty but nevernull. - Since:
- 4.1
-
getPoolPriorities
Get a list of all priorities for the currently existing pools, ordered by descending priority.- Returns:
- a list of integers represent the priorities, possibly empty but never
null. - Since:
- 4.1
-
getConnectionPools
Get a list of existing connection pools, ordered by descending priority.- Returns:
- a list of
JPPFConnectionPoolinstances, possibly empty but nevernull. - Since:
- 4.1
-
isResetting
public boolean isResetting()Determine whether this client is resetting.- Returns:
trueif this client is resetting,falseotherwise.
-