|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.clackrouter.component.base.ClackComponent
net.clackrouter.component.extension.Loss
public class Loss
Component that randomly drops packets based on a user-specified drop rate.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
|---|
ClackComponent.Waiter |
| Field Summary | |
|---|---|
static int |
DEFAULT_LOSS
|
static int |
PORT_IN
|
static int |
PORT_OUT
|
| Fields inherited from class net.clackrouter.component.base.ClackComponent |
|---|
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view |
| Constructor Summary | |
|---|---|
Loss(Router r,
java.lang.String name)
|
|
Loss(Router r,
java.lang.String name,
int loss)
|
|
| Method Summary | |
|---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
Randomly test to see if the packet should be dropped, otherwise forward it unmodified |
void |
dropNextPacket()
|
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
int |
getDrops()
|
float |
getLoss()
|
javax.swing.JPanel |
getPropertiesView()
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. |
java.util.Properties |
getSerializableProperties(boolean isTransient)
Save the current loss value |
void |
initializeProperties(java.util.Properties props)
Set the current loss rate based on serialized properties |
boolean |
isModifying()
Reports whether this component modifies packets passed through it This value is used by the static checking algorithm used to make sure port connections are valid. |
void |
setLoss(float l)
|
protected void |
setupPorts(int numports)
Allocates an array of ClackPort objects to be used by this component |
| Methods inherited from class net.clackrouter.component.base.ClackComponent |
|---|
createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, isHierarchical, log, notifyAlarm, poll, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setView, showErrorDialog, signalError, try_repaint, unregisterListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int PORT_IN
public static int PORT_OUT
public static int DEFAULT_LOSS
| Constructor Detail |
|---|
public Loss(Router r,
java.lang.String name)
public Loss(Router r,
java.lang.String name,
int loss)
| Method Detail |
|---|
protected void setupPorts(int numports)
ClackComponent
setupPorts in class ClackComponentnumports - the number of ports to createpublic boolean isModifying()
ClackComponent
isModifying in class ClackComponentpublic float getLoss()
public void setLoss(float l)
public void acceptPacket(VNSPacket packet,
int port_number)
acceptPacket in class ClackComponentpacket - The pushed packetport_number - The number of the port that this packet is arriving onpublic javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView in class ClackComponentpublic int getDrops()
public java.util.Properties getSerializableProperties(boolean isTransient)
getSerializableProperties in class ClackComponentisTransient - flag indicating if serialization is transient
public void initializeProperties(java.util.Properties props)
initializeProperties in class ClackComponentprops - all property values serialized for this componentpublic void dropNextPacket()
public java.awt.Color getColor()
ClackComponentThe color this component should be rendered in, assuming a standard component rendering by the
ComponentView.ComponentRenderer class.
Other renderers may ignore this value.
getColor in class ClackComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||