|
J-Sim v1.2.1-p7 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.
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 | |
protected long |
seed
The seed of the random number generator. |
| Fields inherited from class drcl.net.traffic.TrafficComponent |
downPort, timerPort |
| Constructor Summary | |
TrafficSourceComponent()
|
|
TrafficSourceComponent(java.lang.String id_)
|
|
| Method Summary | |
void |
_resume()
Resumes generating packets. |
void |
_start()
This method is invoked in a new thread context when Component.run() is called. |
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()
|
protected void |
process(java.lang.Object data_,
Port inPort_)
The main callback method of a component. |
void |
reset()
Resets the component for being used anew. |
void |
setBufferSize(int size_)
Sets the (maximum) buffer size of the installed traffic shaper (byte). |
protected abstract double |
setNextPacket(FooPacket pkt_)
Sets up next packet. |
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_)
|
| 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected long seed
| Constructor Detail |
public TrafficSourceComponent()
public TrafficSourceComponent(java.lang.String id_)
| Method Detail |
protected abstract double setNextPacket(FooPacket pkt_)
Double.NaN if this source has sent out all the
packets.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.
protected void process(java.lang.Object data_,
Port inPort_)
Component
process in class Componentdata_ - the arrival data.inPort_ - the port where the data arrives.public void _start()
ComponentComponent.run() is called.
An ActiveComponent subclass must override this method to start this component.
_start in class Componentpublic void _stop()
_stop in class Componentpublic void _resume()
_resume in class Componentpublic 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_)
public boolean isTimestampEnabled()
|
J-Sim v1.2.1-p7 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||