ALMA Computing Group

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

Implementation of the ErrorComponent interface, which should demonstrate proper use of the ACS error system in Java. More...

List of all members.

Public Member Functions

void displayMessage ()
void badMethod (short depth) throws GenericErrorEx
 An intentionally bad method that throws an exception (GenericErrorEx) if depth > 0.
void corbaSystemException () throws org.omg.CORBA.SystemException
 An intentionally bad method that throws a CORBA::BAD_PARAM system exception to show how to handle CORBA System Exceptions.
void exceptionFromCompletion (short depth) throws GenericErrorEx
 This method throws a GenericErrorEx exception if the completion returned from internalCompletionMethod(int) has an associated exception.
void typeException (short depth) throws ACSErrTypeCommonEx
Completion completionFromException (short depth)
Completion completionFromCompletion (short depth)
Completion completionOnStack (short depth)
 Forwards to completionFromException(short) because in Java we can't create objects on the stack, so there is no distinction to be made.
void outCompletion (alma.ACSErr.CompletionHolder comp)
 this method returns a Completion as an out parameter.

Private Member Functions

void internalBadMethod (int depth) throws AcsJGenericErrorEx
 Method that calls itself recursively to construct an AcsJGenericErrorEx exception with causing exceptions of the same type.
AcsJCompletion internalCompletionMethod (int depth)
 Creates a completion, optionally based on a chain of exceptions.


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

Definition at line 48 of file ErrorComponentImpl.java.


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)
Definition at line 64 of file ErrorComponentImpl.java.

References internalBadMethod().

Completion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::completionFromCompletion short  depth  )  [inline]
 

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations#completionFromCompletion(short)
Definition at line 157 of file ErrorComponentImpl.java.

References internalCompletionMethod().

Completion alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::completionFromException short  depth  )  [inline]
 

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations#completionFromException(short)
Definition at line 145 of file ErrorComponentImpl.java.

References internalCompletionMethod().

Referenced by completionOnStack().

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)
Definition at line 176 of file ErrorComponentImpl.java.

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()
Definition at line 82 of file ErrorComponentImpl.java.

void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::displayMessage  )  [inline]
 

Definition at line 50 of file ErrorComponentImpl.java.

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.

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations#exceptionFromCompletion(short)
Definition at line 93 of file ErrorComponentImpl.java.

References internalCompletionMethod().

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.
Definition at line 200 of file ErrorComponentImpl.java.

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:
Definition at line 225 of file ErrorComponentImpl.java.

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.

See also:
alma.acsexmplErrorComponent.ErrorComponentOperations#outCompletion(alma.ACSErr.CompletionHolder)
Definition at line 184 of file ErrorComponentImpl.java.

void alma::acsexmplErrorComponent::ErrorComponentImpl::ErrorComponentImpl::typeException short  depth  )  throws ACSErrTypeCommonEx [inline]
 

Definition at line 128 of file ErrorComponentImpl.java.

References internalBadMethod().


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