Package org.jppf.client.balancer
Class ChannelWrapperLocal
java.lang.Object
org.jppf.client.balancer.ChannelWrapper
org.jppf.client.balancer.ChannelWrapperLocal
- All Implemented Interfaces:
AutoCloseable,ClientConnectionStatusHandler,JPPFClientConnection,org.jppf.execute.ExecutorChannel<ClientTaskBundle>
Context associated with a local channel serving state and tasks submission.
- Author:
- Martin JANDA
-
Field Summary
Fields inherited from class org.jppf.client.balancer.ChannelWrapper
oldStatus -
Constructor Summary
ConstructorsConstructorDescriptionChannelWrapperLocal(JPPFClient client) Default initializer for local channel wrapper. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a connection status listener to this connection's list of listeners.booleancancel(ClientTaskBundle bundle) Cancel the currently executing job, if any.voidclose()Shutdown this connection and release all the resources it is using.protected voidfireStatusChanged(JPPFClientConnectionStatus oldStatus, JPPFClientConnectionStatus newStatus) Notify all listeners that the status of this connection has changed.Get the pool this connection belongs to.Get the unique ID for this connection and its two channels.Get the unique identifier of the remote driver.getHost()Get the driver's host name or ip address.getName()Get the name assigned to this client connection.intgetPort()Get the port number on which the dirver is listeneing for connections.Get the status of this connection.org.jppf.management.JPPFSystemInformationGet the system information for the remote driver this connection refers to.getUuid()booleanisClosed()Determine whether this connection was closed.booleanisLocal()Determine whether this connection is local, that is, whether it executes jobs in the local JVM.booleanDetermines if this connection is over SSL.voidRemove a connection status listener from this connection's list of listeners.voidsetStatus(JPPFClientConnectionStatus status) Set the status of this connection.Future<?>submit(ClientTaskBundle bundle) toString()Methods inherited from class org.jppf.client.balancer.ChannelWrapper
addExecutionStatusListener, checkBundler, fireExecutionStatusChanged, getBundler, getCurrentNbJobs, getExecutionStatus, getManagementInfo, getMonitor, getOldStatus, getPriority, getSystemInformation, initChannelID, isActive, isResetting, removeExecutionStatusListener, setManagementInfo, setOldStatus, setResetting, setSystemInformationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.execute.ExecutorChannel
getMaxJobs, isAsynchronousMethods inherited from interface org.jppf.client.JPPFClientConnection
getPriority
-
Constructor Details
-
ChannelWrapperLocal
Default initializer for local channel wrapper.- Parameters:
client- reference to the JPPF client.
-
-
Method Details
-
getUuid
- Specified by:
getUuidin interfaceorg.jppf.execute.ExecutorChannel<ClientTaskBundle>
-
getConnectionUuid
Description copied from interface:JPPFClientConnectionGet the unique ID for this connection and its two channels.- Specified by:
getConnectionUuidin interfaceorg.jppf.execute.ExecutorChannel<ClientTaskBundle>- Specified by:
getConnectionUuidin interfaceJPPFClientConnection- Returns:
- the id as a string.
-
getStatus
Description copied from class:ChannelWrapperGet the status of this connection.- Specified by:
getStatusin interfaceClientConnectionStatusHandler- Specified by:
getStatusin classChannelWrapper- Returns:
- a
JPPFClientConnectionStatusenumerated value.
-
setStatus
Description copied from interface:ClientConnectionStatusHandlerSet the status of this connection.- Specified by:
setStatusin interfaceClientConnectionStatusHandler- Parameters:
status- aJPPFClientConnectionStatusenumerated value.
-
addClientConnectionStatusListener
Description copied from class:ChannelWrapperAdd a connection status listener to this connection's list of listeners.- Specified by:
addClientConnectionStatusListenerin interfaceClientConnectionStatusHandler- Specified by:
addClientConnectionStatusListenerin classChannelWrapper- Parameters:
listener- the listener to add to the list.
-
removeClientConnectionStatusListener
Description copied from class:ChannelWrapperRemove a connection status listener from this connection's list of listeners.- Specified by:
removeClientConnectionStatusListenerin interfaceClientConnectionStatusHandler- Specified by:
removeClientConnectionStatusListenerin classChannelWrapper- Parameters:
listener- the listener to remove from the list.
-
fireStatusChanged
protected void fireStatusChanged(JPPFClientConnectionStatus oldStatus, JPPFClientConnectionStatus newStatus) Notify all listeners that the status of this connection has changed.- Parameters:
oldStatus- the connection status before the change.newStatus- the connection status after the change.
-
submit
- Specified by:
submitin interfaceorg.jppf.execute.ExecutorChannel<ClientTaskBundle>
-
isLocal
public boolean isLocal()Description copied from interface:JPPFClientConnectionDetermine whether this connection is local, that is, whether it executes jobs in the local JVM.- Specified by:
isLocalin interfaceorg.jppf.execute.ExecutorChannel<ClientTaskBundle>- Specified by:
isLocalin interfaceJPPFClientConnection- Returns:
trueif this connection is local,falseotherwise.
-
toString
-
close
public void close()Description copied from interface:JPPFClientConnectionShutdown this connection and release all the resources it is using.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceJPPFClientConnection- Overrides:
closein classChannelWrapper
-
cancel
Description copied from class:ChannelWrapperCancel the currently executing job, if any.- Specified by:
cancelin classChannelWrapper- Parameters:
bundle- the bundle to cancel.- Returns:
trueif the job is effectively cancelled,falseotherwise.
-
isClosed
public boolean isClosed()Description copied from interface:JPPFClientConnectionDetermine whether this connection was closed.- Specified by:
isClosedin interfaceJPPFClientConnection- Returns:
- whether this channel is closed.
-
getName
Description copied from interface:JPPFClientConnectionGet the name assigned to this client connection.- Specified by:
getNamein interfaceJPPFClientConnection- Returns:
- the name as a string.
-
isSSLEnabled
public boolean isSSLEnabled()Description copied from interface:JPPFClientConnectionDetermines if this connection is over SSL.- Specified by:
isSSLEnabledin interfaceJPPFClientConnection- Returns:
trueif this is an SSL connection,falseotherwise.
-
getHost
Description copied from interface:JPPFClientConnectionGet the driver's host name or ip address.- Specified by:
getHostin interfaceJPPFClientConnection- Returns:
- the host as a stirng.
-
getPort
public int getPort()Description copied from interface:JPPFClientConnectionGet the port number on which the dirver is listeneing for connections.- Specified by:
getPortin interfaceJPPFClientConnection- Returns:
- the port number as an int.
-
getDriverUuid
Description copied from interface:JPPFClientConnectionGet the unique identifier of the remote driver.- Specified by:
getDriverUuidin interfaceJPPFClientConnection- Returns:
- the uuid as a string.
-
getSystemInfo
public org.jppf.management.JPPFSystemInformation getSystemInfo()Description copied from interface:JPPFClientConnectionGet the system information for the remote driver this connection refers to.- Specified by:
getSystemInfoin interfaceJPPFClientConnection- Returns:
- a
JPPFSystemInformationinstance.
-
getConnectionPool
Description copied from interface:JPPFClientConnectionGet the pool this connection belongs to.- Specified by:
getConnectionPoolin interfaceJPPFClientConnection- Returns:
- a
JPPFConnectionPoolinstance.
-