Tabnine Logo
org.glassfish.grizzly.impl
Code IndexAdd Tabnine to your IDE (free)

How to use org.glassfish.grizzly.impl

Best Java code snippets using org.glassfish.grizzly.impl (Showing top 20 results out of 315)

origin: com.ning/async-http-client

  /**
   * @param transactionCtx
   * @return <tt>true</tt> if we can continue request/response processing,
   *          or <tt>false</tt> if future has been aborted
   */
  boolean setHttpTransactionCtx(
      final HttpTransactionContext transactionCtx) {
    this.transactionCtx = transactionCtx;
    return !delegate.isDone();
  }
}
origin: com.ning/async-http-client

@Override
public void onWritePossible() throws Exception {
  future.result(TRUE);
}
origin: com.ning/async-http-client

public V get(long timeout, TimeUnit unit)
    throws InterruptedException, ExecutionException, TimeoutException {
  return delegate.get(timeout, unit);
}
origin: com.ning/async-http-client

public void abort(Throwable t) {
  delegate.failure(t);
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Construct failed {@link Future}.
 */
public static <R> ReadyFutureImpl<R> create(Throwable failure) {
  final ReadyFutureImpl<R> future = takeFromCache();
  if (future != null) {
    future.failure = failure;
    return future;
  }
  return new ReadyFutureImpl<R>(failure);
}
origin: com.ning/async-http-client

public boolean cancel(boolean mayInterruptIfRunning) {
  return delegate.cancel(mayInterruptIfRunning);
}
origin: org.glassfish.grizzly/grizzly-websockets-server

  @Override
  public void recycle() {
    recycle(false);
  }
}
origin: javaee/grizzly

/**
 * Creates <tt>SafeFutureImpl</tt>
 */
@SuppressWarnings("unchecked")
public SafeFutureImpl() {
  sync = new Sync();
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
  isCancelled = true;
  notifyHaveResult();
  return true;
}
origin: com.ning/async-http-client

public boolean isCancelled() {
  return delegate.isCancelled();
}
origin: com.ning/async-http-client

GrizzlyResponseFuture(final AsyncHandler asyncHandler) {
  this.asyncHandler = asyncHandler;
  
  delegate = Futures.<V>createSafeFuture();
  delegate.addCompletionHandler(this);
}
origin: com.ning/async-http-client

public void done(V result) {
  delegate.result(result);
}
origin: com.ning/async-http-client

public V get() throws InterruptedException, ExecutionException {
  return delegate.get();
}
origin: com.ning/async-http-client

  @Override
  public void onError(Throwable t) {
    future.failure(makeIOException(t));
  }
});
origin: javaee/grizzly

/**
 * Construct {@link Future} with the result.
 */
public static <R> ReadyFutureImpl<R> create(R result) {
  final ReadyFutureImpl<R> future = takeFromCache();
  if (future != null) {
    future.result = result;
    return future;
  }
  return new ReadyFutureImpl<R>(result);
}
origin: com.ning/async-http-client

public boolean isDone() {
  return delegate.isDone();
}
origin: org.glassfish.grizzly/grizzly-http-server

  @Override
  public void shutdownForced() {
    serverConnection = null;
    if (shutdownFuture != null) {
      shutdownFuture.result(NetworkListener.this);
    }
  }
});
origin: com.ning/async-http-client

private static void block(final Connection c,
             final FutureImpl<Boolean> future) {
  try {
    final long writeTimeout =
        c.getTransport().getWriteTimeout(MILLISECONDS);
    if (writeTimeout != -1) {
      future.get(writeTimeout, MILLISECONDS);
    } else {
      future.get();
    }
  } catch (ExecutionException e) {
    c.closeWithReason(Exceptions.makeIOException(e.getCause()));
  } catch (Exception e) {
    c.closeWithReason(Exceptions.makeIOException(e));
  }
}
origin: org.glassfish.grizzly/grizzly-websockets-server

  @Override
  public void onClosed(Closeable closeable, @SuppressWarnings("deprecation") ICloseType type)
      throws IOException {
    final CloseReason cr = closeReason;
    assert cr != null;
    f.result(cr);
  }
});
origin: org.glassfish.grizzly/grizzly-http-server

  @Override
  public Filter call() throws Exception {
    return future.get();
  }
});
org.glassfish.grizzly.impl

Most used classes

  • FutureImpl
    Future interface, which has full control over the state.
  • SafeFutureImpl
  • ReadyFutureImpl
    Future implementation with the specific unmodifiable result.
  • SafeFutureImpl$Sync
  • UnsafeFutureImpl
    Simple thread-unsafe Future implementation.
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now