|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.extension.Throttle
public class Throttle
Component to slow down the packet being passed through it in a user configurable manner. Delay is specified as a percentage of full router speed. Thus, 100 is full speed.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
static int |
DEFAULT_DELAY
|
static int |
NUM_PORTS
|
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 | |
---|---|
Throttle(Router r,
java.lang.String name)
|
|
Throttle(Router r,
java.lang.String name,
int delay)
|
Method Summary | |
---|---|
java.awt.Color |
getColor()
The color this component should be rendered in, assuming a standard component rendering by the ComponentView.ComponentRenderer class. |
int |
getDelay()
|
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)
Serialize the delay value for reloading the router |
VNSPacket |
handlePullRequest(int port_number)
Does not buffer components on its own, but rather performs a simple calculation to decide when to pass on the pull request on its output port on to the component connected to its input port. |
void |
initializeProperties(java.util.Properties props)
Load the saved delay value |
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 |
setDelay(int d)
|
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 |
---|
acceptPacket, createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getTime, getTypeName, getUniqueCount, getView, 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 NUM_PORTS
public static int DEFAULT_DELAY
Constructor Detail |
---|
public Throttle(Router r, java.lang.String name)
public Throttle(Router r, java.lang.String name, int delay)
Method Detail |
---|
protected void setupPorts(int numports)
ClackComponent
setupPorts
in class ClackComponent
numports
- the number of ports to createpublic boolean isModifying()
ClackComponent
isModifying
in class ClackComponent
public int getDelay()
public void setDelay(int d)
public VNSPacket handlePullRequest(int port_number)
handlePullRequest
in class ClackComponent
port_number
- The port that a packet is being requested on
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class ClackComponent
public java.util.Properties getSerializableProperties(boolean isTransient)
getSerializableProperties
in class ClackComponent
isTransient
- flag indicating if serialization is transient
public void initializeProperties(java.util.Properties props)
initializeProperties
in class ClackComponent
props
- all property values serialized for this componentpublic java.awt.Color getColor()
ClackComponent
The 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 |