GigaSpaces XAP 9.7.2 API

com.sun.jini.lease
Class BasicRenewalFailureEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.jini.core.event.RemoteEvent
          extended by net.jini.lease.RenewalFailureEvent
              extended by 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

Field Summary
 
Fields inherited from class net.jini.core.event.RemoteEvent
eventID, handback, seqNum, source
 
Constructor Summary
BasicRenewalFailureEvent(LeaseRenewalSet source, long seqNum, MarshalledObject handback, MarshalledInstance marshalledLease, MarshalledInstance marshalledThrowable)
          Simple constructor.
 
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.
 
Methods inherited from class net.jini.core.event.RemoteEvent
getID, getRegistrationObject, getSequenceNumber
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 event
seqNum - the sequence number of this event
handback - the client handback
marshalledLease - the lease which could not be renewed, in marshalled form
marshalledThrowable - 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.
Method Detail

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

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.