|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jsim.process.DynamicNode jsim.process.Server
public class Server
The Server class allows groups of servers to be created. A Server object consists of one or more tokens (service units). To obtain service, an entity (client) must acquire a token.
Nested Class Summary | |
---|---|
protected class |
Server.TokenVec
Inner class for token vector. |
Field Summary | |
---|---|
protected Server.TokenVec |
tokenV
Token vector. |
Fields inherited from class jsim.process.DynamicNode |
---|
costs, duration, occupancy, outgoing, props, trc |
Constructor Summary | |
---|---|
Server(int id,
Prop props,
Transport[] outgoing,
AnimationQueue sharedQueue)
Version of the Constructor for use with animator Construct a Server. |
|
Server(Prop props,
Transport[] outgoing)
Construct a Server. |
Method Summary | |
---|---|
void |
contract()
Remove a service unit (token) from the server. |
void |
expand()
Add a service unit (token) to the server. |
int |
getId()
Returns the id of the Server |
SimObject |
preempt(Token pToken,
SimObject pEntity)
Preempt the service of the entity being served by token. |
void |
request(SimObject entity)
Request a token (service unit). |
void |
setId(int id)
Sets the id of the Server |
void |
use(SimObject entity)
An entity calls the use method to obtain service. |
void |
use(SimObject entity,
double service,
double cost)
An entity calls the use method to obtain service. |
Methods inherited from class jsim.process.DynamicNode |
---|
getNodeStats, getOutgoing, getProps, setBatchProperties, setPrimary, setProps |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Server.TokenVec tokenV
Constructor Detail |
---|
public Server(Prop props, Transport[] outgoing)
property
- properties of nodelocation
- position of nodenodeGroup
- containing modeloutgoing
- outgoing transportspublic Server(int id, Prop props, Transport[] outgoing, AnimationQueue sharedQueue)
id
- id of the serverproperty
- properties of nodelocation
- position of nodenodeGroup
- containing modeloutgoing
- outgoing transportssharedQueue
- animation queueMethod Detail |
---|
public int getId()
public void setId(int id)
id
- id for this serverpublic void request(SimObject entity)
entity
- the SimObject (entity) requesting servicepublic void use(SimObject entity, double service, double cost)
entity
- entity obtaining serviceservice
- service timepublic void use(SimObject entity)
entity
- entity obtaining servicepublic SimObject preempt(Token pToken, SimObject pEntity)
tokenNum
- preempt the service of this token
public void expand()
public void contract()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |