Sun Adapter for COM/DCOM API

com.stc.connector.comadapter.comruntime
Class STCComException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.stc.connector.comadapter.comruntime.STCComException
All Implemented Interfaces:
java.io.Serializable

public class STCComException
extends java.lang.Exception

The STCComException is the exception type that can be thrown from methods on the STCDispatch. It is for use by the COM runtime only.

If one of the methods (invoke, etc.) fails on the STCDispatch class, an exception of this type is thrown. The exception is not caught by the builder-generated code; it is up to the user to catch it if desired. This provides a mechanism for the Collaboration code to detect when a failure happens at the lower level and why. Access to the COM HRESULT is provided as well as the description of the HRESULT from the operating system, if available.

See Also:
STCIDispatch, Serialized Form

Constructor Summary
STCComException(int hr, java.lang.String sOp)
          Constructor for the exception class.
STCComException(int hr, java.lang.String sOp, java.lang.String error)
          Constructor for the exception class.
 
Method Summary
 STCHResult getComError()
          Gets the Com error.
 java.lang.String getMessage()
          Gets the message and error text.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

STCComException

public STCComException(int hr,
                       java.lang.String sOp,
                       java.lang.String error)
Constructor for the exception class. Pass in the HRESULT and a context string. The context string can be null but it should be a string that indicates what you were doing that is causing the exception to be thrown. For example: "Invoking foo or getting property bar".

Parameters:
hr - The HRESULT from the method that failed.
sOp - A context string to indicate what you were doing
error - A user error message
Throws:
None.

STCComException

public STCComException(int hr,
                       java.lang.String sOp)
Constructor for the exception class. Pass in the HRESULT and a context string. The context string can be null, but should be a string that indicates what you were doing that is causing the exception to be thrown. For example: "Invoking foo or getting property bar".

Parameters:
hr - This is the HRESULT from the method that failed.
sOp - A context string to indicate what you were doing that caused the error.
Throws:
None.
Method Detail

getMessage

public java.lang.String getMessage()
Gets the message and error text.

Parameters:
None.

Overrides:
getMessage in class java.lang.Throwable
Returns:
String - Returns the message.
Throws:
None.

getComError

public STCHResult getComError()
Gets the Com error.

Parameters:
None.

Returns:
STCHResult - Returns the hResult.
Throws:
None.

Sun Adapter for COM/DCOM API

Copyright © 1994-2008 Sun Microsystems, Inc. All rights reserved.