Example usage for java.util.concurrent ScheduledExecutorService execute

List of usage examples for java.util.concurrent ScheduledExecutorService execute

Introduction

In this page you can find the example usage for java.util.concurrent ScheduledExecutorService execute.

Prototype

void execute(Runnable command);

Source Link

Document

Executes the given command at some time in the future.

Usage

From source file:org.ros.internal.transport.OutgoingMessageQueue.java

public OutgoingMessageQueue(MessageSerializer<MessageType> serializer,
        ScheduledExecutorService executorService) {
    this.serializer = serializer;
    messages = new CircularBlockingQueue<MessageType>(MESSAGE_BUFFER_CAPACITY);
    channelGroup = new DefaultChannelGroup();
    writer = new Writer();
    latchMode = false;/*from   w ww .j a v  a  2 s.  c om*/
    executorService.execute(writer);
}

From source file:playmidi.task.MidiPlayTaskTest.java

/**
 * Test of run method, of class MidiPlayTask.
 *//*from w ww .  j  ava  2 s  .c  o m*/
@Test
public void testRun() throws IOException, FileNotFoundException, MidiUnavailableException,
        InvalidMidiDataException, InterruptedException {
    System.out.println("run");
    ScheduledExecutorService playerRunner = Executors.newSingleThreadScheduledExecutor();

    try (MidiPlayTask instance = new MidiPlayTask(name, count)) {
        playerRunner.execute(instance);
        Thread.sleep(20000);
        instance.stop();
    }
}

From source file:sk.baka.webvm.analyzer.utils.NotificationDelivery.java

@Override
protected void started(ScheduledExecutorService executor) {
    executor.execute(new Notificator());
}