|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdrcl.DrclObj
drcl.comp.Component
drcl.net.traffic.TrafficComponent
drcl.net.traffic.TrafficSourceComponent
Defines the base class for implementing a traffic source.
The output of a traffic source conforms to the associated
traffic model instance.
One must provide a random seed to this component via setSeed(long)
before starting it. The component outputs FooPacket's.
If timestamping is enabled (setTimestampEnabled(boolean)),
the component outputs TimestampedFooPacket's instead which is a sublcass
of FooPacket.
Subclasses must override the #setNextPacket(FooPacket) method to
set the size of next outputted packet and return its birth time.
In addition, a subclass should override the info(String) to provide
the content of
this source component. Buffer operations are taken care of in this class.
TrafficModel,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class drcl.comp.Component |
Component.Locks |
| Field Summary |
| Constructor Summary | |
TrafficSourceComponent()
|
|
TrafficSourceComponent(java.lang.String id_)
|
|
| Method Summary | |
void |
_resume()
Resumes generating packets. |
void |
_start()
|
void |
_stop()
Stops generating packets. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
int |
getBufferSize()
Returns the (maximum) buffer size of this traffic shaper (byte). |
long |
getSeed()
|
TrafficShaper |
getShaper()
Returns the installed traffic shaper
(if there is any). |
java.lang.String |
info(java.lang.String prefix_)
Prints the content of this source component. |
boolean |
isSendUnshapedTrafficEnabled()
Returns true if outputting of unshaped traffic (through the timer port) is enabled. |
boolean |
isTimestampEnabled()
Returns true if timestamping generated packets is enabled. |
void |
reset()
Resets the component for being used anew. |
void |
setBufferSize(int size_)
Sets the (maximum) buffer size of the installed traffic shaper (byte). |
void |
setSeed(long seed_)
|
void |
setSendUnshapedTrafficEnabled(boolean enabled_)
Enables/disables outputting of unshaped traffic (through the timer port). |
void |
setShaper(TrafficShaper shaper_)
Adds a traffic shaper to the output of this
source. |
void |
setTimestampEnabled(boolean enabled_)
Enables/disables timestamping generated packets. |
| Methods inherited from class drcl.net.traffic.TrafficComponent |
getPacketWrapper, getTrafficModel, info, setPacketWrapper, setTrafficModel |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TrafficSourceComponent()
public TrafficSourceComponent(java.lang.String id_)
| Method Detail |
public void reset()
Component
reset in class Componentpublic void setSeed(long seed_)
public long getSeed()
public void duplicate(java.lang.Object source_)
Component
duplicate in interface ObjectDuplicableduplicate in class TrafficComponentpublic java.lang.String info(java.lang.String prefix_)
super.info(prefix_) and print out
the parameters defined in the subclass.
info in class TrafficComponentprefix_ - prefix that shoud be prepended at the beginning of each line
of the result.public void _start()
public void _stop()
public void _resume()
public void setShaper(TrafficShaper shaper_)
traffic shaper to the output of this
source.
public TrafficShaper getShaper()
traffic shaper
(if there is any).
public void setBufferSize(int size_)
public int getBufferSize()
public void setSendUnshapedTrafficEnabled(boolean enabled_)
public boolean isSendUnshapedTrafficEnabled()
public void setTimestampEnabled(boolean enabled_)
TimestampedFooPacket's.
public boolean isTimestampEnabled()
|
DRCL J-Sim API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||