com.sun.jini.lease
Class BasicRenewalFailureEvent
java.lang.Object
java.util.EventObject
net.jini.core.event.RemoteEvent
net.jini.lease.RenewalFailureEvent
com.sun.jini.lease.BasicRenewalFailureEvent
- All Implemented Interfaces:
- Serializable
public class BasicRenewalFailureEvent
- extends RenewalFailureEvent
Basic implementation of 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.
- Author:
- Sun Microsystems, Inc.
- See Also:
LeaseRenewalSet
,
Serialized Form
Method Summary |
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. |
BasicRenewalFailureEvent
public BasicRenewalFailureEvent(LeaseRenewalSet source,
long seqNum,
MarshalledObject handback,
MarshalledInstance marshalledLease,
MarshalledInstance marshalledThrowable)
- Simple constructor. Note event id is fixed to
LeaseRenewalSet.RENEWAL_FAILURE_EVENT_ID
.
- Parameters:
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
.
getLease
public Lease getLease()
throws IOException,
ClassNotFoundException
- Returns the lease that could not be renewed. When the event is
deserialized, the lease 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 lease.
Once the lease is successfully unmarshalled it is cached in a
transient field so future calls will not result in
IOException
or
ClassNotFoundException
.
- Specified by:
getLease
in class RenewalFailureEvent
- Returns:
- the unmarshalled lease
- Throws:
IOException
- if there are problems unmarshalling the lease,
usually because of some sort of class mismatch
ClassNotFoundException
- if there are problems unmarshalling the
lease, usually because one of the classes associated with the
lease's implementation could not be loaded
SecurityException
- if this object was unmarshalled from a stream
that required codebase integrity, and the integrity of the
lease's codebase could not be verified
getThrowable
public Throwable getThrowable()
throws IOException,
ClassNotFoundException
- Returns the exception (if any) that was thrown by the last renewal
attempt.
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
.
- Specified by:
getThrowable
in class RenewalFailureEvent
- Returns:
- the unmarshalled exception
- Throws:
IOException
- if there are problems unmarshalling the exception,
usually because of some sort of class mismatch
ClassNotFoundException
- if there are problems unmarshalling the
exception, usually because one of the classes associated with
the exception's implementation could not be loaded
SecurityException
- if this object was unmarshalled from a stream
that required codebase integrity, and the integrity of the
exception's codebase could not be verified
Copyright © GigaSpaces.