public class LeaseUnmarshalException extends AtomicException
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.
Lease
,
Serialized FormConstructor and Description |
---|
LeaseUnmarshalException(AtomicSerial.GetArg arg) |
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. |
Modifier and Type | Method and Description |
---|---|
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. |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public LeaseUnmarshalException(String message, Lease[] leases, MarshalledObject[] marshalledLeases, Throwable[] exceptions)
LeaseUnmarshalException
with a specified message.leases
- array containing the set of instances of
Lease
that were successfully unmarshalledmarshalledLeases
- array containing the set of marshalled
Lease
instances that could not be
unmarshalledexceptions
- 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 messageIllegalArgumentException
- when the number of elements in
the exceptions
argument is not equal to the
number of elements in the marshalledLeases
argumentpublic LeaseUnmarshalException(Lease[] leases, MarshalledObject[] marshalledLeases, Throwable[] exceptions)
LeaseUnmarshalException
.leases
- array containing the set of instances of
Lease
that were successfully unmarshalledmarshalledLeases
- array containing the set of marshalled
Lease
instances that could not be
unmarshalledexceptions
- 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.
IllegalArgumentException
- when the number of elements in
the exceptions
argument is not equal to the
number of elements in the marshalledLeases
argumentpublic LeaseUnmarshalException(AtomicSerial.GetArg arg) throws IOException
IOException
public Lease[] getLeases()
Lease
, where each element of the array corresponds
to a successfully unmarshalled object. Note that a copy is returned
on each invocation of this method.Lease
, where each
element corresponds to a successfully unmarshalled objectpublic MarshalledObject[] getMarshalledLeases()
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 a copy is returned on each
invocation of this method.Lease
,
where each element corresponds to an object in which
failure occurred while attempting to unmarshal the objectpublic Throwable[] getExceptions()
Throwable
, where each element of the array
corresponds to one of the exceptions that occurred during the
unmarshalling process. Note a copy is returned on
each invocation of this method.
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.
Throwable
, where each
element corresponds to one of the exceptions that
occurred during the unmarshalling processCopyright © 2016–2018. All rights reserved.