Class Entry
-
- All Implemented Interfaces:
-
java.io.Serializable,jline.lang.Copyable
public class Entry extends LayeredNetworkElement
An Entry represents a service interface exposed by a Task in a layered queueing network.
Entries define the points where external requests can enter a task and receive service. They act as the public interface of a task, similar to methods or endpoints in software systems. Each entry can receive requests from other tasks or from external arrival sources.
Key characteristics:
- Service interface: Defines what service the task provides to callers
- Arrival distribution: For open systems, the arrival process of external requests
- Activity binding: Can be bound to specific activities that implement the service
- Reply activity: Designates which activity sends the response back to the caller
Entries are essential for modeling service-oriented architectures, web services, database systems, and any system where tasks provide distinct services to clients.
-
-
Field Summary
Fields Modifier and Type Field Description public Distributionarrivalprotected Taskparentprotected Map<Integer, String>boundToActivityprotected Map<Integer, String>replyActivityprotected Matrixschedulingprotected Map<Integer, String>forwardingDestsprotected MatrixforwardingProbspublic final static intACTIVITYpublic final static intCALLpublic final static intENTRYpublic final static intHOSTpublic final static intPROCESSORpublic final static intTASKpublic LayeredNetworkmodelprotected Stringname
-
Constructor Summary
Constructors Constructor Description Entry(LayeredNetwork model, String name)
-
Method Summary
Modifier and Type Method Description DistributiongetArrival()Gets the open arrival distribution for this entry. EntrysetArrival(Distribution arrival)Sets the open arrival process for this entry. Entryon(Task newParent)Entryforward(Entry dest, double prob)Add a forwarding call to another entry with a specified probability. Entryforward(String destName, double prob)Add a forwarding call to another entry by name with a specified probability. Entryforward(Entry dest)Add a forwarding call to another entry with probability 1.0. Entryforward(String destName)Add a forwarding call to another entry by name with probability 1.0. Map<Integer, String>getForwardingDests()Get the map of forwarding destinations. MatrixgetForwardingProbs()Get the matrix of forwarding probabilities. voidvalidateForwardingProbability(double prob)Validate that a forwarding probability is valid and that the sum of all forwarding probabilities does not exceed 1.0. -
-
Constructor Detail
-
Entry
Entry(LayeredNetwork model, String name)
-
-
Method Detail
-
getArrival
Distribution getArrival()
Gets the open arrival distribution for this entry.
- Returns:
The arrival distribution, or null if not set
-
setArrival
Entry setArrival(Distribution arrival)
Sets the open arrival process for this entry.
- Parameters:
arrival- The arrival distribution (e.g.- Returns:
this Entry for method chaining
-
forward
Entry forward(Entry dest, double prob)
Add a forwarding call to another entry with a specified probability. Forwarding allows this entry to redirect the reply to another entry instead of replying directly to the original caller.
- Parameters:
dest- The destination entry to forward toprob- The probability of forwarding (0.0 to 1.- Returns:
This entry for method chaining
-
forward
Entry forward(String destName, double prob)
Add a forwarding call to another entry by name with a specified probability.
- Parameters:
destName- The name of the destination entryprob- The probability of forwarding (0.0 to 1.- Returns:
This entry for method chaining
-
forward
Entry forward(Entry dest)
Add a forwarding call to another entry with probability 1.0.
- Parameters:
dest- The destination entry to forward to- Returns:
This entry for method chaining
-
forward
Entry forward(String destName)
Add a forwarding call to another entry by name with probability 1.0.
- Parameters:
destName- The name of the destination entry- Returns:
This entry for method chaining
-
getForwardingDests
Map<Integer, String> getForwardingDests()
Get the map of forwarding destinations.
- Returns:
Map of forwarding destination entry names
-
getForwardingProbs
Matrix getForwardingProbs()
Get the matrix of forwarding probabilities.
- Returns:
Matrix of forwarding probabilities
-
validateForwardingProbability
void validateForwardingProbability(double prob)
Validate that a forwarding probability is valid and that the sum of all forwarding probabilities does not exceed 1.0.
- Parameters:
prob- The probability to validate
-
-
-
-