public class ErrorComponentImpl extends ComponentImplBase
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.
m_containerServices, m_instanceName, m_logger| Constructor and Description |
|---|
ErrorComponentImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
badMethod(short depth)
An intentionally bad method that throws an exception (
GenericErrorEx)
if depth > 0. |
Completion |
completionFromCompletion(short depth) |
Completion |
completionFromException(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 |
corbaSystemException()
An intentionally bad method that throws a CORBA::BAD_PARAM system exception
to show how to handle CORBA System Exceptions
|
void |
displayMessage() |
void |
exceptionFromCompletion(short depth)
This method throws a
GenericErrorEx exception if the completion
returned from internalCompletionMethod(int) has an associated exception. |
void |
generateSIGFPE(short way) |
void |
generateSIGSEGV(short way) |
void |
outCompletion(alma.ACSErr.CompletionHolder comp)
this method returns a Completion as an out parameter.
|
void |
sleepingCmd(short nbSeconds) |
void |
typeException(short depth) |
aboutToAbort, cleanUp, componentState, execute, initialize, namepublic void displayMessage()
public void badMethod(short depth)
throws GenericErrorEx
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).
GenericErrorExalma.acsexmplErrorComponent.ErrorComponentOperations#badMethod(short)public void corbaSystemException()
throws org.omg.CORBA.SystemException
org.omg.CORBA.SystemExceptionalma.acsexmplErrorComponent.ErrorComponentOperations#corbaSystemException()public void exceptionFromCompletion(short depth)
throws GenericErrorEx
GenericErrorEx exception if the completion
returned from internalCompletionMethod(int) has an associated exception.
This will be the case if the depth parameter is > 0.GenericErrorExalma.acsexmplErrorComponent.ErrorComponentOperations#exceptionFromCompletion(short)public void typeException(short depth)
throws ACSErrTypeCommonEx
ACSErrTypeCommonExpublic Completion completionFromException(short depth)
alma.acsexmplErrorComponent.ErrorComponentOperations#completionFromException(short)public Completion completionFromCompletion(short depth)
alma.acsexmplErrorComponent.ErrorComponentOperations#completionFromCompletion(short)public Completion completionOnStack(short depth)
completionFromException(short) because in Java we can't create objects on the stack, so
there is no distinction to be made.alma.acsexmplErrorComponent.ErrorComponentOperations#completionOnStack(short)public void outCompletion(alma.ACSErr.CompletionHolder comp)
alma.acsexmplErrorComponent.ErrorComponentOperations#outCompletion(alma.ACSErr.CompletionHolder)public void generateSIGFPE(short way)
public void generateSIGSEGV(short way)
public void sleepingCmd(short nbSeconds)