Tuxedo
0

Administering a Tuxedo Application at Run Time

 Previous Next Contents View as PDF  

CORBA::TypeCode::parameter

Synopsis

Retrieves a parameter specified by the index input argument.

C++ Binding

CORBA::Any * CORBA::TypeCode::parameter (
CORBA::Long Index) const;

Argument

Index

An index to the parameter list, used to determine which parameter to retrieve.

Description

This member function retrieves a parameter specified by the index input argument. For a list of parameters of each kind, see Table  14-2.

Return Values

If the member function succeeds, the return value is a pointer to the parameter specified by the index input argument.

If the member function does not succeed, an exception is thrown.

 


Exception Member Functions

The BEA Tuxedo software supports the throwing and catching of exceptions.

Caution: Use of the wrong exception constructor causes noninitialization of a data member. Exceptions that are defined to have a reason field need to be created using the constructor that initializes that data member. If the default constructor is used instead, that data member is not initialized and, during destruction of the exception, the system may attempt to destroy nonexistent data.

When creating exceptions, be sure to use the constructor function that most fully initializes the data fields. These exceptions can be most easily identified by looking at the OMG IDL definition; they have additional data member definitions.

Descriptions of exception member functions follow:

CORBA::SystemException::SystemException ()

This is the default constructor for the CORBA::SystemException class. Minor code is initialized to 0 (zero) and the completion status is set to COMPLETED_NO.

CORBA::SystemException::SystemException (
const CORBA::SystemException & Se)

This is the copy constructor for the CORBA::SystemException class.

CORBA::SystemException::SystemException(
CORBA::ULong Minor, CORBA::CompletionStatus Status)

This constructor for the CORBA::SystemException class sets the minor code and completion status.

Explanations of the arguments are as follows:

Minor

The minor code for the Exception object. The minor field is an implementation-specific value used by the ORB to identify the exception. The BEA Tuxedo minor field definitions can be found in the file orbminor.h.

Status

The completion status for the Exception object. The values are as follows:

CORBA::COMPLETED_YES

CORBA::COMPLETED_NO

CORBA::COMPLETED_MAYBE

CORBA::SystemException::~SystemException ()

This is the destructor for the CORBA::SystemException class. It frees any memory used for the Exception object.

CORBA::SystemException CORBA::SystemException::operator =
const CORBA::SystemException Se)

This assignment operator copies exception information from the source exception. The Se argument specifies the SystemException object that is to be copied by this operator.

CORBA::CompletionStatus CORBA::SystemException::completed()

This member function returns the completion status for this exception.

CORBA::SystemException::completed(
CORBA::CompletionStatus Completed)

This member function sets the completion status for this exception. The Completed argument specifies the completion status for this exception.

CORBA::ULong CORBA::SystemException::minor()

This member function returns the minor code for this exception.

CORBA::SystemException::minor (CORBA::ULong Minor)

This member function sets the minor code for this exception. The minor argument specifies the new minor code for this exception. The minor field is an implementation-specific value used by the application to identify the exception.

CORBA::SystemException * CORBA::SystemException::_narrow (
CORBA::Exception_ptr Exc)

This member function determines whether a specified exception can be narrowed to a system exception. The Exc argument specifies the exception to be narrowed.

If the specified exception is a system exception, this member function returns a pointer to the system exception. If the specified exception is not a system exception, the function returns 0 (zero).

CORBA::UserException * CORBA::UserException::_narrow(
CORBA::Exception_ptr Exc)

This member function determines whether a specified exception can be narrowed to a user exception. The Exc argument specifies the exception to be narrowed.

If the specified exception is a user exception, this member function returns a pointer to the user exception. If the specified exception is not a user exception, the function returns 0 (zero).

 


Standard Exceptions

This section presents the standard exceptions defined for the ORB. These exception identifiers may be returned as a result of any operation invocation, regardless of the interface specification. Standard exceptions are not listed in raises expressions.

To bound the complexity in handling the standard exceptions, the set of standard exceptions is kept to a tractable size. This constraint forces the definition of equivalence classes of exceptions, rather than enumerating many similar exceptions.

For example, an operation invocation can fail at many different points due to the inability to allocate dynamic memory. Rather than enumerate several different exceptions that correspond to the different ways that memory allocation failure causes the exception (during marshaling, unmarshaling, in the client, in the object implementation, allocating network packets, and so forth), a single exception corresponding to dynamic memory allocation failure is defined. Each standard exception includes a minor code to designate the subcategory of the exception; the assignment of values to the minor codes is left to each ORB implementation.

Each standard exception also includes a completion_status code, which takes one of the following values:

CORBA::COMPLETED_YES

The object implementation completed processing prior to the exception being raised.

CORBA::COMPLETED_NO

The object implementation was not initiated prior to the exception being raised.

CORBA::COMPLETED_MAYBE

The status of implementation completion is unknown.

Exception Definitions

The standard exceptions are defined below. Clients must be prepared to handle system exceptions that are not on this list, both because future versions of this specification may define additional standard exceptions, and because ORB implementations may raise nonstandard system exceptions. For more information about exceptions, see System Messages.

Table  14-3 defines the exceptions.

Table 14-3 Exception Definitions  

Exception

Description

CORBA::UNKNOWN

The unknown exception.

CORBA::BAD_PARAM

An invalid parameter was passed.

CORBA::NO_MEMORY

Dynamic memory allocation failure.

CORBA::IMP_LIMIT

Violated implementation limit.

CORBA::COMM_FAILURE

Communication failure.

CORBA::INV_OBJREF

Invalid object reference.

CORBA::NO_PERMISSION

No permission for attempted operation.

CORBA::INTERNAL

ORB internal error.

CORBA::MARSHAL

Error marshalling parameter/result.

CORBA::INITIALIZE

ORB initialization failure.

CORBA::NO_IMPLEMENT

Operation implementation unavailable.

CORBA::BAD_TYPECODE

Bad typecode.

CORBA::BAD_OPERATION

Invalid operation.

CORBA::NO_RESOURCES

Insufficient resources for request.

CORBA::NO_RESPONSE

Response to request not yet available.

CORBA::PERSIST_STORE

Persistent storage failure.

CORBA::BAD_INV_ORDER

Routine invocations out of order.

CORBA::TRANSIENT

Transient failure; reissue request.

CORBA::FREE_MEM

Cannot free memory.

CORBA::INV_IDENT

Invalid identifier syntax.

CORBA::INV_FLAG

Invalid flag was specified.

CORBA::INTF_REPOS

Error accessing interface repository.

CORBA::BAD_CONTEXT

Error processing context object.

CORBA::OBJ_ADAPTER

Failure detected by object adapter.

CORBA::DATA_CONVERSION

Data conversion error.

CORBA::OBJECT_NOT_EXIST

Nonexistent object; delete reference.

CORBA::TRANSACTION_REQUIRED

Transaction required.

CORBA::TRANSACTION_ROLLEDBACK

Transaction rolled back.

CORBA::INVALID_TRANSACTION

Invalid transaction.


 

Object Nonexistence

The CORBA::OBJECT_NOT_EXIST exception is raised whenever an invocation on a deleted object is performed. It is an authoritative "hard" fault report. Anyone receiving it is allowed (even expected) to delete all copies of this object reference and to perform other appropriate "final recovery" style procedures.

Transaction Exceptions

The CORBA::TRANSACTION_REQUIRED exception indicates that the request carried a NULL transaction context, but an active transaction is required.

The CORBA::TRANSACTION_ROLLEDBACK exception indicates that the transaction associated with the request has already been rolled back or marked to roll back. Thus, the requested operation either could not be performed or was not performed because further computation on behalf of the transaction would be fruitless.

The CORBA::INVALID_TRANSACTION indicates that the request carried an invalid transaction context. For example, this exception could be raised if an error occurred when trying to register a resource.

 


ExceptionList Member Functions

The ExceptionList member functions allow a client or server application to provide a list of TypeCodes for all user-defined exceptions that may result when the Request is invoked. For a description of the Request member functions, see the section Request Member Functions.

The mapping of these member functions to C++ is as follows:

class CORBA
{
class ExceptionList
{
public:
Ulong count ();
void add(TypeCode_ptr tc);
void add_consume(TypeCode_ptr tc);
TypeCode_ptr item(Ulong index);
Status remove(Ulong index);
}; // ExceptionList
}// CORBA

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy