|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.portico.shared.MulticastLookup
public class MulticastLookup
This class provides utility methods for communicating with the
MulticastRegistry
that resides in the RTI. These methods are generally
used to dynamically discover bindings connection information, but they can be used to look up
any name/value pair information provided by the MulticastRegistry
.
Field Summary | |
---|---|
private static MulticastLookup |
INSTANCE
|
private org.apache.log4j.Logger |
logger
|
private static Random |
RANDOM
|
Constructor Summary | |
---|---|
MulticastLookup()
|
Method Summary | |
---|---|
private String |
_lookup(String request)
This method performs the lookup described in lookup(String) |
private String |
getResponse(String received)
Extracts and returns the response text from the given packet information. |
private String |
getSerialNumber(String received)
Extracts and returns the serial number on the incoming packet information. |
static String |
lookup(String binding)
This method performs the actual lookup, passing the given string as the request key. |
private int |
newSerialNumber()
Generate a new serial number to append to the request so we can identify the response when it comes back. |
private boolean |
validNotification(String received,
int serial)
Returns true if this is a valid notification (that is, it is a response and has the same serial number as the one we sent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final MulticastLookup INSTANCE
private static final Random RANDOM
private org.apache.log4j.Logger logger
Constructor Detail |
---|
public MulticastLookup()
Method Detail |
---|
private String _lookup(String request) throws Exception
lookup(String)
Exception
private int newSerialNumber()
private boolean validNotification(String received, int serial)
received
- The received notificationserial
- Our serial number
private String getSerialNumber(String received)
IllegalArgumentException
is thrown
private String getResponse(String received)
IllegalArgumentException
is thrown
public static String lookup(String binding) throws Exception
MulticastRegistry
for low-level information on how messages are
formatted when communicating with the registry.
The returned string is the value received in response to the request and constitutes the
value stored in the registry for the given request key. If there is an error communicating
with the registry, or the registry sends back an error response (perhaps it couldn't find
any value for the key), an exception will be thrown. Note that the return value has had any
packaging information (such as serial numbers or success/error codes) stripped from it before
it is returned.
Exception
|
copyright The Portico Project 2008. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |