public class AcsJCompletion
extends java.lang.Object
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.
AcsJException,
which may be useful inside a catch block, use AcsJException.toAcsJCompletion().
Completion to an AcsJCompletion,
use the static method fromCorbaCompletion(Completion).
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Properties |
m_properties |
| Modifier | Constructor and Description |
|---|---|
protected |
AcsJCompletion() |
protected |
AcsJCompletion(AcsJException acsJEx)
To be called from ctors of generated subclasses that have exceptions attached.
|
protected |
AcsJCompletion(int type,
int code)
To be called from ctors of generated subclasses that can't have exceptions attached.
|
| Modifier and Type | Method and Description |
|---|---|
static AcsJCompletion |
fromCorbaCompletion(Completion corbaCompletion)
Factory method to create an
AcsJCompletion from an existing CORBA completion. |
AcsJException |
getAcsJException() |
int |
getCode()
Returns the completion code.
|
java.lang.String |
getProperty(java.lang.String key) |
long |
getTimeStamp()
Returns the timeStamp.
|
int |
getType()
Returns the completion type.
|
protected void |
init(AcsJException acsJEx)
Initializes this
AcsJCompletion object with the data of
an AcsJException (chain). |
protected void |
init(int type,
int code) |
boolean |
isError()
True if this completion represents an error condition.
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Allows extra information to be attached to the completion, but only if this completion represents an error.
|
Completion |
toCorbaCompletion()
Creates a CORBA style completion object from this Java style completion.
|
protected AcsJCompletion()
protected AcsJCompletion(int type,
int code)
type - code - protected AcsJCompletion(AcsJException acsJEx)
acsJEx - protected void init(int type,
int code)
protected void init(AcsJException acsJEx)
AcsJCompletion object with the data of
an AcsJException (chain).
Type, code, and timestamp are taken from acsJEx.
acsJEx - java.lang.NullPointerException - if acsJEx is null.public int getType()
public int getCode()
public long getTimeStamp()
public boolean isError()
getAcsJException().public AcsJException getAcsJException()
ErrorTrace,
or null if the completion does not correspond to an exception.isError()public Completion toCorbaCompletion()
ErrorTraces.
This method should be used when a Java implementation (of a component etc)
has to send an AcsJCompletion over Corba.
fromCorbaCompletion(Completion)public static AcsJCompletion fromCorbaCompletion(Completion corbaCompletion)
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.
completion - public java.lang.Object setProperty(java.lang.String key,
java.lang.String value)
null if it did not have one.java.lang.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.public java.lang.String getProperty(java.lang.String key)