lbg.resource
Class Resource
java.lang.Object
lbg.resource.Resource
- Direct Known Subclasses:
- LiveResource, SimulatedResource
public abstract class Resource
- extends java.lang.Object
- Author:
- Cyril Briquet
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
id
public java.lang.String id()
netConfig
public ResourceNetworkConfiguration netConfig()
owner
public InternalPeerHandle owner()
power
public int power()
service
public ResourceService service()
logger
public abstract java.util.logging.Logger logger()
connect
public void connect()
throws GridException
- Connects the Resource to its owner Peer.
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.
- Throws:
GridException
cacheCapacity
public int cacheCapacity()
setWorkingSet
public abstract boolean setWorkingSet(GridData[][] working_set)
throws GridException
- Throws:
GridException
idle
public boolean idle()
runningTask
public Task runningTask()
runTask
public void runTask(Task t)
throws GridException
- Throws:
GridException
completeTask
public void completeTask(GridData data,
byte[] logs)
throws GridException
- Completes the execution of a Task by:
- flagging the Task as complete (thus, creating a TaskOutput)
- updating the Resource state
- Throws:
GridException
cancelTask
public void cancelTask()
throws GridException
- Throws:
GridException
taskStartTime
public long taskStartTime()
expectedTaskRuntime
public long expectedTaskRuntime()
throws GridException
- Throws:
GridException
Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.