Search in sources :

Example 6 with CBDescOut

use of alma.ACS.CBDescOut in project ACS by ACS-Community.

the class ManagerProxyImpl method release_component_async.

public void release_component_async(int id, String component_url, CBlong callback, CBDescIn desc) throws NoPermissionEx {
    pendingRequests.incrementAndGet();
    try {
        // simply release Component
        URI uri = null;
        if (component_url != null)
            uri = CURLHelper.createURI(component_url);
        final CBlong fcallback = callback;
        final CBDescOut descOut = new CBDescOut(0, desc.id_tag);
        LongCompletionCallback lcc = null;
        if (callback != null) {
            lcc = new LongCompletionCallback() {

                public void failed(int result, Throwable exception) {
                    if (exception instanceof AcsJException) {
                        AcsJException aex = (AcsJException) exception;
                        fcallback.done(result, aex.toAcsJCompletion().toCorbaCompletion(), descOut);
                    } else {
                        AcsJUnexpectedExceptionEx uex = new AcsJUnexpectedExceptionEx(exception);
                        fcallback.done(result, uex.toAcsJCompletion().toCorbaCompletion(), descOut);
                    }
                }

                public void done(int result) {
                    fcallback.done(result, new ACSErrOKAcsJCompletion().toCorbaCompletion(), descOut);
                }
            };
        }
        manager.releaseComponentAsync(id, uri, lcc);
    } catch (AcsJNoPermissionEx nop) {
        reportException(nop);
        // rethrow CORBA specific
        throw nop.toNoPermissionEx();
    } catch (URISyntaxException usi) {
        BadParametersException hbpe = new BadParametersException(usi.getMessage(), usi);
        reportException(hbpe);
        // rethrow CORBA specific
        throw new BAD_PARAM(usi.getMessage());
    } catch (BadParametersException bpe) {
        BadParametersException hbpe = new BadParametersException(bpe.getMessage(), bpe);
        reportException(hbpe);
        // rethrow CORBA specific
        throw new BAD_PARAM(bpe.getMessage());
    } catch (NoResourcesException nre) {
        NoResourcesException hnre = new NoResourcesException(nre.getMessage(), nre);
        reportException(hnre);
        // rethrow CORBA specific
        throw new NO_RESOURCES(nre.getMessage());
    } catch (Throwable ex) {
        CoreException hce = new CoreException(ex.getMessage(), ex);
        reportException(hce);
        // rethrow CORBA specific
        throw new UNKNOWN(ex.getMessage());
    } finally {
        pendingRequests.decrementAndGet();
    }
}
Also used : CBDescOut(alma.ACS.CBDescOut) AcsJException(alma.acs.exceptions.AcsJException) BAD_PARAM(org.omg.CORBA.BAD_PARAM) URISyntaxException(java.net.URISyntaxException) LongCompletionCallback(com.cosylab.acs.maci.Manager.LongCompletionCallback) URI(java.net.URI) BadParametersException(com.cosylab.acs.maci.BadParametersException) NoResourcesException(com.cosylab.acs.maci.NoResourcesException) CBlong(alma.ACS.CBlong) AcsJNoPermissionEx(alma.maciErrType.wrappers.AcsJNoPermissionEx) CoreException(com.cosylab.acs.maci.CoreException) AcsJUnexpectedExceptionEx(alma.ACSErrTypeCommon.wrappers.AcsJUnexpectedExceptionEx) ACSErrOKAcsJCompletion(alma.ACSErrTypeOK.wrappers.ACSErrOKAcsJCompletion) UNKNOWN(org.omg.CORBA.UNKNOWN) NO_RESOURCES(org.omg.CORBA.NO_RESOURCES)

Example 7 with CBDescOut

use of alma.ACS.CBDescOut in project ACS by ACS-Community.

the class ResponderUtil method respond.

/**
	 * @param exc
	 * @param cb
	 * @param descIn
	 */
public static void respond(Exception exc, CBdouble cb, CBDescIn descIn) {
    Completion completion = ResponderUtil.giveCompletion(exc);
    CBDescOut cbDescOut = ResponderUtil.giveDescOut(descIn);
    cb.done(-1D, completion, cbDescOut);
}
Also used : Completion(alma.ACSErr.Completion) MyAcsJCompletion(alma.acs.callbacks.Objects.MyAcsJCompletion) CBDescOut(alma.ACS.CBDescOut)

Example 8 with CBDescOut

use of alma.ACS.CBDescOut in project ACS by ACS-Community.

the class ResponderUtil method respond.

/**
	 * @param returnValue
	 * @param cb
	 * @param descIn
	 */
public static void respond(double[] returnValue, CBdoubleSeq cb, CBDescIn descIn) {
    Completion completion = ResponderUtil.giveCompletion();
    CBDescOut cbDescOut = ResponderUtil.giveDescOut(descIn);
    cb.done(returnValue, completion, cbDescOut);
}
Also used : Completion(alma.ACSErr.Completion) MyAcsJCompletion(alma.acs.callbacks.Objects.MyAcsJCompletion) CBDescOut(alma.ACS.CBDescOut)

Example 9 with CBDescOut

use of alma.ACS.CBDescOut in project ACS by ACS-Community.

the class ResponderUtil method respond.

/**
	 * @param returnValue
	 * @param cb
	 * @param descIn
	 */
public static void respond(int[] returnValue, CBlongSeq cb, CBDescIn descIn) {
    Completion completion = ResponderUtil.giveCompletion();
    CBDescOut cbDescOut = ResponderUtil.giveDescOut(descIn);
    cb.done(returnValue, completion, cbDescOut);
}
Also used : Completion(alma.ACSErr.Completion) MyAcsJCompletion(alma.acs.callbacks.Objects.MyAcsJCompletion) CBDescOut(alma.ACS.CBDescOut)

Example 10 with CBDescOut

use of alma.ACS.CBDescOut in project ACS by ACS-Community.

the class ResponderUtil method respond.

/**
	 * @param exc
	 * @param cb
	 * @param descIn
	 */
public static void respond(Exception exc, CBdoubleSeq cb, CBDescIn descIn) {
    Completion completion = ResponderUtil.giveCompletion(exc);
    CBDescOut cbDescOut = ResponderUtil.giveDescOut(descIn);
    cb.done(new double[] {}, completion, cbDescOut);
}
Also used : Completion(alma.ACSErr.Completion) MyAcsJCompletion(alma.acs.callbacks.Objects.MyAcsJCompletion) CBDescOut(alma.ACS.CBDescOut)

Aggregations

CBDescOut (alma.ACS.CBDescOut)16 Completion (alma.ACSErr.Completion)13 MyAcsJCompletion (alma.acs.callbacks.Objects.MyAcsJCompletion)12 CBlong (alma.ACS.CBlong)2 AcsJException (alma.acs.exceptions.AcsJException)2 AcsJNoPermissionEx (alma.maciErrType.wrappers.AcsJNoPermissionEx)2 CBDescIn (alma.ACS.CBDescIn)1 CBlongPOA (alma.ACS.CBlongPOA)1 AcsJUnexpectedExceptionEx (alma.ACSErrTypeCommon.wrappers.AcsJUnexpectedExceptionEx)1 AcsJUnknownEx (alma.ACSErrTypeCommon.wrappers.AcsJUnknownEx)1 ACSErrOKAcsJCompletion (alma.ACSErrTypeOK.wrappers.ACSErrOKAcsJCompletion)1 AcsJCompletion (alma.acs.exceptions.AcsJCompletion)1 CannotActivateComponentEx (alma.maciErrType.CannotActivateComponentEx)1 ComponentDeactivationFailedEx (alma.maciErrType.ComponentDeactivationFailedEx)1 ComponentDeactivationUncleanEx (alma.maciErrType.ComponentDeactivationUncleanEx)1 NoPermissionEx (alma.maciErrType.NoPermissionEx)1 AcsJCannotActivateComponentEx (alma.maciErrType.wrappers.AcsJCannotActivateComponentEx)1 AcsJComponentDeactivationFailedEx (alma.maciErrType.wrappers.AcsJComponentDeactivationFailedEx)1 AcsJComponentDeactivationUncleanEx (alma.maciErrType.wrappers.AcsJComponentDeactivationUncleanEx)1 BadParametersException (com.cosylab.acs.maci.BadParametersException)1