org.jppf.classloader
Class JPPFResourceWrapper

java.lang.Object
  extended by org.jppf.classloader.JPPFResourceWrapper
All Implemented Interfaces:
Serializable

public class JPPFResourceWrapper
extends Object
implements Serializable

Instances of this class encapsulate the necessary information used by the network classloader, for sending class definition requests as well as receiving the class definitions.

Author:
Laurent Cohen
See Also:
Serialized Form

Nested Class Summary
static class JPPFResourceWrapper.State
          Enumeration of the possible states for this resource wrapper.
 
Constructor Summary
JPPFResourceWrapper()
           
 
Method Summary
 void addUuid(String uuid)
          Add a uuid to the uuid path of this resource wrapper.
 byte[] getCallable()
          Get the serialized callback to execute code on the client side.
 Object getData(String key)
          Get the metadata corresponding to the specified key.
 byte[] getDefinition()
          Get the actual definition of the requested class.
 String getManagementId()
          Get the identifier for the driver's management (JMX) server.
 String getName()
          Get the name of the class whose definition is requested.
 String getProviderUuid()
          Get the uuid sent by a node when it first contacts a resource provider.
 String getRequestUuid()
          Get the uuid for the orignal task bundle that triggered this resource request.
 JPPFResourceWrapper.State getState()
          Get the state associated with this resource wrapper.
 TraversalList<String> getUuidPath()
          Get a reference to the traversal list that Keeps and manages the uuid path list and the current position in it.
 boolean isAsResource()
          Determine whether the resource is to be loaded using ClassLoader.getResource().
 boolean isDynamic()
          Determine whether the class should be loaded through the network classloader.
 void setAsResource(boolean asResource)
          Set whether the resource is to be loaded using ClassLoader.getResource().
 void setCallable(byte[] callable)
          Set the serialized callback to execute code on the client side.
 void setData(String key, Object value)
          Get the metadata corresponding to the specified key.
 void setDefinition(byte[] definition)
          Set the actual definition of the requested class.
 void setDynamic(boolean dynamic)
          Set whether the class should be loaded through the network classloader.
 void setManagementId(String managementId)
          Set the identifier for the driver's management (JMX) server.
 void setName(String name)
          Set the name of the class whose definition is requested.
 void setProviderUuid(String providerUuid)
          Set the uuid sent by a node when it first contacts a resource provider.
 void setRequestUuid(String requestUuid)
          Set the uuid for the orignal task bundle that triggered this resource request.
 void setState(JPPFResourceWrapper.State state)
          Set the state associated with this resource wrapper.
 void setUuidPath(TraversalList<String> uuidPath)
          Set the reference to the traversal list that Keeps and manages the uuid path list and the current position in it.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JPPFResourceWrapper

public JPPFResourceWrapper()
Method Detail

addUuid

public void addUuid(String uuid)
Add a uuid to the uuid path of this resource wrapper.

Parameters:
uuid - - the identifier as a string.

getName

public String getName()
Get the name of the class whose definition is requested.

Returns:
the class name as a string.

setName

public void setName(String name)
Set the name of the class whose definition is requested.

Parameters:
name - - the class name as a string.

getDefinition

public byte[] getDefinition()
Get the actual definition of the requested class.

Returns:
the class definition as an array of bytes.

setDefinition

public void setDefinition(byte[] definition)
Set the actual definition of the requested class.

Parameters:
definition - - the class definition as an array of bytes.

isDynamic

public boolean isDynamic()
Determine whether the class should be loaded through the network classloader.

Returns:
true if the class should be loaded via the network classloader, false otherwise.

setDynamic

public void setDynamic(boolean dynamic)
Set whether the class should be loaded through the network classloader.

Parameters:
dynamic - - true if the class should be loaded via the network classloader, false otherwise.

getState

public JPPFResourceWrapper.State getState()
Get the state associated with this resource wrapper.

Returns:
a State typesafe enumerated value.

setState

public void setState(JPPFResourceWrapper.State state)
Set the state associated with this resource wrapper.

Parameters:
state - - a State typesafe enumerated value.

getUuidPath

public TraversalList<String> getUuidPath()
Get a reference to the traversal list that Keeps and manages the uuid path list and the current position in it.

Returns:
a traversal list of string elements.

setUuidPath

public void setUuidPath(TraversalList<String> uuidPath)
Set the reference to the traversal list that Keeps and manages the uuid path list and the current position in it.

Parameters:
uuidPath - - a traversal list of string elements.

getProviderUuid

public String getProviderUuid()
Get the uuid sent by a node when it first contacts a resource provider.

Returns:
the uuid as a string.

setProviderUuid

public void setProviderUuid(String providerUuid)
Set the uuid sent by a node when it first contacts a resource provider.

Parameters:
providerUuid - - the uuid as a string.

isAsResource

public boolean isAsResource()
Determine whether the resource is to be loaded using ClassLoader.getResource().

Returns:
true if the resource is loaded using getResource(), false otherwise.

setAsResource

public void setAsResource(boolean asResource)
Set whether the resource is to be loaded using ClassLoader.getResource().

Parameters:
asResource - - true if the resource is loaded using getResource(), false otherwise.

getManagementId

public String getManagementId()
Get the identifier for the driver's management (JMX) server.

Returns:
the identifier as a string.

setManagementId

public void setManagementId(String managementId)
Set the identifier for the driver's management (JMX) server.

Parameters:
managementId - - the identifier as a string.

getRequestUuid

public String getRequestUuid()
Get the uuid for the orignal task bundle that triggered this resource request.

Returns:
the uuid as a string.

setRequestUuid

public void setRequestUuid(String requestUuid)
Set the uuid for the orignal task bundle that triggered this resource request.

Parameters:
requestUuid - the uuid as a string.

getCallable

public byte[] getCallable()
Get the serialized callback to execute code on the client side.

Returns:
a byte[] instance.

setCallable

public void setCallable(byte[] callable)
Set the serialized callback to execute code on the client side.

Parameters:
callable - - a byte[] instance.

getData

public Object getData(String key)
Get the metadata corresponding to the specified key.

Parameters:
key - - the string identifying the metadata.
Returns:
an object value or null if the metadata could not be found.

setData

public void setData(String key,
                    Object value)
Get the metadata corresponding to the specified key.

Parameters:
key - - the string identifying the metadata.
value - - the value of the metadata.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2005-2010 JPPF Team.