Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

alma.acs.exceptions.AcsJCompletion Class Reference

Inherited by alma.acs.callbacks.Objects.MyAcsJCompletion.

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

static 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

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.

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

Constructor & Destructor Documentation

alma.acs.exceptions.AcsJCompletion.AcsJCompletion (  )  [protected]
alma.acs.exceptions.AcsJCompletion.AcsJCompletion ( int  type,
int  code 
) [protected]

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

Parameters:
type 
code 

References alma.acs.exceptions.AcsJCompletion.init().

alma.acs.exceptions.AcsJCompletion.AcsJCompletion ( AcsJException  acsJEx  )  [protected]

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

Parameters:
acsJEx 

References alma.acs.exceptions.AcsJCompletion.init().


Member Function Documentation

static AcsJCompletion alma.acs.exceptions.AcsJCompletion.fromCorbaCompletion ( Completion  corbaCompletion  )  [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 

References alma.acs.exceptions.AcsJCompletion.AcsJCompletion(), and alma.acs.exceptions.AcsJCompletion.init().

Referenced by alma.acsexmpl.clients.ErrorComponentTest.testCompletionFromCompletion(), and alma.acsexmpl.clients.ErrorComponentTest.testCompletionFromException().

AcsJException alma.acs.exceptions.AcsJCompletion.getAcsJException (  ) 
int alma.acs.exceptions.AcsJCompletion.getCode (  ) 
String alma.acs.exceptions.AcsJCompletion.getProperty ( String  key  ) 
long alma.acs.exceptions.AcsJCompletion.getTimeStamp (  ) 

Returns the timeStamp.

Referenced by alma.acs.exceptions.AcsJCompletion.toCorbaCompletion().

int alma.acs.exceptions.AcsJCompletion.getType (  ) 
void alma.acs.exceptions.AcsJCompletion.init ( AcsJException  acsJEx  )  [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.

References alma.acs.exceptions.AcsJException.getErrorCode(), alma.acs.exceptions.AcsJException.getErrorType(), and alma.acs.exceptions.AcsJException.getTimestampMillis().

void alma.acs.exceptions.AcsJCompletion.init ( int  type,
int  code 
) [protected]
boolean alma.acs.exceptions.AcsJCompletion.isError (  ) 
Object alma.acs.exceptions.AcsJCompletion.setProperty ( String  key,
String  value 
)

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.

References alma.acs.exceptions.AcsJCompletion.getAcsJException(), alma.acs.exceptions.AcsJCompletion.isError(), and alma.acs.exceptions.AcsJException.setProperty().

Completion alma.acs.exceptions.AcsJCompletion.toCorbaCompletion (  ) 

Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties