public class EventRegistration extends Object implements Serializable
A registration of interest in some kind of event that occurs within the scope of a transaction is leased in the same way as other event interest registrations. However, the duration of the registration is the minimum of the length of the lease and the duration of the transaction. Simply put, when the transaction ends (either because of a commit or an abort) the interest registration also ends. This is true even if the lease for the event registration has not expired and no call has been made to cancel the lease.
Modifier and Type | Field and Description |
---|---|
private long |
eventID
The event identifier.
|
private Lease |
lease
The registration lease.
|
private long |
seqNum
The current sequence number.
|
private static long |
serialVersionUID |
private Object |
source
The event source.
|
Constructor and Description |
---|
EventRegistration(long eventID,
Object source,
Lease lease,
long seqNum)
Constructs an EventRegistration object.
|
Modifier and Type | Method and Description |
---|---|
long |
getID()
Returns the identifier that will be used in all RemoteEvents generated
for this interest registration.
|
Lease |
getLease()
Returns the Lease object for this registration.
|
long |
getSequenceNumber()
Returns the value of the sequence number on the event kind that was
current when the registration was granted, allowing comparison with
the sequence number in any subsequent notifications.
|
Object |
getSource()
Returns the source that will be used in all RemoteEvents generated
for this interest registration.
|
private void |
readObject(ObjectInputStream in)
Default read object, in case of future evolution.
|
private static final long serialVersionUID
private final long eventID
private final Object source
private final Lease lease
private final long seqNum
public EventRegistration(long eventID, Object source, Lease lease, long seqNum)
eventID
- a long representing the event identifiersource
- an Object representing the event sourcelease
- the registration Lease objectseqNum
- a long representing the current
sequence numberpublic long getID()
RemoteEvent.getID()
public Object getSource()
EventObject.getSource()
public Lease getLease()
public long getSequenceNumber()
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
in
- IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.