OCallable
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.orientechnologies.common.util.OCallable(Showing top 15 results out of 315)

origin: com.orientechnologies/orientdb-server

public boolean executeInLock(final OCallable<Boolean, ODistributedResponseManager> callback) {
 synchronousResponsesLock.lock();
 try {
  return callback.call(this);
 } finally {
  synchronousResponsesLock.unlock();
 }
}
origin: com.orientechnologies/orientdb-core

protected void execInSeparateDatabase(final OCallable iCallback) {
 final ODatabaseDocumentInternal prevDb = ODatabaseRecordThreadLocal.instance().getIfDefined();
 try {
  iCallback.call(null);
 } finally {
  if (prevDb != null) {
   ODatabaseRecordThreadLocal.instance().set(prevDb);
  } else {
   ODatabaseRecordThreadLocal.instance().remove();
  }
 }
}
origin: com.orientechnologies/orientdb-server

public void sendStream(final int iCode, final String iReason, final String iContentType, final String iFileName,
  final OCallable<Void, OChunkedResponse> iWriter) throws IOException {
 writeStatus(iCode, iReason);
 writeHeaders(iContentType);
 writeLine("Content-Transfer-Encoding: binary");
 writeLine("Transfer-Encoding: chunked");
 if (iFileName != null) {
  writeLine("Content-Disposition: attachment; filename=\"" + iFileName + "\"");
 }
 writeLine(null);
 final OChunkedResponse chunkedOutput = new OChunkedResponse(this);
 iWriter.call(chunkedOutput);
 chunkedOutput.close();
 flush();
}
origin: com.orientechnologies/orientdb-core

 public OCommandExecutor getExecutor(OCommandRequestInternal iCommand) {
  final Class<? extends OCommandExecutor> executorClass = commandReqExecMap.get(iCommand.getClass());

  if (executorClass == null)
   throw new OCommandExecutorNotFoundException("Cannot find a command executor for the command request: " + iCommand);

  try {
   final OCommandExecutor exec = executorClass.newInstance();

   final OCallable<Void, OCommandRequest> callback = configCallbacks.get(iCommand.getClass());
   if (callback != null)
    callback.call(iCommand);

   return exec;

  } catch (Exception e) {
   throw OException.wrapException(new OCommandExecutionException("Cannot create the command executor of class " + executorClass
     + " for the command request: " + iCommand), e);
  }
 }
}
origin: com.orientechnologies/orientdb-core

public void closeAndMove(OCallable<Void, String> mover) {
 stateLock.acquireWriteLock();
 try {
  this.close(true, false);
  mover.call(this.storagePath);
 } finally {
  stateLock.releaseWriteLock();
 }
}
origin: com.orientechnologies/orient-commons

public static Object convert(final Object iObject, final OCallable<Object, Object> iCallback) {
 return iCallback != null ? iCallback.call(iObject) : iObject;
}
origin: com.orientechnologies/orientdb-server

public void executeInDBScope(OCallable<Void, ODatabase> callback) {
 final ODatabaseDocumentInternal currentDB = ODatabaseRecordThreadLocal.instance().getIfDefined();
 try {
  final ODatabase<?> db = openSystemDatabase();
  try {
   callback.call(db);
  } finally {
   db.close();
  }
 } finally {
  if (currentDB != null)
   ODatabaseRecordThreadLocal.instance().set(currentDB);
  else
   ODatabaseRecordThreadLocal.instance().remove();
 }
}
origin: com.orientechnologies/orientdb-server

public boolean executeInLock(final OCallable<Boolean, ODistributedResponseManager> callback) {
 synchronousResponsesLock.lock();
 try {
  return callback.call(this);
 } finally {
  synchronousResponsesLock.unlock();
 }
}
origin: com.orientechnologies/orientdb-server

public boolean executeInLock(final OCallable<Boolean, ODistributedResponseManager> callback) {
 synchronousResponsesLock.lock();
 try {
  return callback.call(this);
 } finally {
  synchronousResponsesLock.unlock();
 }
}
origin: com.orientechnologies/orientdb-core

public static Object convert(final Object iObject, final OCallable<Object, Object> iCallback) {
 return iCallback != null ? iCallback.call(iObject) : iObject;
}
origin: com.orientechnologies/orientdb-server

public void sendStream(final int iCode, final String iReason, final String iContentType, final String iFileName,
  final OCallable<Void, OChunkedResponse> iWriter) throws IOException {
 writeStatus(iCode, iReason);
 writeHeaders(iContentType);
 writeLine("Content-Transfer-Encoding: binary");
 writeLine("Transfer-Encoding: chunked");
 if (iFileName != null) {
  writeLine("Content-Disposition: attachment; filename=\"" + iFileName + "\"");
 }
 writeLine(null);
 final OChunkedResponse chunkedOutput = new OChunkedResponse(this);
 iWriter.call(chunkedOutput);
 chunkedOutput.close();
 flush();
}
origin: com.orientechnologies/orientdb-server

public void sendStream(final int iCode, final String iReason, final String iContentType, final String iFileName,
  final OCallable<Void, OChunkedResponse> iWriter) throws IOException {
 writeStatus(iCode, iReason);
 writeHeaders(iContentType);
 writeLine("Content-Transfer-Encoding: binary");
 writeLine("Transfer-Encoding: chunked");
 if (iFileName != null) {
  writeLine("Content-Disposition: attachment; filename=\"" + iFileName + "\"");
 }
 writeLine(null);
 final OChunkedResponse chunkedOutput = new OChunkedResponse(this);
 iWriter.call(chunkedOutput);
 chunkedOutput.close();
 flush();
}
origin: com.orientechnologies/orientdb-core

 public OCommandExecutor getExecutor(OCommandRequestInternal iCommand) {
  final Class<? extends OCommandExecutor> executorClass = commandReqExecMap.get(iCommand.getClass());

  if (executorClass == null)
   throw new OCommandExecutorNotFoundException("Cannot find a command executor for the command request: " + iCommand);

  try {
   final OCommandExecutor exec = executorClass.newInstance();

   final OCallable<Void, OCommandRequest> callback = configCallbacks.get(iCommand.getClass());
   if (callback != null)
    callback.call(iCommand);

   return exec;

  } catch (Exception e) {
   throw OException.wrapException(new OCommandExecutionException("Cannot create the command executor of class " + executorClass
     + " for the command request: " + iCommand), e);
  }
 }
}
origin: com.orientechnologies/orientdb-server

public void executeInDBScope(OCallable<Void, ODatabase> callback) {
 final ODatabaseDocumentInternal currentDB = ODatabaseRecordThreadLocal.instance().getIfDefined();
 try {
  final ODatabase<?> db = openSystemDatabase();
  try {
   callback.call(db);
  } finally {
   db.close();
  }
 } finally {
  if (currentDB != null)
   ODatabaseRecordThreadLocal.instance().set(currentDB);
  else
   ODatabaseRecordThreadLocal.instance().remove();
 }
}
origin: com.orientechnologies/orientdb-server

public void executeInDBScope(OCallable<Void, ODatabase> callback) {
 final ODatabaseDocumentInternal currentDB = ODatabaseRecordThreadLocal.instance().getIfDefined();
 try {
  final ODatabase<?> db = openSystemDatabase();
  try {
   callback.call(db);
  } finally {
   db.close();
  }
 } finally {
  if (currentDB != null)
   ODatabaseRecordThreadLocal.instance().set(currentDB);
  else
   ODatabaseRecordThreadLocal.instance().remove();
 }
}
com.orientechnologies.common.utilOCallable

Javadoc

Generic callable interface that accepts a parameter.

Most used methods

  • call

Popular classes and methods

  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • setContentView (Activity)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ResultSet (java.sql)
    A table of data representing a database result set, which is usually generated by executing a statem
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables us
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Collectors (java.util.stream)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)