org.jppf.client
Class AbstractClassServerDelegate

java.lang.Object
  extended by org.jppf.client.AbstractClientConnectionHandler
      extended by org.jppf.client.AbstractClassServerDelegate
All Implemented Interfaces:
Runnable, ClassServerDelegate, ClientConnectionHandler, ClientConnectionStatusHandler
Direct Known Subclasses:
ClassServerDelegateImpl, JcaClassServerDelegate

public abstract class AbstractClassServerDelegate
extends AbstractClientConnectionHandler
implements ClassServerDelegate

Abstract implementation of the client end of the JPPF distributed class loader.

Author:
Laurent Cohen

Field Summary
protected  String appUuid
          Unique identifier for this class server delegate, obtained from the local JPPF client.
protected  boolean closed
          Indicates whether this socket handler is closed, which means it can't handle requests anymore.
protected  boolean handshakeDone
          Determines if the handshake with the server has been performed.
protected  ResourceProvider resourceProvider
          Reads resource files from the classpath.
protected  boolean stop
          Indicates whether this socket handler should be terminated and stop processing.
 
Fields inherited from class org.jppf.client.AbstractClientConnectionHandler
host, listeners, name, owner, port, socketClient, socketInitializer, status
 
Constructor Summary
protected AbstractClassServerDelegate(JPPFClientConnection owner)
          Default instantiation of this class is not permitted.
 
Method Summary
 String getName()
          Get the name of this delegate.
protected  void handshake()
          Perform the handshake with the server.
 void initSocketClient()
          Initialize this delegate's resources.
 boolean isClosed()
          Determine whether the socket connection is closed
protected  JPPFResourceWrapper readResource()
          Read a resource wrapper object from the socket connection.
 void setName(String name)
          Set the name of this delegate.
protected  void writeResource(JPPFResourceWrapper resource)
          Write a resource wrapper object to the socket connection.
 
Methods inherited from class org.jppf.client.AbstractClientConnectionHandler
addClientConnectionStatusListener, createSocketInitializer, fireStatusChanged, getSocketClient, getStatus, removeClientConnectionStatusListener, setStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.client.ClassServerDelegate
close
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface org.jppf.client.ClientConnectionHandler
getSocketClient, init
 
Methods inherited from interface org.jppf.client.event.ClientConnectionStatusHandler
addClientConnectionStatusListener, getStatus, removeClientConnectionStatusListener, setStatus
 

Field Detail

stop

protected boolean stop
Indicates whether this socket handler should be terminated and stop processing.


closed

protected boolean closed
Indicates whether this socket handler is closed, which means it can't handle requests anymore.


resourceProvider

protected ResourceProvider resourceProvider
Reads resource files from the classpath.


appUuid

protected String appUuid
Unique identifier for this class server delegate, obtained from the local JPPF client.


handshakeDone

protected boolean handshakeDone
Determines if the handshake with the server has been performed.

Constructor Detail

AbstractClassServerDelegate

protected AbstractClassServerDelegate(JPPFClientConnection owner)
Default instantiation of this class is not permitted.

Parameters:
owner - the client connection which owns this connection delegate.
Method Detail

isClosed

public boolean isClosed()
Determine whether the socket connection is closed

Specified by:
isClosed in interface ClassServerDelegate
Returns:
true if the socket connection is closed, false otherwise
See Also:
ClassServerDelegate.isClosed()

getName

public String getName()
Get the name of this delegate.

Specified by:
getName in interface ClassServerDelegate
Returns:
the name as a string.
See Also:
ClassServerDelegate.getName()

setName

public void setName(String name)
Set the name of this delegate.

Specified by:
setName in interface ClassServerDelegate
Parameters:
name - the name as a string.
See Also:
ClassServerDelegate.setName(java.lang.String)

initSocketClient

public void initSocketClient()
                      throws Exception
Initialize this delegate's resources.

Specified by:
initSocketClient in interface ClientConnectionHandler
Throws:
Exception - if an error is raised during initialization.
See Also:
ClientConnectionHandler.initSocketClient()

readResource

protected JPPFResourceWrapper readResource()
                                    throws Exception
Read a resource wrapper object from the socket connection.

Returns:
a JPPFResourceWrapper instance.
Throws:
Exception - if any error is raised.

writeResource

protected void writeResource(JPPFResourceWrapper resource)
                      throws Exception
Write a resource wrapper object to the socket connection.

Parameters:
resource - a JPPFResourceWrapper instance.
Throws:
Exception - if any error is raised.

handshake

protected void handshake()
                  throws Exception
Perform the handshake with the server.

Throws:
Exception - if any error occurs.


Copyright © 2005-2010 JPPF Team.