Package org.apache.aries.blueprint.utils.threading.impl

Examples of org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable


    try {
      return runUnlessShutdown(new Callable<Future<?>>() {

        public Future<?> call()
        {
          DiscardableRunnable t = new DiscardableRunnable(task, _unprocessedWork);
          try {
            return new WrappedFuture(_current.get().submit(t), t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
        }
      });
    } catch (Exception e) { throw new RejectedExecutionException(); }
View Full Code Here


    try {
      return runUnlessShutdown(new Callable<Future<T>>() {

        public Future<T> call()
        {
          DiscardableRunnable t = new DiscardableRunnable(task, _unprocessedWork);
          try {
            return new WrappedFuture<T>(_current.get().submit(t, result), t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
        }
      });
    } catch (Exception e) { throw new RejectedExecutionException(); }
View Full Code Here

    try {
      runUnlessShutdown(new Callable<Object>() {

        public Object call()
        {
          DiscardableRunnable t = new DiscardableRunnable(command, _unprocessedWork);
          try {
            _current.get().execute(t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
          return null;
        }
      });
View Full Code Here

    try {
      return runUnlessShutdown(new Callable<ScheduledFuture<?>>() {

        public ScheduledFuture<?> call()
        {
          DiscardableRunnable t = new DiscardableRunnable(command, _unprocessedWork);
          try {
            return new WrappedScheduledFuture(_current.get().schedule(t, delay, unit), t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
        }
      });
    } catch (Exception e) { throw new RejectedExecutionException(); }
View Full Code Here

    try {
      return runUnlessShutdown(new Callable<ScheduledFuture<?>>() {

        public ScheduledFuture<?> call()
        {
          DiscardableRunnable t = new DiscardableRunnable(command, _unprocessedWork);
          try {
            return new WrappedScheduledFuture(_current.get().scheduleAtFixedRate(t, initialDelay, period, unit), t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
        }
      });
    } catch (Exception e) { throw new RejectedExecutionException(); }
View Full Code Here

    try {
      return runUnlessShutdown(new Callable<ScheduledFuture<?>>() {

        public ScheduledFuture<?> call()
        {
          DiscardableRunnable t = new DiscardableRunnable(command, _unprocessedWork);
          try {
            return new WrappedScheduledFuture(_current.get().scheduleWithFixedDelay(t, initialDelay, delay, unit), t);
          } catch (RuntimeException e) {
            t.discard();
            throw e;
          }
        }
      });
    } catch (Exception e) { throw new RejectedExecutionException(); }
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.