Inherited by alma.acs.callbacks.Objects.MyAcsJCompletion.
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 |
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.
AcsJException
, which may be useful inside a catch block, use AcsJException#toAcsJCompletion(). Completion
to an AcsJCompletion
, use the static method fromCorbaCompletion. alma.acs.exceptions.AcsJCompletion.AcsJCompletion | ( | ) | [protected] |
Referenced by alma.acs.exceptions.AcsJCompletion.fromCorbaCompletion().
alma.acs.exceptions.AcsJCompletion.AcsJCompletion | ( | int | type, | |
int | code | |||
) | [protected] |
To be called from ctors of generated subclasses that can't have exceptions attached.
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.
acsJEx |
References alma.acs.exceptions.AcsJCompletion.init().
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.
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 | ( | ) |
ErrorTrace
, or null
if the completion does not correspond to an exception. Referenced by alma.acsexmplErrorComponent.ErrorComponentImpl.ErrorComponentImpl.exceptionFromCompletion(), alma.acs.exceptions.AcsJCompletion.getProperty(), alma.ACS.MasterComponentImpl.StateChangeListener.logNotification(), alma.acs.commandcenter.engine.Executor.remoteDaemonForServices(), alma.acs.exceptions.AcsJCompletion.setProperty(), alma.acsexmpl.clients.ErrorComponentTest.testCompletionFromCompletion(), alma.acsexmpl.clients.ErrorComponentTest.testCompletionFromException(), alma.acs.exceptions.AcsJCompletion.toCorbaCompletion(), and alma.ACS.MasterComponentImpl.MasterComponentImplBase.updateStateHierarchy().
int alma.acs.exceptions.AcsJCompletion.getCode | ( | ) |
Returns the completion code.
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.getCurrentState(), and alma.acs.exceptions.AcsJCompletion.toCorbaCompletion().
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 | ( | ) |
Returns the completion type.
Referenced by alma.ACS.MasterComponentImpl.StateChangeListener.getCurrentState(), and alma.acs.exceptions.AcsJCompletion.toCorbaCompletion().
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
.
acsJEx |
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 | ( | ) |
True if this completion represents an error condition. The error information can be obtained from getAcsJException.
Referenced by alma.acsexmplErrorComponent.ErrorComponentImpl.ErrorComponentImpl.exceptionFromCompletion(), alma.ACS.MasterComponentImpl.StateChangeListener.getCurrentState(), alma.acs.exceptions.AcsJCompletion.getProperty(), alma.ACS.MasterComponentImpl.StateChangeListener.logNotification(), alma.acs.commandcenter.engine.Executor.remoteDaemonForServices(), alma.acs.exceptions.AcsJCompletion.setProperty(), alma.acs.exceptions.AcsJCompletion.toCorbaCompletion(), and alma.ACS.MasterComponentImpl.MasterComponentImplBase.updateStateHierarchy().
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.
null
if it did not have one. 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 | ( | ) |
Creates a CORBA style completion object from this Java style completion. If present, the attached exceptions are converted to ErrorTrace
s.
This method should be used when a Java implementation (of a component etc) has to send an AcsJCompletion
over Corba.
References alma.acs.exceptions.AcsJCompletion.getAcsJException(), alma.acs.exceptions.AcsJCompletion.getCode(), alma.acs.exceptions.AcsJException.getErrorTrace(), alma.acs.exceptions.AcsJCompletion.getTimeStamp(), alma.acs.exceptions.AcsJCompletion.getType(), and alma.acs.exceptions.AcsJCompletion.isError().
Referenced by alma.acsexmplErrorComponent.ErrorComponentImpl.ErrorComponentImpl.completionFromCompletion(), alma.acsexmplErrorComponent.ErrorComponentImpl.ErrorComponentImpl.completionFromException(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.release_component_async().
Properties alma.acs.exceptions.AcsJCompletion.m_properties [protected] |