|
Lightweight Bartering Grid | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlbg.resource.Resource
lbg.resource.LiveResource
public class LiveResource
Implementation of a Live Resource.
Related logger: lbg.resource
| Field Summary | |
|---|---|
protected boolean |
is_removed
|
| Constructor Summary | |
|---|---|
LiveResource(ResourceBasicConfiguration rbc,
ResourceNetworkConfiguration rnc,
ResourceDataConfiguration rdc,
InternalPeerHandle owner_peer)
Creates a Live resource Resource is not yet connected to peer. |
|
| Method Summary | |
|---|---|
void |
cancelTask()
Cancel the currently running task |
void |
completeTask(GridData data,
byte[] logs)
Make final operations to register the running task as completed |
void |
connect()
Connects the Resource to its owner Peer. |
long |
expectedTaskRuntime()
How much time should running this task take ? |
protected void |
flagAsRemoved()
|
GridDataManager |
gdm()
|
ResourceDataConfiguration |
getDataConfig()
|
boolean |
getRemovalState()
|
boolean |
isAlive()
|
java.util.logging.Logger |
logger()
|
void |
runTask(Task t)
Runs a given Task by getting and loading all required information, then running the methods as specified by GridApplication. The method returns immediately, starting the Task in another Thread. |
boolean |
setWorkingSet(GridData[][] working_set)
|
void |
startService()
|
java.lang.String |
toString()
|
| Methods inherited from class lbg.resource.Resource |
|---|
cacheCapacity, id, idle, netConfig, owner, power, runningTask, service, taskStartTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean is_removed
| Constructor Detail |
|---|
public LiveResource(ResourceBasicConfiguration rbc,
ResourceNetworkConfiguration rnc,
ResourceDataConfiguration rdc,
InternalPeerHandle owner_peer)
throws GridException
rbc - The basic configuration for the resourcernc - The network configuration for the resourcerdc - The data configuration for the resourceowner_peer - A handle to the peer that manages this resource
GridExceptionconnect()| Method Detail |
|---|
public boolean getRemovalState()
protected void flagAsRemoved()
public void connect()
throws GridException
This cannot be done at creation-time because we maybe need another infrastructure (e.g. Sockets) before telling the Peer we're ready to process Tasks.
connect in class ResourceGridExceptionpublic java.lang.String toString()
toString in class Resourcepublic ResourceDataConfiguration getDataConfig()
public GridDataManager gdm()
public boolean setWorkingSet(GridData[][] working_set)
throws GridException
setWorkingSet in class ResourceGridException
public void runTask(Task t)
throws GridException
runTask in class Resourcet - The task to run
GridExceptionGridApplication
public void completeTask(GridData data,
byte[] logs)
throws GridException
completeTask in class Resourcedata - The output data of the completed task
GridException
public void cancelTask()
throws GridException
cancelTask in class ResourceGridException
public long expectedTaskRuntime()
throws GridException
expectedTaskRuntime in class ResourceGridException
public void startService()
throws GridException
GridExceptionpublic boolean isAlive()
public java.util.logging.Logger logger()
logger in class Resource
|
Lightweight Bartering Grid | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.