com.apelon.dts.client
Class DTSException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.apelon.common.NestingException
              extended by com.apelon.dts.client.DTSException
All Implemented Interfaces:
Serializable

public final class DTSException
extends com.apelon.common.NestingException

DTSException is a general exception class. A DTSException is an exception that originates in the com.apelon.dts.client package, where all of the client side messages are built and read from the communication layer.

DTSException is a "Nesting Exception." It may have another exception stored in an instance variable. As such, its getMessage, printStackTrace, and toString methods may return one or multiple messages, stack traces, or string representations, respectively. Nesting Exceptions can be used to create an "exception chain" that indicates error information as an exception propogates through many application layers. Exception chains assure that no error information is lost as successive application classes handle a given error case (this is especially useful in server-side error handling).

Nonetheless, DTSException is only an Exception object, and clients of DTSException are expected to adhere to the Exception and Throwable interfaces only. You should use no other methods, with the exception of getNestedException, which can be used to retrieve the "cause" of this exception.

Likewise, DTSException instances should be created only by DTS classes. Clients of this API should not construct instances of this class.

DTSException's direct superclass is not part of the public API.

Copyright: Copyright (c) 2002

Company: Apelon, Inc.

Since:
DTS 1.0.0
Version:
DTS 2.4.0
Author:
Apelon, Inc.
See Also:
Exception, Throwable, Serialized Form

Field Summary
 
Fields inherited from class com.apelon.common.NestingException
fCause
 
Constructor Summary
DTSException(Exception nested_ex)
          This constructor is provided for the DTS internal use only.
DTSException(String msg)
          This constructor is provided for the DTS internal use only.
DTSException(String msg, Exception nested_ex)
          This constructor is provided for the DTS internal use only.
 
Method Summary
static Exception getNestedException()
          Retrieve the "cause" of this exception.
 boolean isServerAvailable()
          Indicates that there was a problem communicating with the server.
protected  void setCause(Exception newCause)
          This method is provided for DTS internal use only.
 
Methods inherited from class com.apelon.common.NestingException
cause, getMessage, lineSeparator, primaryMessage, primaryPst, primaryPst, primaryPst, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DTSException

public DTSException(String msg)
This constructor is provided for the DTS internal use only. Do not create instances of this class.

Parameters:
msg - exception message text

DTSException

public DTSException(Exception nested_ex)
This constructor is provided for the DTS internal use only. Do not create instances of this class.

Parameters:
nested_ex - nested exception

DTSException

public DTSException(String msg,
                    Exception nested_ex)
This constructor is provided for the DTS internal use only. Do not create instances of this class.

Parameters:
msg - exception message text
nested_ex - nested exception
Method Detail

getNestedException

public static Exception getNestedException()
Retrieve the "cause" of this exception.

Returns:
the cause of this exception, or null if this exception is not "nesting"

setCause

protected void setCause(Exception newCause)
This method is provided for DTS internal use only. Do not invoke this method.

Overrides:
setCause in class com.apelon.common.NestingException
Parameters:
newCause - nested exception

isServerAvailable

public boolean isServerAvailable()
Indicates that there was a problem communicating with the server. The socket connection to the server was broken becuase the network is down or the server itself is no longer running.

This is a convenience method to allow clients to determine if the root cause of the problem is actually a server communication problem (i.e. the server was not running at the time of the query, or network access was interrupted).

Returns:
true if the server is up and available via the network; false if the error was caused by server communication.


Copyright © 2011. All Rights Reserved.