public class BasicRenewalFailureEvent extends RenewalFailureEvent
RenewalFailureEvent
that
defers unmarshalling.
The Lease
that could not be renewed and any
accompanying Throwable
will not be deserialized until
the appropriate accessor is called.
LeaseRenewalSet
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Lease |
lease
Transient cache of lease returned by
getLease method. |
private MarshalledInstance |
marshalledLease
Lease, in marshalled form, returned by
getLease method. |
private MarshalledInstance |
marshalledThrowable
Exception, in marshalled form, returned by
getThrowable
method. |
private static long |
serialVersionUID |
private Throwable |
throwable
Transient cache of exception returned by
getThrowable
method. |
private boolean |
verifyCodebaseIntegrity
Whether to verify codebase integrity.
|
eventID, handback, seqNum, source
Constructor and Description |
---|
BasicRenewalFailureEvent(LeaseRenewalSet source,
long seqNum,
MarshalledObject handback,
MarshalledInstance marshalledLease,
MarshalledInstance marshalledThrowable)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
Lease |
getLease()
Returns the lease that could not be renewed.
|
Throwable |
getThrowable()
Returns the exception (if any) that was thrown by the last renewal
attempt.
|
private void |
readObject(ObjectInputStream in) |
getID, getRegistrationObject, getSequenceNumber
getSource, toString
private static final long serialVersionUID
private MarshalledInstance marshalledThrowable
getThrowable
method. May be null
.private MarshalledInstance marshalledLease
getLease
method.private transient Lease lease
getLease
method.private transient Throwable throwable
getThrowable
method.private transient boolean verifyCodebaseIntegrity
public BasicRenewalFailureEvent(LeaseRenewalSet source, long seqNum, MarshalledObject handback, MarshalledInstance marshalledLease, MarshalledInstance marshalledThrowable)
LeaseRenewalSet.RENEWAL_FAILURE_EVENT_ID
.source
- the LeaseRenewalSet
that generated the eventseqNum
- the sequence number of this eventhandback
- the client handbackmarshalledLease
- the lease which could not be renewed, in
marshalled formmarshalledThrowable
- the first exception that was thrown in the
last chain of renewal failures, in marshalled form. May be
null
in which case getThrowable
will
return null
.public Lease getLease() throws IOException, ClassNotFoundException
IOException
or
ClassNotFoundException
.getLease
in class RenewalFailureEvent
IOException
- if there are problems unmarshalling the lease,
usually because of some sort of class mismatchClassNotFoundException
- if there are problems unmarshalling the
lease, usually because one of the classes associated with the
lease's implementation could not be loadedSecurityException
- if this object was unmarshalled from a stream
that required codebase integrity, and the integrity of the
lease's codebase could not be verifiedpublic Throwable getThrowable() throws IOException, ClassNotFoundException
When the event is deserialized, the exception is
left in marshalled form. It is only unmarshalled when this call
is made. If a call to this method fails, future calls will
attempt to re-unmarshal the exception. Once the
exception is successfully unmarshalled it is
cached in a transient field so future calls will not result in
IOException
or
ClassNotFoundException
.
getThrowable
in class RenewalFailureEvent
IOException
- if there are problems unmarshalling the exception,
usually because of some sort of class mismatchClassNotFoundException
- if there are problems unmarshalling the
exception, usually because one of the classes associated with
the exception's implementation could not be loadedSecurityException
- if this object was unmarshalled from a stream
that required codebase integrity, and the integrity of the
exception's codebase could not be verifiedprivate void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.