org.jppf.server.protocol
Class BundleWrapper

java.lang.Object
  extended by org.jppf.server.protocol.BundleWrapper

public class BundleWrapper
extends Object

This class wraps a task bundle to express it in terms of DataLocation. This allows the tasks data to be processed with the same semantics no matter where it is stored, comes from or goes to.

Author:
Laurent Cohen

Constructor Summary
BundleWrapper()
          Default constructor.
BundleWrapper(JPPFTaskBundle bundle)
          Initialize this bundle wrapper with the specified task bundle.
 
Method Summary
 void addTask(DataLocation task)
          Add a task to this bundle wrapper.
 BundleWrapper copy()
          Make a copy of this bundle wrapper.
 BundleWrapper copy(int nbTasks)
          Make a copy of this bundle wrapper containing only the first nbTasks tasks it contains.
 JPPFTaskBundle getBundle()
          Get the underlying task bundle.
 DataLocation getDataProvider()
          Get the location of the data provider.
 List<DataLocation> getTasks()
          Get the list of locations of the tasks.
 void merge(BundleWrapper other, boolean after)
          Merge this bundle wrapper with another.
 void setBundle(JPPFTaskBundle bundle)
          Set the underlying task bundle.
 void setDataProvider(DataLocation dataProvider)
          Get the location of the data provider.
 void setTasks(List<DataLocation> tasks)
          Set the list of locations of the tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleWrapper

public BundleWrapper()
Default constructor.


BundleWrapper

public BundleWrapper(JPPFTaskBundle bundle)
Initialize this bundle wrapper with the specified task bundle.

Parameters:
bundle - the underlying task bundle for this wrapper.
Method Detail

getBundle

public JPPFTaskBundle getBundle()
Get the underlying task bundle.

Returns:
a JPPFTaskBundle instance.

setBundle

public void setBundle(JPPFTaskBundle bundle)
Set the underlying task bundle.

Parameters:
bundle - a JPPFTaskBundle instance.

getDataProvider

public DataLocation getDataProvider()
Get the location of the data provider.

Returns:
a JPPFTaskBundle instance.

setDataProvider

public void setDataProvider(DataLocation dataProvider)
Get the location of the data provider.

Parameters:
dataProvider - a JPPFTaskBundle instance.

addTask

public void addTask(DataLocation task)
Add a task to this bundle wrapper.

Parameters:
task - the task to add.

getTasks

public List<DataLocation> getTasks()
Get the list of locations of the tasks.

Returns:
a list of DataLocation instances.

setTasks

public void setTasks(List<DataLocation> tasks)
Set the list of locations of the tasks.

Parameters:
tasks - a list of DataLocation instances.

copy

public BundleWrapper copy()
Make a copy of this bundle wrapper.

Returns:
a new BundleWrapper instance.

copy

public BundleWrapper copy(int nbTasks)
Make a copy of this bundle wrapper containing only the first nbTasks tasks it contains.

Parameters:
nbTasks - the number of tasks to include in the copy.
Returns:
a new BundleWrapper instance.

merge

public void merge(BundleWrapper other,
                  boolean after)
Merge this bundle wrapper with another.

Parameters:
other - the wrapper to merge with.
after - determines whether the tasks from other should be added first or last.


Copyright © 2005-2010 JPPF Team.