Lightweight Bartering Grid

lbg.peer.workflow
Class JobDescriptor

java.lang.Object
  extended by lbg.peer.workflow.JobDescriptor
All Implemented Interfaces:
java.io.Serializable

public class JobDescriptor
extends java.lang.Object
implements java.io.Serializable

Contains the description of all tasks to be in this Job Peer-side

Author:
Xavier Dalem
See Also:
Serialized Form

Field Summary
 long submissionTime
           
 
Constructor Summary
JobDescriptor()
           
 
Method Summary
 void add(java.lang.String[] classnames, byte[][] bytecodes)
          Adds classes that will be required later.
 void add(java.lang.String[] ids, GridData[][] datas)
          Adds datas that will be required later.
 void add(TaskDescriptor taskdesc)
          Adds a TaskDescriptor to to this JobDescriptor.
 void add(TaskDescriptor taskdesc, java.lang.String[] classnames, byte[][] bytecodes, java.lang.String[] ids, GridData[][] datas)
          Convenience method to add everything needed for a TaskDescriptor at once
 void convert(GridDataManager manager)
          Convert all stored datas.
 long getSubmissionTime()
           
 void setSubmissionTime()
           
 java.lang.String toString()
          String representation of the class descriptor, showing numbers of tasks and classes
 Task[] toTasks(java.lang.String consumer_peer_id, int job_id, int bot_id)
          Makes Tasks from the current description.
Calls to this method are always run completely (i.e.
 Workflow workflow()
          Gets Job workflow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

submissionTime

public long submissionTime
Constructor Detail

JobDescriptor

public JobDescriptor()
Method Detail

add

public void add(java.lang.String[] classnames,
                byte[][] bytecodes)
         throws GridException
Adds classes that will be required later.

Parameters:
classnames - Fully qualified (package.class) class names
bytecodes - Bytecodes for the corresponding classnames
Throws:
GridException

add

public void add(java.lang.String[] ids,
                GridData[][] datas)
         throws GridException
Adds datas that will be required later. This is a destructive process. If you add an option for an already added data, the old option will be overwritten.

Parameters:
ids - IDs of needed data's
datas - Options for the matching data's
Throws:
GridException

add

public void add(TaskDescriptor taskdesc)
         throws GridException
Adds a TaskDescriptor to to this JobDescriptor. Datas and classes this descriptor depends on should have been loaded previously.

Parameters:
taskdesc - The TaskDescriptor to add
Throws:
GridException

add

public void add(TaskDescriptor taskdesc,
                java.lang.String[] classnames,
                byte[][] bytecodes,
                java.lang.String[] ids,
                GridData[][] datas)
         throws GridException
Convenience method to add everything needed for a TaskDescriptor at once

Parameters:
taskdesc - The TaskDescriptor to add
classnames - Fully qualified (package.class) class names
bytecodes - Bytecodes for the corresponding classnames
ids - IDs of needed data's
datas - Options for the mathing data's
Throws:
GridException

setSubmissionTime

public void setSubmissionTime()
                       throws GridException
Throws:
GridException

getSubmissionTime

public long getSubmissionTime()

toTasks

public Task[] toTasks(java.lang.String consumer_peer_id,
                      int job_id,
                      int bot_id)
               throws GridException
Makes Tasks from the current description.
Calls to this method are always run completely (i.e. not cached) to avoid inconsistency when elements are added between 2 calls.

Parameters:
consumer_peer_id - ID of the Task owner
job_id - Job ID for the Tasks
bot_id - BoT ID for the Tasks
Returns:
all Tasks that could be built (null if none)
Throws:
GridException

convert

public void convert(GridDataManager manager)
             throws GridException
Convert all stored datas. The conversion depends on the configuration of the manager.

Parameters:
manager - The data manager
Throws:
GridException - if some data cannot be shared

workflow

public Workflow workflow()
Gets Job workflow.


toString

public java.lang.String toString()
String representation of the class descriptor, showing numbers of tasks and classes

Overrides:
toString in class java.lang.Object

Lightweight Bartering Grid

Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.