org.jppf.client
Class ClassServerDelegateImpl

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

public class ClassServerDelegateImpl
extends AbstractClassServerDelegate

Wrapper around an incoming socket connection, whose role is to receive the names of classes to load from the classpath, then send the class files' contents (or bytecode) to the remote client.

Instances of this class are part of the JPPF dynamic class loading mechanism. They enable remote nodes to dynamically load classes from the JVM that run's the class server.

Author:
Laurent Cohen, Domingos Creado

Field Summary
 
Fields inherited from class org.jppf.client.AbstractClassServerDelegate
appUuid, closed, handshakeDone, resourceProvider, stop
 
Fields inherited from class org.jppf.client.AbstractClientConnectionHandler
host, listeners, name, owner, port, socketClient, socketInitializer, status
 
Constructor Summary
ClassServerDelegateImpl(JPPFClientConnection owner, String uuid, String host, int port)
          Initialize class server delegate with a specified application uuid.
 
Method Summary
 void close()
          Close the socket connection.
protected  SocketInitializer createSocketInitializer()
          Create a socket initializer for this delegate.
 void init()
          Initialize this node's resources.
 void run()
          Main processing loop of this delegate.
 
Methods inherited from class org.jppf.client.AbstractClassServerDelegate
getName, handshake, initSocketClient, isClosed, readResource, setName, writeResource
 
Methods inherited from class org.jppf.client.AbstractClientConnectionHandler
addClientConnectionStatusListener, 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.ClientConnectionHandler
getSocketClient
 
Methods inherited from interface org.jppf.client.event.ClientConnectionStatusHandler
addClientConnectionStatusListener, getStatus, removeClientConnectionStatusListener, setStatus
 

Constructor Detail

ClassServerDelegateImpl

public ClassServerDelegateImpl(JPPFClientConnection owner,
                               String uuid,
                               String host,
                               int port)
                        throws Exception
Initialize class server delegate with a specified application uuid.

Parameters:
owner - the client connection which owns this delegate.
uuid - the unique identifier for the local JPPF client.
host - the name or IP address of the host the class server is running on.
port - the TCP port the class server is listening to.
Throws:
Exception - if the connection could not be opened.
Method Detail

init

public final void init()
                throws Exception
Initialize this node's resources.

Throws:
Exception - if an error is raised during initialization.
See Also:
ClientConnectionHandler.init()

run

public void run()
Main processing loop of this delegate.

See Also:
Runnable.run()

close

public void close()
Close the socket connection.

See Also:
ClassServerDelegate.close()

createSocketInitializer

protected SocketInitializer createSocketInitializer()
Create a socket initializer for this delegate.

Specified by:
createSocketInitializer in class AbstractClientConnectionHandler
Returns:
a SocketInitializer instance.


Copyright © 2005-2010 JPPF Team.