public class FabricDevice extends java.lang.Object implements FabricDeviceInterface
Constructor and Description |
---|
FabricDevice(DatagramDevice ep,
NetIFListener l)
Default fabric device has no queue
|
Modifier and Type | Method and Description |
---|---|
boolean |
addToInQueue(Datagram dg,
DatagramDevice dd)
Returns true if datagram is sent or false if dropped
|
boolean |
addToInQueue(Datagram dg,
DatagramDevice dd,
usr.router.Waker waitObj)
Add a datagram to the in queue -- true means sent to out queue, false means blocked
|
boolean |
addToOutQueue(usr.router.DatagramHandle dh)
Add a datagram to the out queue -- return true if datagram
added to out queue, false means rejected
|
boolean |
addToOutQueue(usr.router.DatagramHandle dh,
usr.router.Waker waitObj)
Add a datagram to the out queue --
true means added to out queue, false means rejected
|
boolean |
blockingAddToInQueue(Datagram dg,
DatagramDevice dd)
Add a datagram to the in queue -- blocking call, will continue to wait until
datagram is added
|
boolean |
blockingAddToOutQueue(usr.router.DatagramHandle dh)
Add a datagram to the out queue -- blocking call, will continue to wait until
datagram is added
|
NetIFListener |
getListener()
Get the listener device
|
NetStats |
getNetStats() |
protected void |
inQueueHasCapacity()
A callback from the InQueueHandler to say
that the queue has some space.
|
protected void |
outQueueHasCapacity()
A callback from the OutQueueHandler to say
that the queue has some space.
|
boolean |
sendOutDatagram(usr.router.DatagramHandle dh)
Send the outbound Datagram onwards
|
void |
setInQueueDiscipline(int discipline)
Set the queue type for the inbound queue
|
void |
setInQueueLength(int len)
Set the queue length for the inbound queue
|
void |
setListener(NetIFListener l)
Set the listener device for this fabric device
|
void |
setOutQueueDiscipline(int discipline)
Set the queue type for the outbound queue
|
void |
setOutQueueLength(int len)
Set the queue length for the outbound queue
|
void |
start()
Start the device
|
void |
stop()
Stop any running threads
|
boolean |
transferDatagram(usr.router.DatagramHandle dh)
transfer datagram from in queue to out queue using no queue discipline
add right now or drop
|
public FabricDevice(DatagramDevice ep, NetIFListener l)
public void setInQueueDiscipline(int discipline)
public void setOutQueueDiscipline(int discipline)
public void setInQueueLength(int len)
public void setOutQueueLength(int len)
public void start()
FabricDeviceInterface
start
in interface FabricDeviceInterface
public boolean blockingAddToInQueue(Datagram dg, DatagramDevice dd) throws java.net.NoRouteToHostException
blockingAddToInQueue
in interface FabricDeviceInterface
java.net.NoRouteToHostException
public boolean addToInQueue(Datagram dg, DatagramDevice dd) throws java.net.NoRouteToHostException
addToInQueue
in interface FabricDeviceInterface
java.net.NoRouteToHostException
public boolean addToInQueue(Datagram dg, DatagramDevice dd, usr.router.Waker waitObj) throws java.net.NoRouteToHostException, InterfaceBlockedException
java.net.NoRouteToHostException
InterfaceBlockedException
protected void inQueueHasCapacity()
public NetStats getNetStats()
public void setListener(NetIFListener l)
public NetIFListener getListener()
public boolean blockingAddToOutQueue(usr.router.DatagramHandle dh) throws java.net.NoRouteToHostException
java.net.NoRouteToHostException
public boolean addToOutQueue(usr.router.DatagramHandle dh) throws java.net.NoRouteToHostException, InterfaceBlockedException
java.net.NoRouteToHostException
InterfaceBlockedException
public boolean addToOutQueue(usr.router.DatagramHandle dh, usr.router.Waker waitObj) throws java.net.NoRouteToHostException, InterfaceBlockedException
java.net.NoRouteToHostException
InterfaceBlockedException
protected void outQueueHasCapacity()
public boolean transferDatagram(usr.router.DatagramHandle dh) throws java.net.NoRouteToHostException
java.net.NoRouteToHostException
public boolean sendOutDatagram(usr.router.DatagramHandle dh) throws InterfaceBlockedException
InterfaceBlockedException
public void stop()
stop
in interface FabricDeviceInterface
User Space Routing 0.10.3