List of usage examples for java.lang Runnable run
public abstract void run();
Runnable
is used to create a thread, starting the thread causes the object's run
method to be called in that separately executing thread. From source file:io.smartspaces.tasks.SimpleSequentialTaskQueue.java
/** * Process the next event./*from www .j a v a 2s . c o m*/ * * @throws InterruptedException * the thread got interrupted */ private void processNextTask() throws InterruptedException { try { Runnable task = tasks.take(); task.run(); } catch (InterruptedException e) { throw e; } catch (Exception e) { log.error("Error during task processing", e); } }
From source file:com.teradata.benchto.service.IntegrationTestBase.java
protected void withinTransaction(Runnable runnable) { new TransactionTemplate(transactionManager).execute(transactionStatus -> { runnable.run(); return new Object(); });/*from w w w . jav a 2s . co m*/ }
From source file:io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.java
private Runnable createWrappedRunnable(final Runnable task) { return () -> { try {//from w w w. j av a 2 s .c o m task.run(); } catch (Exception e) { handle(e); } }; }
From source file:org.vaadin.spring.internal.BeanStore.java
public void destroy() { LOGGER.debug("Destroying scope for [{}]", identification); for (Runnable destructionCallback : destructionCallbacks.values()) { destructionCallback.run(); }/*from ww w .j a va 2 s.c o m*/ destructionCallbacks.clear(); objectMap.clear(); if (destructionCallback != null) { destructionCallback.beanStoreDestoyed(this); } }
From source file:interactivespaces.util.concurrency.SequentialEventQueue.java
/** * Process the next event.//from www.j av a 2s . c o m * * @throws InterruptedException */ private void processNextEvent() throws InterruptedException { try { Runnable event = events.take(); event.run(); } catch (InterruptedException e) { throw e; } catch (Exception e) { log.error("Error during event processing", e); } }
From source file:com.github.mrstampy.gameboot.controller.GameBootMessageControllerTest.java
private void gameBootExpected(Runnable r) { r.run(); }
From source file:org.jruby.rack.mock.MockAsyncContext.java
@Override public void start(Runnable runnable) { runnable.run(); }
From source file:com.nesscomputing.velocity.VelocityGuiceModule.java
@Override protected void configure() { bind(Charset.class).annotatedWith(Encoding.class).toInstance(charset); for (Runnable action : bindingActions) { action.run(); }// w ww.java 2s . c om }
From source file:io.neba.core.blueprint.FelixTaskExecutor.java
@Override public void execute(Runnable task) { if (task == null) { throw new IllegalArgumentException("Method argument task must not be null."); }/*from w w w. java 2 s . c om*/ task.run(); }
From source file:com.zaubersoftware.gnip4j.api.impl.XMLActivityStreamFeedProcessorTest.java
@Override public void execute(final Runnable command) { command.run(); }