From 50862df9c348d90199c0bf4d7399572ad28a5840 Mon Sep 17 00:00:00 2001 From: "ray.j.greenwell" Date: Mon, 7 Dec 2009 21:18:52 +0000 Subject: [PATCH] Implement java.util.concurrent.Executor. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2670 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Invoker.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/com/samskivert/util/Invoker.java b/src/java/com/samskivert/util/Invoker.java index aee0e287..4f9cd9fa 100644 --- a/src/java/com/samskivert/util/Invoker.java +++ b/src/java/com/samskivert/util/Invoker.java @@ -22,6 +22,8 @@ package com.samskivert.util; import java.util.HashMap; +import java.util.concurrent.Executor; + import static com.samskivert.Log.log; /** @@ -40,7 +42,7 @@ import static com.samskivert.Log.log; * is desirable. */ public class Invoker extends LoopingThread - implements RunQueue + implements Executor, RunQueue { /** * The unit encapsulates a unit of executable code that will be run on the invoker thread. It @@ -164,6 +166,12 @@ public class Invoker extends LoopingThread return _queue.size(); } + // from Executor + public void execute (Runnable command) + { + postRunnable(command); + } + // from RunQueue public void postRunnable (final Runnable r) {