class Registration extends Object implements MailboxPullRegistration, Serializable, ReferentUuid
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Registration.ConstrainableRegistration
A subclass of Registration that implements RemoteMethodControl.
|
Modifier and Type | Field and Description |
---|---|
(package private) Lease |
lease
The service's registration lease
|
(package private) ListenerProxy |
listener
Reference to service provided RemoteEventListener implementation
|
(package private) MailboxBackEnd |
mailbox
Reference to service implementation
|
(package private) Uuid |
registrationID
Unique identifier for this registration
|
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
private |
Registration(Uuid id,
MailboxBackEnd srv,
Lease l)
Convenience constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addUnknownEvents(Collection unknownEvents)
Adds the provided collection of unknown events to this registration.
|
(package private) static Registration |
create(Uuid id,
MailboxBackEnd server,
Lease lease)
Creates a mailbox registration proxy, returning an instance
that implements RemoteMethodControl if the server does too.
|
void |
disableDelivery()
Ceases delivery of stored notifications to the existing
target listener, if any.
|
void |
enableDelivery(RemoteEventListener target)
Initiates delivery of stored notifications to the supplied
target listener, if any. |
boolean |
equals(Object o)
Proxies with the same registrationID are considered equal.
|
Lease |
getLease()
Returns the
Lease object associated
with this registration. |
RemoteEventListener |
getListener()
Returns the
RemoteEventListener associated
with this registration. |
Uuid |
getReferentUuid()
Returns the universally unique identifier that has been assigned to the
resource this proxy represents.
|
RemoteEventIterator |
getRemoteEvents()
Retrieves stored notifications, if any.
|
int |
hashCode()
Proxies with the same registrationID have the same hash code.
|
private void |
readObject(ObjectInputStream s)
When an instance of this class is deserialized, this method is
automatically invoked.
|
private void |
readObjectNoData()
During deserialization of an instance of this class, if it is found
that the stream contains no data, this method is automatically
invoked.
|
private static final long serialVersionUID
final Uuid registrationID
final MailboxBackEnd mailbox
final ListenerProxy listener
final Lease lease
private Registration(Uuid id, MailboxBackEnd srv, Lease l)
static Registration create(Uuid id, MailboxBackEnd server, Lease lease)
server
- the server proxyid
- the ID of the lease setlease
- the lease set's leasepublic Lease getLease()
MailboxRegistration
Lease
object associated
with this registration. The client can renew or
cancel the registration with the mailbox service
through this lease object.getLease
in interface MailboxRegistration
public RemoteEventListener getListener()
MailboxRegistration
RemoteEventListener
associated
with this registration. This listener can then be submitted
as the RemoteEventListener
argument to an
event generator's registration method(s).getListener
in interface MailboxRegistration
RemoteEventListener
associated
with this registration.public void enableDelivery(RemoteEventListener target) throws RemoteException
MailboxRegistration
target
listener, if any. If a target listener
already exists, then it will be replaced with the specified
target listener. Passing null
as the
target
parameter has the same effect as calling
the disableDelivery
method.enableDelivery
in interface MailboxRegistration
target
- The listener to be notified of stored events, if any.RemoteException
- if there is
a communication failure between the client and the service.public void disableDelivery() throws RemoteException
MailboxRegistration
disableDelivery
in interface MailboxRegistration
RemoteException
- if there is
a communication failure between the client and the service.public RemoteEventIterator getRemoteEvents() throws RemoteException
MailboxPullRegistration
getRemoteEvents
in interface MailboxPullRegistration
RemoteEventIterator
that can be used to retrieve
event notifications from the mailbox service.RemoteException
- if there is
a communication failure between the client and the service.public void addUnknownEvents(Collection unknownEvents) throws RemoteException
MailboxPullRegistration
UnknownEventException
back to any event generator that attempts to deliver an event with an
identifier-source combination held in a registration's unknown
exception list.addUnknownEvents
in interface MailboxPullRegistration
unknownEvents
- A Collection
of unknown events
to be associated with this registration.RemoteException
- if there is
a communication failure between the client and the service.public Uuid getReferentUuid()
getReferentUuid
in interface ReferentUuid
Uuid
that is associated with the
resource this proxy represents. This method will not return
null
.ReferentUuid
public int hashCode()
public boolean equals(Object o)
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
InvalidObjectException
- if the state of the
deserialized instance of this class is found to be invalid.IOException
ClassNotFoundException
private void readObjectNoData() throws ObjectStreamException
InvalidObjectException
- to indicate that there
was no data in the stream during deserialization of an
instance of this class; declaring that something is wrong.ObjectStreamException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.