use of iso.std.iso_iec._24727.tech.schema.ReleaseContextResponse in project open-ecard by ecsec.
the class IFD method releaseContext.
@Override
public synchronized ReleaseContextResponse releaseContext(ReleaseContext parameters) {
ReleaseContextResponse response;
if (ByteUtils.compare(ctxHandle, parameters.getContextHandle())) {
if (numClients.decrementAndGet() == 0) {
// last client detaches
env.removeIFDCtx(ctxHandle);
ctxHandle = null;
numClients = null;
// terminate thread pool
// wait for threads to die and block new requests
threadPool.shutdownNow();
// just assume it worked ... and don't wait
threadPool = null;
asyncWaitThreads = null;
}
evManager.terminate();
response = WSHelper.makeResponse(ReleaseContextResponse.class, WSHelper.makeResultOK());
return response;
} else {
String msg = "Invalid context handle specified.";
Result r = WSHelper.makeResultError(ECardConstants.Minor.IFD.INVALID_CONTEXT_HANDLE, msg);
response = WSHelper.makeResponse(ReleaseContextResponse.class, r);
return response;
}
}
Aggregations