alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl Class Reference

Inheritance diagram for alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl:
Inheritance graph
[legend]
Collaboration diagram for alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

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.

Author:
hsommer

Member Function Documentation

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).

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations::badMethod(short)

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.

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations::completionOnStack(short)

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

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations::corbaSystemException()

Implements alma::acsexmplErrorComponent::ErrorComponentOperations.

void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::displayMessage (  )  [inline]
void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::exceptionFromCompletion ( short  depth  )  throws GenericErrorEx [inline]
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.

Parameters:
depth the number of chained exceptions thrown in the end. May be zero, meaning that no exception will be thrown.
Exceptions:
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.

Parameters:
depth The number of chained exceptions attached to the completion, which may be zero.
Returns:

References internalBadMethod().

Referenced by completionFromCompletion(), completionFromException(), and exceptionFromCompletion().

void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::outCompletion ( alma.ACSErr.CompletionHolder  comp  )  [inline]
void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::typeException ( short  depth  )  throws ACSErrTypeCommonEx [inline]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2