ALMA Computing Group
Public Member Functions | Private Member Functions

ErrorComponent Class Reference
[ACS Components Examples]

This class shows how to deal with errors in components. More...

#include <acsexmplErrorComponentImpl.h>

List of all members.

Public Member Functions

 ErrorComponent (const ACE_CString &name, maci::ContainerServices *containerServices)
 Constructor.
virtual ~ErrorComponent ()
 Destructor.
virtual void displayMessage ()
 Displays "Hello World" to the console.
virtual void badMethod (CORBA::Short depth)
 Simple method raises a remote exception within the calling client.
virtual void exceptionFromCompletion (CORBA::Short depth)
 Simple method raises a remote exception within the calling client.
virtual void typeException (CORBA::Short depth)
 This method throws a REMOTE (CORBA) type exception if depth>0.
virtual void corbaSystemException ()
 Method that throws a CORBA::BAD_PARAM system exception to show how to handle CORBA System Exceptions.
virtual ACSErr::Completion * completionFromException (CORBA::Short depth)
 Simple method that returns an ACSErr::Completion, where an error trace is added from an exception.
virtual ACSErr::Completion * completionFromCompletion (CORBA::Short depth)
 Simple method that returns a REMOTE (CORBA) completion (ACSErr::Completion), where an error trace is added from a completion.
ACSErr::Completion * completionOnStack (CORBA::Short depth)
 This method is similar than completionFromCompletion, but it allocated C++ completion on the stack instead on the heap.
void outCompletion (ACSErr::Completion_out comp)
 Simple method that returns an ACSErr::Completion as an out parameter.
void generateSIGFPE (CORBA::Short way)
 A method wich will generate the SIGFPE signal This can be used to test what happens when there is a floating point exception in a component.
void generateSIGSEGV (CORBA::Short way)
 A method wich will generate the SIGSEGV signal This can be used to test what happens when there is a segmentation fault in a component.
void sleepingCmd (CORBA::Short nb_seconds)
 A method that will sleep during nb_seconds seconds before to return This method could be used to test the behavior of components taking a long time before to reply.

Private Member Functions

virtual ACSErr::CompletionImpl * createCompletion (unsigned short depth)
 This method return a LOCAL (C++) completion which contains an error trace if depth > 0, otherwise it returns non error completion (ACSErrOKCompletion), i.e.
virtual void buildErrorTrace (unsigned short depth)
 The aim of this method is to build an error trace.

Detailed Description

This class shows how to deal with errors in components.

All components should inherit from CharacteristicComponentImpl or it's superclass, ACSComponentImpl, to remain compatiable with ACS tools such as objexp (i.e., a GUI used to manipulate components). This class also derives from POA_acsexmplErrorComponent::ErrorComponent which is a class automatically generated by CORBA from ErrorComponent's IDL file.

Version:
"@(#) $Id: acsexmplErrorComponentImpl.h,v 1.13 2010/11/10 16:58:09 rbourtem Exp $"

Definition at line 106 of file acsexmplErrorComponentImpl.h.


Constructor & Destructor Documentation

ErrorComponent::ErrorComponent ( const ACE_CString &  name,
maci::ContainerServices *  containerServices 
)

Constructor.

Parameters:
poa Poa which will activate this and also all other components. Developers need not be concerned with what a PortableServer does...just pass it to the superclass's constructor.
name component's name. All components have a name associated with them so other components and clients can access them.

Definition at line 40 of file acsexmplErrorComponentImpl.cpp.


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