Toggle navigation
Home
int to com.orientechnologies.orient.client.remote.OStorageRemoteSession
No. of Instances - 1
No. of Commits - 1
No. of Projects - {'orientdb'}
Hierarchy/Composition: Composition
Primitive Info: -
NameSpace: Jdk -> Internal
Mapping:
Update Anonymous class
{ @Override public OStorageOperationResult<Boolean> execute( final OChannelBinaryAsynchClient network) throws IOException { int pMode; if (mode == 1 && callback == null) pMode=2; else pMode=mode; try { beginRequest(network,OChannelBinaryProtocol.REQUEST_RECORD_HIDE); network.writeRID(recordId); network.writeByte((byte)pMode); } finally { endRequest(network); } switch (pMode) { case 0: try { beginResponse(network); return new OStorageOperationResult<Boolean>(network.readByte() == 1); } finally { endResponse(network); } case 1: if (callback != null) { final int sessionId=getSessionId(); Callable<Object> response=new Callable<Object>(){ public Object call() throws Exception { Boolean result; try { getCurrentSession().sessionId=sessionId; beginResponse(network); result=network.readByte() == 1; } finally { endResponse(network); getCurrentSession().sessionId=-1; } callback.call(recordId,result); return null; } } ; asynchExecutor.submit(new FutureTask<Object>(response)); } } return new OStorageOperationResult<Boolean>(false); } }
to
{ @Override public OStorageOperationResult<Boolean> execute( final OChannelBinaryAsynchClient network) throws IOException { int pMode; if (mode == 1 && callback == null) pMode=2; else pMode=mode; try { beginRequest(network,OChannelBinaryProtocol.REQUEST_RECORD_HIDE); network.writeRID(recordId); network.writeByte((byte)pMode); } finally { endRequest(network); } switch (pMode) { case 0: try { beginResponse(network); return new OStorageOperationResult<Boolean>(network.readByte() == 1); } finally { endResponse(network); } case 1: if (callback != null) { final OStorageRemoteSession session=getCurrentSession(); Callable<Object> response=new Callable<Object>(){ public Object call() throws Exception { Boolean result; try { setSessionOnThread(session); beginResponse(network); result=network.readByte() == 1; } finally { endResponse(network); setSessionOnThread(null); } callback.call(recordId,result); return null; } } ; asynchExecutor.submit(new FutureTask<Object>(response)); } } return new OStorageOperationResult<Boolean>(false); } }
Rename Variable
sessionId
to
session