public class LookupUnmarshalException extends Exception
MarshalledObject
, different
exceptions can occur. An IOException
can occur while
deserializing the object from its internal representation. 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 lookup discovery
service may use for efficient handling of the exceptions that may
occur when unmarshalling elements of a set of marshalled instances
of the ServiceRegistrar
interface. When elements in such
a set are unmarshalled, the LookupUnmarshalException
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
Thus, when exceptional conditions occur while unmarshalling a set of
marshalled instances of
Note that this exception class should be used only to report exceptional
conditions occurring when unmarshalling a set of marshalled instances
of the ServiceRegistrar
instances in which each element is the
result of a successful unmarshalling attempt, a set of marshalled instances
of ServiceRegistrar
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.
ServiceRegistrar
, 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 exceptions, attempting recovery, and debugging.
ServiceRegistrar
interface.
ServiceRegistrar
,
Serialized FormModifier and Type | Field and Description |
---|---|
private Throwable[] |
exceptions
Array containing the set of exceptions that occurred during the
unmarshalling process.
|
private MarshalledObject[] |
marshalledRegistrars
Array containing the set of
ServiceRegistrar instances
that could not be unmarshalled. |
private ServiceRegistrar[] |
registrars
Array containing the set of instances of
ServiceRegistrar
that were successfully unmarshalled during the process in which at
least one failure occurred. |
private static long |
serialVersionUID |
Constructor and Description |
---|
LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions)
Constructs a new instance of
LookupUnmarshalException . |
LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions,
String message)
Constructs a new instance of
LookupUnmarshalException . |
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. |
MarshalledObject[] |
getMarshalledRegistrars()
Accessor method that returns an array consisting of instances of
MarshalledObject , where each element of the array is a
marshalled instance of the ServiceRegistrar interface,
and corresponds to an object that could not be successfully
unmarshalled. |
ServiceRegistrar[] |
getRegistrars()
Accessor method that returns an array consisting of instances of
ServiceRegistrar , where each element of the array
corresponds to a successfully unmarshalled object. |
private void |
init(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions)
Initializes the abstract state of this class.
|
private void |
readObject(ObjectInputStream s)
When an instance of this class is deserialized, this method is
automatically invoked.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
private static final long serialVersionUID
private ServiceRegistrar[] registrars
ServiceRegistrar
that were successfully unmarshalled during the process in which at
least one failure occurred. This set may be null
or
have zero length.private MarshalledObject[] marshalledRegistrars
ServiceRegistrar
instances
that could not be unmarshalled. This set should not be null
and should contain at least one element.private Throwable[] exceptions
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 set of still-to-be-unmarshalled ServiceRegistrar
instances. 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 marshalledRegistrars.
This set should not be null
and should contain at least
one element.
public LookupUnmarshalException(ServiceRegistrar[] registrars, MarshalledObject[] marshalledRegistrars, Throwable[] exceptions)
LookupUnmarshalException
.registrars
- Array containing the set of instances of
ServiceRegistrar
that were
successfully unmarshalled.marshalledRegistrars
- Array containing the set of marshalled
ServiceRegistrar
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
marshalledRegistrars
parameter.
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
marshalledRegistrars
parameter.
NullPointerException
- this exception occurs
when null
is input for either the
marshalledRegistrars
parameter or the
exceptions
parameter.IllegalArgumentException
- this exception occurs when
either the marshalledRegistrars
parameter or the
exceptions
parameter has zero length; or when the
lengths of those two parameters are not equal.public LookupUnmarshalException(ServiceRegistrar[] registrars, MarshalledObject[] marshalledRegistrars, Throwable[] exceptions, String message)
LookupUnmarshalException
.registrars
- Array containing the set of instances of
ServiceRegistrar
that were
successfully unmarshalled.marshalledRegistrars
- Array containing the set of marshalled
ServiceRegistrar
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
marshalledRegistrars
parameter.
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
marshalledRegistrars
parameter.
message
- String
describing the nature
of the exceptionNullPointerException
- this exception occurs
when null
is input for either the
marshalledRegistrars
parameter or the
exceptions
parameter.IllegalArgumentException
- this exception occurs when
either the marshalledRegistrars
parameter or the
exceptions
parameter has zero length; or when the
lengths of those two parameters are not equal.public ServiceRegistrar[] getRegistrars()
ServiceRegistrar
, 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.ServiceRegistrar
, where
each element corresponds to a successfully unmarshalled object.public MarshalledObject[] getMarshalledRegistrars()
MarshalledObject
, where each element of the array is a
marshalled instance of the ServiceRegistrar
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.ServiceRegistrar
,
where each element corresponds to an object in which failure
occurred while attempting to unmarshal the object.public Throwable[] getExceptions()
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 getMarshalledRegistrars
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 method
getMarshalledRegistrars
.
Throwable
, where each element
corresponds to one of the exceptions that occurred during
the unmarshalling process.private void init(ServiceRegistrar[] registrars, MarshalledObject[] marshalledRegistrars, Throwable[] exceptions)
registrars
- Array containing the set of instances of
ServiceRegistrar
that were
successfully unmarshalled.marshalledRegistrars
- Array containing the set of marshalled
ServiceRegistrar
instances
that could not be unmarshalled.exceptions
- Array containing the set of exceptions that
occurred during the unmarshalling process.NullPointerException
- this exception occurs
when null
is input for either the
marshalledRegistrars
parameter or the
exceptions
parameter.IllegalArgumentException
- this exception occurs when
either the marshalledRegistrars
parameter or the
exceptions
parameter has zero length; or when the
lengths of those two parameters are not equal.private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException
InvalidObjectException
- if the state of the
deserialized instance of this class is found to be invalid.IOException
ClassNotFoundException
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.