GigaSpaces XAP 9.5 API

net.jini.lease
Class LeaseUnmarshalException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by net.jini.lease.LeaseUnmarshalException
All Implemented Interfaces:
Serializable

public class LeaseUnmarshalException
extends Exception

Exception thrown when a lease renewal set can't unmarshal one or more leases being returned by a getLeases call.

When unmarshalling an instance of MarshalledObject, one of the following checked exceptions is possible: an IOException can occur while deserializing the object from its internal representation; and a ClassNotFoundException can occur if, while deserializing the object from its internal representation, either the class file of the object cannot be found, or the class file of either an interface or a class referenced by the object being deserialized cannot be found. Typically, a ClassNotFoundException occurs when the codebase from which to retrieve the needed class file is not currently available.

This class provides a mechanism that clients of the lease renewal service may use for efficient handling of the exceptions that may occur when unmarshalling elements of a set of marshalled Lease objects. When elements in such a set are unmarshalled, the LeaseUnmarshalException class may be used to collect and report pertinent information generated when failure occurs while unmarshalling the elements of the set.

The information that may be of interest to entities that receive this exception class is contained in the following fields: a set of Lease objects in which each element is the result of a successful unmarshalling attempt, a set of marshalled Lease objects in which each element could not be successfully unmarshalled, and a set of exceptions (IOException, ClassNotFoundException, or some unchecked exception) in which each element corresponds to one of the unmarshalling failures.

Thus, when exceptional conditions occur while unmarshalling a set of marshalled Lease objects, this class can be used not only to indicate that an exceptional condition has occurred, but also to provide information that can be used to perform error handling activities such as: determining if it is feasible to continue with processing, reporting errors, attempting recovery, and debugging.

Note that this exception class should be used only to report exceptional conditions occurring when unmarshalling a set of marshalled Lease objects.

Author:
Sun Microsystems, Inc.
See Also:
Lease, Serialized Form

Constructor Summary
LeaseUnmarshalException(Lease[] leases, MarshalledObject[] marshalledLeases, Throwable[] exceptions)
          Constructs a new instance of LeaseUnmarshalException.
LeaseUnmarshalException(String message, Lease[] leases, MarshalledObject[] marshalledLeases, Throwable[] exceptions)
          Constructs a new instance of LeaseUnmarshalException with a specified message.
 
Method Summary
 Throwable[] getExceptions()
          Accessor method that returns an array consisting of instances of Throwable, where each element of the array corresponds to one of the exceptions that occurred during the unmarshalling process.
 Lease[] getLeases()
          Accessor method that returns an array consisting of instances of Lease, where each element of the array corresponds to a successfully unmarshalled object.
 MarshalledObject[] getMarshalledLeases()
          Accessor method that returns an array consisting of instances of MarshalledObject, where each element of the array is a marshalled instance of the Lease interface, and corresponds to an object that could not be successfully unmarshalled.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LeaseUnmarshalException

public LeaseUnmarshalException(String message,
                               Lease[] leases,
                               MarshalledObject[] marshalledLeases,
                               Throwable[] exceptions)
Constructs a new instance of LeaseUnmarshalException with a specified message.

Parameters:
leases - array containing the set of instances of Lease that were successfully unmarshalled
marshalledLeases - array containing the set of marshalled Lease instances that could not be unmarshalled
exceptions - array containing the set of exceptions that occurred during the unmarshalling process. Each element in this set should be an instance of IOException, ClassNotFoundException, or some unchecked exception. Furthermore, there should be a one-to-one correspondence between each element in this set and each element in the marshalledLeases argument.

That is, the element of this set corresponding to index i should be an instance of the exception that occurred while attempting to unmarshal the element at index i of the marshalledLeases argument.

message - the detail message
Throws:
IllegalArgumentException - when the number of elements in the exceptions argument is not equal to the number of elements in the marshalledLeases argument

LeaseUnmarshalException

public LeaseUnmarshalException(Lease[] leases,
                               MarshalledObject[] marshalledLeases,
                               Throwable[] exceptions)
Constructs a new instance of LeaseUnmarshalException.

Parameters:
leases - array containing the set of instances of Lease that were successfully unmarshalled
marshalledLeases - array containing the set of marshalled Lease instances that could not be unmarshalled
exceptions - array containing the set of exceptions that occurred during the unmarshalling process. Each element in this set should be an instance of IOException, ClassNotFoundException, or some unchecked exception. Furthermore, there should be a one-to-one correspondence between each element in this set and each element in the marshalledLeases argument.

That is, the element of this set corresponding to index i should be an instance of the exception that occurred while attempting to unmarshal the element at index i of the marshalledLeases argument.

Throws:
IllegalArgumentException - when the number of elements in the exceptions argument is not equal to the number of elements in the marshalledLeases argument
Method Detail

getLeases

public Lease[] getLeases()
Accessor method that returns an array consisting of instances of Lease, where each element of the array corresponds to a successfully unmarshalled object. Note that the same array is returned on each invocation of this method; that is, a copy is not made.

Returns:
array of instances of Lease, where each element corresponds to a successfully unmarshalled object

getMarshalledLeases

public MarshalledObject[] getMarshalledLeases()
Accessor method that returns an array consisting of instances of MarshalledObject, where each element of the array is a marshalled instance of the Lease interface, and corresponds to an object that could not be successfully unmarshalled. Note that the same array is returned on each invocation of this method; that is, a copy is not made.

Returns:
array of marshalled instances of Lease, where each element corresponds to an object in which failure occurred while attempting to unmarshal the object

getExceptions

public Throwable[] getExceptions()
Accessor method that returns an array consisting of instances of Throwable, where each element of the array corresponds to one of the exceptions that occurred during the unmarshalling process. Note that the same array is returned on each invocation of this method; that is, a copy is not made.

Each element in the return set should be an instance of IOException, ClassNotFoundException, or some unchecked exception. Additionally, there should be a one-to-one correspondence between each element in the array returned by this method and the array returned by the getMarshalledLeases method. That is, the i-th element of the set returned by this method should be an instance of the exception that occurred while attempting to unmarshal the i-th element of the set returned by the getMarshalledLeases method.

Returns:
array of instances of Throwable, where each element corresponds to one of the exceptions that occurred during the unmarshalling process

GigaSpaces XAP 9.5 API

Copyright © GigaSpaces.