org.jppf.server.protocol
Class JPPFJobMetadata

java.lang.Object
  extended by org.jppf.server.protocol.JPPFJobMetadata
All Implemented Interfaces:
Serializable

public class JPPFJobMetadata
extends Object
implements Serializable

Instances of this class hold metadata about a job, that can be used from a load-balancer, to adapt the load balancing to the computational weight of the job and/or the contained tasks. It may be used in other places in future versions.

Author:
Laurent Cohen
See Also:
JobAwareness, Serialized Form

Constructor Summary
JPPFJobMetadata()
           
 
Method Summary
 Map<Object,Object> getAll()
          Get a copy of the metadata map.
 Object getParameter(Object key)
          Retrieve a parameter in the metadata.
 Object getParameter(Object key, Object def)
          Retrieve a parameter in the metadata.
 Object removeParameter(Object key)
          Remove a parameter from the metadata.
 void setParameter(Object key, Object value)
          Set a parameter in the metadata.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFJobMetadata

public JPPFJobMetadata()
Method Detail

setParameter

public void setParameter(Object key,
                         Object value)
Set a parameter in the metadata. If a parameter with the same key already exists, its value is replaced witht he new one.

Parameters:
key - the parameter's key.
value - the parameter's value.

getParameter

public Object getParameter(Object key)
Retrieve a parameter in the metadata.

Parameters:
key - the parameter's key.
Returns:
the parameter's value or null if no parameter with the specified key exists.

getParameter

public Object getParameter(Object key,
                           Object def)
Retrieve a parameter in the metadata.

Parameters:
key - the parameter's key.
def - a default value to return if no parameter with the specified key can be found.
Returns:
the parameter's value or null if no parameter with the specified key exists.

removeParameter

public Object removeParameter(Object key)
Remove a parameter from the metadata.

Parameters:
key - the parameter's key.
Returns:
the removed parameter's value or null if no parameter with the specified key exists.

getAll

public Map<Object,Object> getAll()
Get a copy of the metadata map.

Returns:
a map of the metadata contained in this object.


Copyright © 2005-2010 JPPF Team.