org.jppf.jca.work
Class JcaClassServerDelegate

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

public class JcaClassServerDelegate
extends AbstractClassServerDelegate
implements Work

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

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
JcaClassServerDelegate(String name, String uuid, String host, int port, JPPFJcaClient client, JPPFJcaClientConnection owner)
          Initialize class server delegate with a spceified application uuid.
 
Method Summary
 void close()
          Close the socket connection.
protected  SocketInitializer createSocketInitializer()
          Create a socket initializer for this delegate.
 void init()
          Initialize this delegate's resources.
 void performConnection()
          Establish a connection and perform the inital shakedown with the JPPF driver.
 void release()
          This method does nothing.
 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

JcaClassServerDelegate

public JcaClassServerDelegate(String name,
                              String uuid,
                              String host,
                              int port,
                              JPPFJcaClient client,
                              JPPFJcaClientConnection owner)
                       throws Exception
Initialize class server delegate with a spceified application uuid.

Parameters:
name - the name given to this 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.
client - the JPPF client that owns this class server delegate.
owner - the connection that owns this class server delegate.
Throws:
Exception - if the connection could not be opended.
Method Detail

init

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

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

run

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

Specified by:
run in interface Runnable
See Also:
Runnable.run()

performConnection

public void performConnection()
                       throws Exception
Establish a connection and perform the inital shakedown with the JPPF driver.

Throws:
Exception - if the conenction could not be established.

close

public void close()
Close the socket connection.

Specified by:
close in interface ClassServerDelegate
Specified by:
close in interface ClientConnectionHandler
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.

release

public void release()
This method does nothing.

Specified by:
release in interface Work
See Also:
Work.release()


Copyright © 2005-2010 JPPF Team.