Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::exceptions::AcsJCompletion Class Reference

Inheritance diagram for alma::acs::exceptions::AcsJCompletion:

Inheritance graph
[legend]
Collaboration diagram for alma::acs::exceptions::AcsJCompletion:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int getType ()
int getCode ()
long getTimeStamp ()
boolean isError ()
AcsJException getAcsJException ()
Completion toCorbaCompletion ()
Object setProperty (String key, String value)
String getProperty (String key)

Static Public Member Functions

AcsJCompletion fromCorbaCompletion (Completion corbaCompletion)

Protected Member Functions

 AcsJCompletion ()
 AcsJCompletion (int type, int code)
 AcsJCompletion (AcsJException acsJEx)
void init (int type, int code)
void init (AcsJException acsJEx)

Protected Attributes

Properties m_properties

Private Attributes

int m_type
int m_code
long m_timestamp
AcsJException m_jex

Detailed Description

Java class that facilitates working with the interoperable Completion that's generated from CORBA IDL.

A Completion transmits the result of a remote method invocation to the client. It contains an error type and code as defined in the ACS framework, as well as an optional ErrorTrace. Note that for asynchronous calls, it is not possible to transmit thrown exceptions to the client directly; here the Completion fills the gap.

Similar to AcsJException, AcsJCompletion converts CORBA struct data into its nicer Java representation upon construction. When an AcsJCompletion must be transported further on over CORBA, the method toCorbaCompletion will create a corresponding Completion with correct ErrorTrace structs attached.

For any combination of error type/code, the ACS framework generates subclasses of AcsJCompletion, which ensure usage of the correct type and code. To create a completion object from scratch, use the appropriate subclass; to convert an existing CORBA Completion to an AcsJCompletion, use the static method fromCorbaCompletion.

Author:
hsommer created Jan 20, 2004 3:11:34 PM


Constructor & Destructor Documentation

alma::acs::exceptions::AcsJCompletion::AcsJCompletion  )  [inline, protected]
 

alma::acs::exceptions::AcsJCompletion::AcsJCompletion int  type,
int  code
[inline, protected]
 

To be called from ctors of generated subclasses that can't have exceptions attached.

Parameters:
type 
code 

alma::acs::exceptions::AcsJCompletion::AcsJCompletion AcsJException  acsJEx  )  [inline, protected]
 

To be called from ctors of generated subclasses that have exceptions attached.

Parameters:
acsJEx 


Member Function Documentation

AcsJCompletion alma::acs::exceptions::AcsJCompletion::fromCorbaCompletion Completion  corbaCompletion  )  [inline, static]
 

Factory method to create an AcsJCompletion from an existing CORBA completion. Note that the new AcsJCompletion is a direct translation, not a wrapper.

If corbaCompletion has error information attached, this will be converted, and type/code of the top-exception will have precedence over type/code stored redundantly in corbaCompletion.

To be used on the client side of a remote call.

Parameters:
completion 

AcsJException alma::acs::exceptions::AcsJCompletion::getAcsJException  )  [inline]
 

Returns:
an exception (chain) corresponding to the ErrorTrace, or null if the completion does not correspond to an exception.
See also:
isError

int alma::acs::exceptions::AcsJCompletion::getCode  )  [inline]
 

Returns the completion code.

String alma::acs::exceptions::AcsJCompletion::getProperty String  key  )  [inline]
 

See also:
setProperty

long alma::acs::exceptions::AcsJCompletion::getTimeStamp  )  [inline]
 

Returns the timeStamp.

int alma::acs::exceptions::AcsJCompletion::getType  )  [inline]
 

Returns the completion type.

void alma::acs::exceptions::AcsJCompletion::init AcsJException  acsJEx  )  [inline, protected]
 

Initializes this AcsJCompletion object with the data of an AcsJException (chain).

Type, code, and timestamp are taken from acsJEx.

Parameters:
acsJEx 
Exceptions:
NullPointerException if acsJEx is null.

void alma::acs::exceptions::AcsJCompletion::init int  type,
int  code
[inline, protected]
 

boolean alma::acs::exceptions::AcsJCompletion::isError  )  [inline]
 

True if this completion represents an error condition. The error information can be obtained from getAcsJException.

Object alma::acs::exceptions::AcsJCompletion::setProperty String  key,
String  value
[inline]
 

Allows extra information to be attached to the completion, but only if this completion represents an error.

Returns:
the previous value of the specified key in this property list, or null if it did not have one.
Exceptions:
IllegalStateException if this completion has no exceptions attached (i.e. it is an "ok-completion"). TODO: modify ACS error system to allow properties also for ok-completions.

Completion alma::acs::exceptions::AcsJCompletion::toCorbaCompletion  )  [inline]
 

Creates a CORBA style completion object from this Java style completion. If present, the attached exceptions are converted to ErrorTraces.

This method should be used when a Java implementation (of a component etc) has to send an AcsJCompletion over Corba.

See also:
fromCorbaCompletion


Member Data Documentation

int alma::acs::exceptions::AcsJCompletion::m_code [private]
 

AcsJException alma::acs::exceptions::AcsJCompletion::m_jex [private]
 

optional exception; if present, type and code of completion and exception must be the same

Properties alma::acs::exceptions::AcsJCompletion::m_properties [protected]
 

long alma::acs::exceptions::AcsJCompletion::m_timestamp [private]
 

int alma::acs::exceptions::AcsJCompletion::m_type [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:53 2009 for ACS Java API by doxygen 1.3.8