private static final class FiddlerImpl.RegistrationInfo extends Object implements Comparable, Serializable
Modifier and Type | Field and Description |
---|---|
boolean |
discardFlag
When the lookup discovery service discards a registrar as a
result of some internal condition (such as multicast announcements
ceasing) and not as a result of a request from a registration,
every registration configured for group discovery of that discarded
registrar will be sent a remote discarded event.
|
HashMap |
discoveredRegsMap
Map from the set of instances of the
ServiceRegistrar
interface, to the set of marshalled instances of the
ServiceRegistrar interface, where each key and
each value (which is the marshalled form of its corresponding
key) is a proxy to one of the lookup service(s) that have been
discovered for the current registration. |
long |
eventID
The identifier that maps the current registration to the remote
event listener and the managed set of groups and locators.
|
HashSet |
groups
The managed set containing the names of the groups whose
members are the lookup services the lookup discovery service
should attempt to discover for the current registration.
|
MarshalledObject |
handback
The handback object returned with every remote discovery event
sent to the current registration's listener.
|
long |
leaseExpiration
The absolute expiration time of the current lease.
|
Uuid |
leaseID
The ID of the lease placed on the current registration.
|
RemoteEventListener |
listener
The remote event listener registered by the client.
|
HashSet |
locators
The managed set containing the locators of the specific lookup
services the lookup discovery service should attempt to discover
for the current registration.
|
Uuid |
registrationID
The unique identifier assigned to the registration to which the
data in the current implementation of this class corresponds.
|
long |
seqNum
The current sequence number of the set of remote discovery events
sent to the current registration's listener.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
FiddlerImpl.RegistrationInfo(Uuid registrationID,
String[] groups,
LookupLocator[] locators,
Uuid leaseID,
long leaseExpiration,
long eventID,
MarshalledObject handback,
RemoteEventListener listener)
Constructs an instance of this class and stores the information
related to the current registration: IDs, managed sets, lease
information, and event registration information.
|
Modifier and Type | Method and Description |
---|---|
HashMap |
addToDiscoveredRegs(HashMap regMapIn)
Attempts to marshal each element of the input set of instances of
the
ServiceRegistrar interface and then map the
registrar to its marshalled form, and store the mapping in this
registration's discoveredRegsMap field. |
int |
compareTo(Object obj)
Performs a primary sort by leaseExpiration, and a secondary sort
by registrationID.
|
private void |
readObject(ObjectInputStream stream)
When this class is deserialized, this method is invoked.
|
private void |
writeObject(ObjectOutputStream stream)
When a registration is granted to a client, the client registers
a remote listener with the lookup discovery service so that the
lookup discovery service may send remote discovery events to the
client.
|
private static final long serialVersionUID
public final Uuid registrationID
public HashMap discoveredRegsMap
ServiceRegistrar
interface, to the set of marshalled instances of the
ServiceRegistrar
interface, where each key and
each value (which is the marshalled form of its corresponding
key) is a proxy to one of the lookup service(s) that have been
discovered for the current registration. The contents of
this set represents the 'remote state' of the registration's
currently discovered lookup service(s).public HashSet groups
public HashSet locators
public final Uuid leaseID
public long leaseExpiration
public long eventID
public long seqNum
public final MarshalledObject handback
public boolean discardFlag
public transient RemoteEventListener listener
writeObject
below.)public FiddlerImpl.RegistrationInfo(Uuid registrationID, String[] groups, LookupLocator[] locators, Uuid leaseID, long leaseExpiration, long eventID, MarshalledObject handback, RemoteEventListener listener)
public HashMap addToDiscoveredRegs(HashMap regMapIn)
ServiceRegistrar
interface and then map the
registrar to its marshalled form, and store the mapping in this
registration's discoveredRegsMap
field.
This method is typically invoked to handle discovered (as opposed to discarded) registrars. Note that if a particular registrar cannot be serialized (marshalled), it is not included in the mapping; nor is it included in the return set.
regMapIn
- mapping in which the key values are the registrars
to serialize and store, and the map values are data
structures of type LocatorGroupsStruct
that contain the locator and member groups of the
corresponding registrar keyHashMap
whose keys are the registrars
whose marshalled form and un-marshalled form were inserted
as key/value pairs into the discoveredRegsMap
field of this regInfo; and whose values are the member
groups of each corresponding registrar key.public int compareTo(Object obj)
TreeMap
).compareTo
in interface Comparable
private void writeObject(ObjectOutputStream stream) throws IOException
ObjectOutputStream
which only serializes the
listener; it does not marshal the listener. Thus, when the
listener field of this class is logged, unless special action
is taken, the codebase from which to retrieve the listener will
not be included in the output.
In order to include the codebase with the listener when saving
state, the following custom writeObject
method
is provided which first serializes the current instance of
this class (excluding the transient listener
field),
and then explicitly marshals the listener to preserve the
codebase upon writing to the file. In this way, the listener --
along with its codebase -- is persisted through a mechanism that
is separate from the normal mechanism applied to the remaining
fields of this class.IOException
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
writeObject
above.)IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.