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();
}
}
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);
}
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);
}
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);
}
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);
}
Aggregations