|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorca.tests.core.SimpleLoadSource
public class SimpleLoadSource
Very simple demand. Creates demand either once (if
oneRequestOnly used) or on every cycle. Only bids for one
resource type and the same number of resources and term length every time.
| Field Summary | |
|---|---|
protected long |
advanceTime
The advance time. |
protected ActorClock |
clock
The clock |
static long |
CLOCK_SKEW
The amount of time over specific policy decisions the SM must add when communicating with other actors (e.g. |
protected boolean |
firstDemand
Indicates if the load source is on its first demand or not |
protected int |
leaseLength
The length of the lease |
protected LoggingTool |
logger
The logger |
protected long |
previousCycle
What the previous cycle was |
static java.lang.String |
PropertyLeaseLength
|
static java.lang.String |
PropertyOneRequest
|
static java.lang.String |
PropertyResourceType
|
static java.lang.String |
PropertySliceName
|
static java.lang.String |
PropertyUnits
|
protected ResourceType |
resourceType
The resource type the SM wants |
protected CodSlice |
slice
The slice |
protected java.lang.String |
sliceName
The name of the slice the SM is requesting from |
protected ServiceManager |
sm
The service manager |
protected int |
units
Number of units the SM wants |
protected boolean |
unsetAdvance
If the advance time has been set |
| Constructor Summary | |
|---|---|
SimpleLoadSource()
|
|
| Method Summary | |
|---|---|
protected void |
bid(long cycle)
Make a bid to the SM. |
void |
configure(java.util.Properties p)
|
LoggingTool |
getLogger()
Returns the logger associated with the controller. |
void |
initialize()
Initializes the object. |
void |
setActor(IActor serviceManager)
Attach the actor |
protected void |
setAdvanceTime()
Calls up to a default broker to query and set the advance time. |
void |
setLeaseLength(int lease)
Set the lease length |
void |
setLeaseLength(java.lang.Integer lease)
Set the lease length |
void |
setOneRequestOnly(boolean value)
Set one request or multiple |
void |
setOneRequestOnly(java.lang.Boolean value)
Set one request or multiple |
void |
setResourceType(ResourceType resType)
Set the resource type |
void |
setResourceType(java.lang.String resType)
Set the resource type |
void |
setUnits(int u)
Set the units |
void |
setUnits(java.lang.Integer u)
Set the units |
void |
tick(long cycle)
Informs the load source that another cycle has passed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PropertyUnits
public static final java.lang.String PropertyResourceType
public static final java.lang.String PropertyLeaseLength
public static final java.lang.String PropertyOneRequest
public static final java.lang.String PropertySliceName
protected CodSlice slice
protected ServiceManager sm
protected ActorClock clock
protected LoggingTool logger
public static final long CLOCK_SKEW
protected long previousCycle
protected boolean firstDemand
protected boolean unsetAdvance
protected long advanceTime
protected int units
protected ResourceType resourceType
protected int leaseLength
protected java.lang.String sliceName
| Constructor Detail |
|---|
public SimpleLoadSource()
| Method Detail |
|---|
public void initialize()
throws java.lang.Exception
IInitialize
initialize in interface IInitializejava.lang.Exceptionpublic void tick(long cycle)
tick in interface ILoadSourcecycle - this cycleprotected void setAdvanceTime()
protected void bid(long cycle)
cycle - the current cycle
public void configure(java.util.Properties p)
throws java.lang.Exception
java.lang.Exceptionpublic void setActor(IActor serviceManager)
setActor in interface ILoadSourceserviceManager - the service managerpublic void setUnits(int u)
u - unitspublic void setUnits(java.lang.Integer u)
u - unitspublic void setResourceType(ResourceType resType)
resType - resource typepublic void setResourceType(java.lang.String resType)
resType - resource typepublic void setLeaseLength(int lease)
lease - length of the leasepublic void setLeaseLength(java.lang.Integer lease)
lease - length of the leasepublic void setOneRequestOnly(boolean value)
value - true if one request onlypublic void setOneRequestOnly(java.lang.Boolean value)
value - true if one request onlypublic LoggingTool getLogger()
ILoadSource
getLogger in interface ILoadSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||