net.jini.discovery
Class LookupUnmarshalException
java.lang.Object
java.lang.Throwable
java.lang.Exception
net.jini.discovery.LookupUnmarshalException
- All Implemented Interfaces:
- Serializable
public class LookupUnmarshalException
- extends Exception
When unmarshalling an instance of 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
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.
Thus, when exceptional conditions occur while unmarshalling a set of
marshalled instances of 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.
Note that this exception class should be used only to report exceptional
conditions occurring when unmarshalling a set of marshalled instances
of the ServiceRegistrar
interface.
- Author:
- Sun Microsystems, Inc.
- See Also:
ServiceRegistrar
,
Serialized Form
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. |
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. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
LookupUnmarshalException
public LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions)
- Constructs a new instance of
LookupUnmarshalException
.
- Parameters:
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.
- Throws:
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.
LookupUnmarshalException
public LookupUnmarshalException(ServiceRegistrar[] registrars,
MarshalledObject[] marshalledRegistrars,
Throwable[] exceptions,
String message)
- Constructs a new instance of
LookupUnmarshalException
.
- Parameters:
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 exception
- Throws:
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.
getRegistrars
public 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. 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
ServiceRegistrar
, where
each element corresponds to a successfully unmarshalled object.
getMarshalledRegistrars
public 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. 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
ServiceRegistrar
,
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 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
.
- Returns:
- array of instances of
Throwable
, where each element
corresponds to one of the exceptions that occurred during
the unmarshalling process.
Copyright © GigaSpaces.