

Public Member Functions | |
| void | displayMessage () |
| void | badMethod (short depth) throws GenericErrorEx |
| void | corbaSystemException () throws org.omg.CORBA.SystemException |
| void | exceptionFromCompletion (short depth) throws GenericErrorEx |
| void | typeException (short depth) throws ACSErrTypeCommonEx |
| Completion | completionFromException (short depth) |
| Completion | completionFromCompletion (short depth) |
| Completion | completionOnStack (short depth) |
| void | outCompletion (alma.ACSErr.CompletionHolder comp) |
Private Member Functions | |
| void | internalBadMethod (int depth) throws AcsJGenericErrorEx |
| AcsJCompletion | internalCompletionMethod (int depth) |
Implementation of the ErrorComponent interface, which should demonstrate proper use of the ACS error system in Java.
Note on logging: unlike in the C++ implementation of this component, here we do not log the invocation of every method, because the Java container does this automatically. In general the component should only trace the invocations itself if it needs to add custom data to the log.
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::badMethod | ( | short | depth | ) | throws GenericErrorEx [inline] |
An intentionally bad method that throws an exception (GenericErrorEx) if depth > 0. This exception has causing exception if depth > 1. All exceptions get added to the ErrorTrace list which will transport them over CORBA.
Note that the thrown CORBA exception GenericErrorEx only acts as a vehicle for the embedded ErrorTrace linked list which contains the real data of the exception(s).
Implements alma::acsexmplErrorComponent::ErrorComponentOperations.
References internalBadMethod(), and alma::ACSErrTypeCommon::wrappers::AcsJGenericErrorEx::toGenericErrorEx().
| Completion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::completionFromCompletion | ( | short | depth | ) | [inline] |
| Completion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::completionFromException | ( | short | depth | ) | [inline] |
| Completion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::completionOnStack | ( | short | depth | ) | [inline] |
Forwards to completionFromException(short) because in Java we can't create objects on the stack, so there is no distinction to be made.
Implements alma::acsexmplErrorComponent::ErrorComponentOperations.
References completionFromException().
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::corbaSystemException | ( | ) | throws org.omg.CORBA.SystemException [inline] |
An intentionally bad method that throws a CORBA::BAD_PARAM system exception to show how to handle CORBA System Exceptions
Implements alma::acsexmplErrorComponent::ErrorComponentOperations.
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::displayMessage | ( | ) | [inline] |
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::exceptionFromCompletion | ( | short | depth | ) | throws GenericErrorEx [inline] |
This method throws a GenericErrorEx exception if the completion returned from internalCompletionMethod(int) has an associated exception. This will be the case if the depth parameter is > 0.
Implements alma::acsexmplErrorComponent::ErrorComponentOperations.
References alma::acs::exceptions::AcsJCompletion::getAcsJException(), internalCompletionMethod(), alma::acs::exceptions::AcsJCompletion::isError(), and alma::ACSErrTypeCommon::wrappers::AcsJGenericErrorEx::toGenericErrorEx().
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::internalBadMethod | ( | int | depth | ) | throws AcsJGenericErrorEx [inline, private] |
Method that calls itself recursively to construct an AcsJGenericErrorEx exception with causing exceptions of the same type.
This behavior is meant to mimic a number of calls down into the implementation classes of a real-world component, even though there we would typically deal with different methods calling one another, instead of the same method calling itself recursively.
| depth | the number of chained exceptions thrown in the end. May be zero, meaning that no exception will be thrown. |
| AcsJGenericErrorEx,which | is the JDK-style peer of GenericErrorEx. |
Referenced by badMethod(), internalCompletionMethod(), and typeException().
| AcsJCompletion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::internalCompletionMethod | ( | int | depth | ) | [inline, private] |
Creates a completion, optionally based on a chain of exceptions.
| depth | The number of chained exceptions attached to the completion, which may be zero. |
References internalBadMethod().
Referenced by completionFromCompletion(), completionFromException(), and exceptionFromCompletion().
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::outCompletion | ( | alma.ACSErr.CompletionHolder | comp | ) | [inline] |
this method returns a Completion as an out parameter.
Implements alma::acsexmplErrorComponent::ErrorComponentOperations.
| void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::typeException | ( | short | depth | ) | throws ACSErrTypeCommonEx [inline] |
1.6.2