Tabnine Logo
ProbeNotifier
Code IndexAdd Tabnine to your IDE (free)

How to use
ProbeNotifier
in
org.glassfish.grizzly.threadpool

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

origin: javaee/grizzly

/**
 * Method is called by a thread pool each time a dequeued task has been canceled
 * instead of being processed.
 *
 * @param task
 */
protected void onTaskCancelled(Runnable task) {
  ProbeNotifier.notifyTaskCancelled(this, task);
}
origin: javaee/grizzly

/**
 * <p>
 * This method will be invoked when a the specified {@link Runnable} has
 * completed execution.
 * </p>
 *
 * @param task the unit of work that has completed processing
 */
protected void onTaskCompletedEvent(Runnable task) {
  ProbeNotifier.notifyTaskCompleted(this, task);
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Method is called by a thread pool each time a task has been dequeued from
 * a task queue.
 *
 * @param task
 */
protected void onTaskDequeued(Runnable task) {
  ProbeNotifier.notifyTaskDequeued(this, task);
}
origin: javaee/grizzly

/**
 * Method is called by a thread pool, when new task could not be added
 * to a task queue, because task queue is full.
 * throws  {@link RejectedExecutionException}
 */
protected void onTaskQueueOverflow() {
  ProbeNotifier.notifyTaskQueueOverflow(this);
  
  throw new RejectedExecutionException(
      "The thread pool's task queue is full, limit: " +
      config.getQueueLimit());
}
origin: javaee/grizzly

/**
 * Method is called by <tt>AbstractThreadPool</tt>, when maximum number of
 * worker threads is reached and task will need to wait in task queue, until
 * one of the threads will be able to process it.
 */
protected void onMaxNumberOfThreadsReached() {
  ProbeNotifier.notifyMaxNumberOfThreads(this, config.getMaxPoolSize());
}
origin: javaee/grizzly

/**
 * Method is called by a thread pool each time new task has been queued to
 * a task queue.
 *
 * @param task
 */
protected void onTaskQueued(Runnable task) {
  ProbeNotifier.notifyTaskQueued(this, task);
}
origin: javaee/grizzly

/**
 * Method is called by {@link Worker}, when it's starting
 * {@link Worker#run()} method execution, which means, that ThreadPool's
 * thread is getting active and ready to process tasks.
 * This method is called from {@link Worker}'s thread.
 *
 * @param worker
 */
protected void onWorkerStarted(final Worker worker) {
  if (delayedQueue != null) {
    delayedQueue.add(worker, NEVER_TIMEOUT, TimeUnit.MILLISECONDS);
  }
  
  ProbeNotifier.notifyThreadAllocated(this, worker.t);
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void shutdown() {
  synchronized (stateLock) {
    if (running) {
      running = false;
      poisonAll();
      stateLock.notifyAll();
      ProbeNotifier.notifyThreadPoolStopped(this);
    }
  }
}
origin: javaee/grizzly

public FixedThreadPool(ThreadPoolConfig config) {
  super(config);
  this.workQueue = config.getQueue() != null ?
    (BlockingQueue<Runnable>) config.getQueue() :
    (BlockingQueue<Runnable>) config.setQueue(
      new LinkedTransferQueue<>()).getQueue();
  
  int poolSize = config.getMaxPoolSize();
  synchronized (stateLock) {
    while (poolSize-- > 0) {
      doStartWorker();
    }
  }
  ProbeNotifier.notifyThreadPoolStarted(this);
  super.onMaxNumberOfThreadsReached();
}
origin: javaee/grizzly

/**
 * Method is called by {@link Worker}, when it's completing
 * {@link Worker#run()} method execution, which in most cases means,
 * that ThreadPool's thread will be released. This method is called from
 * {@link Worker}'s thread.
 *
 * @param worker
 */
protected void onWorkerExit(Worker worker) {
  synchronized (stateLock) {
    workers.remove(worker);
    if (delayedQueue != null) {
      delayedQueue.remove(worker);
    }
    if (workers.isEmpty()) {
      // notify awaitTermination threads
      stateLock.notifyAll();
    }
  }
  ProbeNotifier.notifyThreadReleased(this, worker.t);
}
origin: org.glassfish.grizzly/grizzly-websockets-server

/**
 * Method is called by a thread pool, when new task could not be added
 * to a task queue, because task queue is full.
 * throws  {@link RejectedExecutionException}
 */
protected void onTaskQueueOverflow() {
  ProbeNotifier.notifyTaskQueueOverflow(this);
  
  throw new RejectedExecutionException(
      "The thread pool's task queue is full, limit: " +
      config.getQueueLimit());
}
origin: javaee/grizzly

/**
 * Method is called by <tt>AbstractThreadPool</tt>, when maximum number of
 * worker threads is reached and task will need to wait in task queue, until
 * one of the threads will be able to process it.
 */
protected void onMaxNumberOfThreadsReached() {
  ProbeNotifier.notifyMaxNumberOfThreads(this, config.getMaxPoolSize());
}
origin: org.glassfish.grizzly/grizzly-core

/**
 * Method is called by a thread pool each time new task has been queued to
 * a task queue.
 *
 * @param task
 */
protected void onTaskQueued(Runnable task) {
  ProbeNotifier.notifyTaskQueued(this, task);
}
origin: javaee/grizzly

/**
 * Method is called by {@link Worker}, when it's starting
 * {@link Worker#run()} method execution, which means, that ThreadPool's
 * thread is getting active and ready to process tasks.
 * This method is called from {@link Worker}'s thread.
 *
 * @param worker
 */
protected void onWorkerStarted(final Worker worker) {
  if (delayedQueue != null) {
    delayedQueue.add(worker, NEVER_TIMEOUT, TimeUnit.MILLISECONDS);
  }
  
  ProbeNotifier.notifyThreadAllocated(this, worker.t);
}
origin: javaee/grizzly

/**
 * {@inheritDoc}
 */
@Override
public void shutdown() {
  synchronized (stateLock) {
    if (running) {
      running = false;
      poisonAll();
      stateLock.notifyAll();
      ProbeNotifier.notifyThreadPoolStopped(this);
    }
  }
}
origin: javaee/grizzly

public FixedThreadPool(ThreadPoolConfig config) {
  super(config);
  this.workQueue = config.getQueue() != null ?
    (BlockingQueue<Runnable>) config.getQueue() :
    (BlockingQueue<Runnable>) config.setQueue(
      new LinkedTransferQueue<>()).getQueue();
  
  int poolSize = config.getMaxPoolSize();
  synchronized (stateLock) {
    while (poolSize-- > 0) {
      doStartWorker();
    }
  }
  ProbeNotifier.notifyThreadPoolStarted(this);
  super.onMaxNumberOfThreadsReached();
}
origin: javaee/grizzly

/**
 * Method is called by {@link Worker}, when it's completing
 * {@link Worker#run()} method execution, which in most cases means,
 * that ThreadPool's thread will be released. This method is called from
 * {@link Worker}'s thread.
 *
 * @param worker
 */
protected void onWorkerExit(Worker worker) {
  synchronized (stateLock) {
    workers.remove(worker);
    if (delayedQueue != null) {
      delayedQueue.remove(worker);
    }
    if (workers.isEmpty()) {
      // notify awaitTermination threads
      stateLock.notifyAll();
    }
  }
  ProbeNotifier.notifyThreadReleased(this, worker.t);
}
origin: javaee/grizzly

/**
 * Method is called by a thread pool each time a dequeued task has been canceled
 * instead of being processed.
 *
 * @param task
 */
protected void onTaskCancelled(Runnable task) {
  ProbeNotifier.notifyTaskCancelled(this, task);
}
origin: javaee/grizzly

/**
 * <p>
 * This method will be invoked when a the specified {@link Runnable} has
 * completed execution.
 * </p>
 *
 * @param task the unit of work that has completed processing
 */
protected void onTaskCompletedEvent(Runnable task) {
  ProbeNotifier.notifyTaskCompleted(this, task);
}
origin: javaee/grizzly

/**
 * Method is called by a thread pool, when new task could not be added
 * to a task queue, because task queue is full.
 * throws  {@link RejectedExecutionException}
 */
protected void onTaskQueueOverflow() {
  ProbeNotifier.notifyTaskQueueOverflow(this);
  
  throw new RejectedExecutionException(
      "The thread pool's task queue is full, limit: " +
      config.getQueueLimit());
}
org.glassfish.grizzly.threadpoolProbeNotifier

Javadoc

Utility class, which has notification methods for different ThreadPoolProbe events.

Most used methods

  • notifyMaxNumberOfThreads
    Notify registered ThreadPoolProbes about the "max number of threads reached" event.
  • notifyTaskCancelled
    Notify registered ThreadPoolProbes about the "task cancelled" event.
  • notifyTaskCompleted
    Notify registered ThreadPoolProbes about the "task completed" event.
  • notifyTaskDequeued
    Notify registered ThreadPoolProbes about the "task dequeued" event.
  • notifyTaskQueueOverflow
    Notify registered ThreadPoolProbes about the "task queue overflow" event.
  • notifyTaskQueued
    Notify registered ThreadPoolProbes about the "task queued" event.
  • notifyThreadAllocated
    Notify registered ThreadPoolProbes about the "thread allocated" event.
  • notifyThreadPoolStarted
    Notify registered ThreadPoolProbes about the "thread pool started" event.
  • notifyThreadPoolStopped
    Notify registered ThreadPoolProbes about the "thread pool stopped" event.
  • notifyThreadReleased
    Notify registered ThreadPoolProbes about the "thread released" event.

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top plugins for WebStorm
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