drcl.inet.contract
Class IDLookup
java.lang.Object
drcl.comp.Contract
drcl.inet.contract.IDLookup
- public class IDLookup
- extends Contract
The IdentityLookup contract.
This contract defines three services at the reactor:
-
DefaultIdentityRetrieval
- The initiator sends a
drcl.data.IntObj
of value 0 and the reactor returns the default identity
(drcl.data.LongObj) stored at the reactor.
-
AllIdentitiesRetrieval
- The initiator sends a
drcl.data.IntObj
of value 1 and the reactor returns all the identities
(long[]) stored at the reactor.
-
IdentitiesQuery
- The initiator sends identities in question (
long[])
and the reactor sends back the corresponding answers in
the boolean[] array of the same size.
The value true indicates the corresponding identity
exists in the reactor.
This class also provides a set of static methods to facilitate conducting
the above services
(getDefaultID(Port),
getAllIDs(Port) and query(..., Port))
from the specified port. These methods are particularly useful in implementing
a protocol that needs to be aware of the identities of the node.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GET_DEFAULT
public static final int GET_DEFAULT
- See Also:
- Constant Field Values
GET_ALL
public static final int GET_ALL
- See Also:
- Constant Field Values
IDLookup
public IDLookup()
IDLookup
public IDLookup(int role_)
getName
public java.lang.String getName()
- Specified by:
getName in class Contract
getContractContent
public java.lang.Object getContractContent()
- Description copied from class:
Contract
- Returns the content of this contract (format?).
- Specified by:
getContractContent in class Contract
getDefaultID
public static long getDefaultID(Port out_)
getAllIDs
public static long[] getAllIDs(Port out_)
query
public static boolean query(long id_,
Port out_)
query
public static boolean[] query(long[] ids_,
Port out_)
createGetDefaultRequest
public static java.lang.Object createGetDefaultRequest()
createGetAllRequest
public static java.lang.Object createGetAllRequest()
createQueryRequest
public static java.lang.Object createQueryRequest(long id_)
createQueryRequest
public static java.lang.Object createQueryRequest(long[] id_)
Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved. ~ To J-Sim Home ~