JSR-043: JTAPI-1.4

javax.telephony
Class ProviderUnavailableException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--javax.telephony.ProviderUnavailableException
All Implemented Interfaces:
java.io.Serializable

public class ProviderUnavailableException
extends java.lang.RuntimeException

The ProviderUnavailableException indicates that the Provider is currently not available to the application. This exception extends Java's RuntimeException, and therefore can be thrown on any JTAPI method. It is typically thrown in two situations: when JtapiPeer.getProvider() is called or on any method when the Provider is in a Provider.SHUTDOWN state. Because this method extends RuntimeException, it can be thrown from any method without being declared.

This exception is thrown on JtapiPeer.getProvider() when the requested Provider is not available to the application for a number of reasons, including when an invalid service string or optional argument was given. If this exception is thrown on a random JTAPI method, it indicates that the method call is invalid because the Provider is not in the "in service" state.

This exception stores the reason for the failure which may be obtained via the ProviderUnavailableException.getReason() method.

Note: the Jtapi-1.4 ProviderUnavailableException is incompatible with previous releases!

In all releases before the Jtapi-1.4 Final-Final release, getReason() was named getCause().

In J2SE-1.4 the Throwable class from (which ProviderUnavailableException extends) defines Throwable getCause(). Therefore, it is not possible to define int getCause() in this class.

JTAPI applications that use int getCause() can be compiled with JDK-1.3, and continue to run on JDK-1.4; but to compile on JDK-1.4, the application must be re-coded to use JTAPI-1.4.

See Also:
Serialized Form

Field Summary
static int CAUSE_INVALID_ARGUMENT
          Constant definition for an invalid optional argument given to JtapiPeer.getProvider().
static int CAUSE_INVALID_SERVICE
          Constant definition for an invalid service string given to JtapiPeer.getProvider().
static int CAUSE_NOT_IN_SERVICE
          Constant definition for the Provider not in the "in service" state.
static int CAUSE_UNKNOWN
          Constant definition for an unknown cause.
 
Constructor Summary
ProviderUnavailableException()
          Constructor with no cause and string.
ProviderUnavailableException(int cause)
          Constructor which takes a cause string.
ProviderUnavailableException(int cause, java.lang.String s)
          Constructor which takes both a string and a cause.
ProviderUnavailableException(java.lang.String s)
          Constructor which takes a string description.
 
Method Summary
 int getReason()
          Returns the cause for this exception.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CAUSE_UNKNOWN

public static final int CAUSE_UNKNOWN
Constant definition for an unknown cause.

CAUSE_NOT_IN_SERVICE

public static final int CAUSE_NOT_IN_SERVICE
Constant definition for the Provider not in the "in service" state.

CAUSE_INVALID_SERVICE

public static final int CAUSE_INVALID_SERVICE
Constant definition for an invalid service string given to JtapiPeer.getProvider().

CAUSE_INVALID_ARGUMENT

public static final int CAUSE_INVALID_ARGUMENT
Constant definition for an invalid optional argument given to JtapiPeer.getProvider().
Constructor Detail

ProviderUnavailableException

public ProviderUnavailableException()
Constructor with no cause and string.

ProviderUnavailableException

public ProviderUnavailableException(int cause)
Constructor which takes a cause string.
Parameters:
cause - reason code for this fault

ProviderUnavailableException

public ProviderUnavailableException(java.lang.String s)
Constructor which takes a string description.
Parameters:
s - description of the fault

ProviderUnavailableException

public ProviderUnavailableException(int cause,
                                    java.lang.String s)
Constructor which takes both a string and a cause.
Parameters:
cause - reason code for the fault
s - description of the fault
Method Detail

getReason

public int getReason()
Returns the cause for this exception.

Note: this method was named getCause() in previous releases. It has been renamed to avoid interference with the JDK-1.4 Throwable.getCause()

Returns:
The cause of this exception.

JSR-043: JTAPI-1.4

Send comments to: JSR-43@ectf.org