drcl.inet.contract
Class IDConfig
java.lang.Object
drcl.comp.Contract
drcl.inet.contract.IDConfig
- public class IDConfig
- extends Contract
The IdentityConfiguration contract.
This contract defines three services at the reactor:
-
IdentityAddition
- The initiator sends a message that consists of:
- an integer of value 0 (the "add" command),
- the set of identities (
long[]) to be added, and
- the set of corresponding life periods (
double[]).
In response, the reactor adds the set of identities to its database and
each identity will stay for the time specified in the corresponding period
and then removed. One may specify a negative value or Double.NaN
as the period value to have the corresponding identity not removed.
-
IdentityRemoval
- The initiator sends a message that consists of:
- an integer of value 1 (the "remove" command) and
- the set of identities (
long[]) to be removed.
In response, the reactor removes the set of identities from its database.
-
IdentityTimeoutQuery
- The initiator sends a message that consists of:
- an integer of value 2 (the "query" command) and
- the set of identities (
long[]) in question.
In response, the reactor sends back the set of time values (double[]),
each of which corresponds to the time when the corresponding identity will
be removed.
This class also provides a set of static methods to faciliate conducting the
above services (add(..., Port), remove(..., Port) and
query(..., Port)) from the specified port.
These methods are particularly useful in implementing
a protocol that is in charge of maintaining the identities of the node.
|
Method Summary |
static void |
add(long[] id_,
double[] timeout_,
Port out_)
|
static void |
add(long id_,
double timeout_,
Port out_)
|
static java.lang.Object |
createAddRequest(long id_)
|
static java.lang.Object |
createAddRequest(long[] id_,
double[] timeout_)
|
static java.lang.Object |
createAddRequest(long id_,
double timeout_)
|
static java.lang.Object |
createQueryRequest()
|
static java.lang.Object |
createQueryRequest(long id_)
|
static java.lang.Object |
createQueryRequest(long[] id_)
|
static java.lang.Object |
createRemoveRequest(long id_)
|
static java.lang.Object |
createRemoveRequest(long[] id_)
|
java.lang.Object |
getContractContent()
Returns the content of this contract (format?). |
java.lang.String |
getName()
|
static double[] |
query(long[] id_,
Port out_)
|
static double |
query(long id_,
Port out_)
|
static void |
remove(long[] id_,
Port out_)
|
static void |
remove(long id_,
Port out_)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final IDConfig INSTANCE
ADD
public static final int ADD
- See Also:
- Constant Field Values
REMOVE
public static final int REMOVE
- See Also:
- Constant Field Values
QUERY
public static final int QUERY
- See Also:
- Constant Field Values
IDConfig
public IDConfig()
IDConfig
public IDConfig(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
add
public static void add(long id_,
double timeout_,
Port out_)
add
public static void add(long[] id_,
double[] timeout_,
Port out_)
remove
public static void remove(long id_,
Port out_)
remove
public static void remove(long[] id_,
Port out_)
query
public static double query(long id_,
Port out_)
query
public static double[] query(long[] id_,
Port out_)
createAddRequest
public static java.lang.Object createAddRequest(long id_)
createAddRequest
public static java.lang.Object createAddRequest(long id_,
double timeout_)
createAddRequest
public static java.lang.Object createAddRequest(long[] id_,
double[] timeout_)
createRemoveRequest
public static java.lang.Object createRemoveRequest(long id_)
createRemoveRequest
public static java.lang.Object createRemoveRequest(long[] id_)
createQueryRequest
public static java.lang.Object createQueryRequest()
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 ~