us.ihmc.mockets
Class Params

java.lang.Object
  extended by us.ihmc.mockets.Params

public class Params
extends java.lang.Object

Class to be used to encapsulate the communication parameters into a single object.


Constructor Summary
Params(int tag, short priority, long enqueueTimeout, long retryTimeout)
          Created a new object with the specified parameters.
 
Method Summary
protected  void finalize()
          Removes params object.
 long getEnqueueTimeout()
          Native method to extract the enqueue timeout that indicates the length of time in milliseconds for which the method will wait if there is no room in the outgoing buffer.
 short getPriority()
          Native method to extract the priority.
 long getRetryTimeout()
          Native method to extract the retry timeout from Params.
 int getTag()
          Native method to extract the tag.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Params

public Params(int tag,
              short priority,
              long enqueueTimeout,
              long retryTimeout)
       throws java.io.IOException,
              java.lang.IllegalArgumentException
Created a new object with the specified parameters.

Parameters:
tag - integer value that can be used to mark a flow of messages belonging to the same type. The value has to be >0.
priority - used to assign a priority different than the default one (higher or lower). The value has to be >0. Note that the priority of a message will grow every time it is skipped in favor of a higher priority messages that gets sent first. This mechanism is implemented to avoid message starvation. The range of priority values is 0-255.
enqueueTimeout - indicates the length of time in milliseconds for which the method will wait if there is no room in the outgoing buffer. A zero value indicates wait forever.
retryTimeout - indicates the length of time for which the transmitter will retransmit the packet to ensure successful delivery. A zero value indicates retry with no time limit. Note that this parameter makes sense only if the flow is reliable, otherwise the behavior is to transmit and forget about the packet.
Throws:
java.io.IOException
java.lang.IllegalArgumentException
See Also:
Mocket.Sender.send(byte[], us.ihmc.mockets.Params), Mocket.Sender.send(byte[], int, int, us.ihmc.mockets.Params)
Method Detail

finalize

protected void finalize()
Removes params object.

Overrides:
finalize in class java.lang.Object

getTag

public int getTag()
           throws java.io.IOException,
                  java.lang.IllegalArgumentException
Native method to extract the tag. A tag is an integer value that can be used to mark a flow of messages belonging to the same type. The value has to be >0.

Returns:
integer value of the tag.
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getPriority

public short getPriority()
                  throws java.io.IOException,
                         java.lang.IllegalArgumentException
Native method to extract the priority. The value has to be >0. The range of priority values is 0-255.

Returns:
integer representing the priority value.
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getEnqueueTimeout

public long getEnqueueTimeout()
                       throws java.io.IOException,
                              java.lang.IllegalArgumentException
Native method to extract the enqueue timeout that indicates the length of time in milliseconds for which the method will wait if there is no room in the outgoing buffer. A zero value indicates wait forever.

Returns:
value in milliseconds of the enqueue timeout.
Throws:
java.io.IOException
java.lang.IllegalArgumentException

getRetryTimeout

public long getRetryTimeout()
                     throws java.io.IOException,
                            java.lang.IllegalArgumentException
Native method to extract the retry timeout from Params. The retry timeout indicates the length of time for which the transmitter will retransmit the packet to ensure successful delivery. A zero value indicates retry with no time limit. Note that this parameter makes sense only if the flow is reliable, otherwise the behavior is to transmit and forget about the packet.

Returns:
value in milliseconds of the retry timeout.
Throws:
java.io.IOException
java.lang.IllegalArgumentException