From: Fredrik Tolf Date: Mon, 28 Mar 2011 23:58:04 +0000 (+0200) Subject: Replaced ContextResponder with a more generic Destroyable interface. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=0fc245dfd4f7bb5f5c3ffbdfe0b1df37430ddc1d;p=jsvc.git Replaced ContextResponder with a more generic Destroyable interface. --- diff --git a/src/dolda/jsvc/ContextResponder.java b/src/dolda/jsvc/ContextResponder.java deleted file mode 100644 index 1ff7b44..0000000 --- a/src/dolda/jsvc/ContextResponder.java +++ /dev/null @@ -1,5 +0,0 @@ -package dolda.jsvc; - -public interface ContextResponder extends Responder { - public void destroy(); -} diff --git a/src/dolda/jsvc/Destroyable.java b/src/dolda/jsvc/Destroyable.java new file mode 100644 index 0000000..deb90eb --- /dev/null +++ b/src/dolda/jsvc/Destroyable.java @@ -0,0 +1,5 @@ +package dolda.jsvc; + +public interface Destroyable { + public void destroy(); +} diff --git a/src/dolda/jsvc/ThreadContext.java b/src/dolda/jsvc/ThreadContext.java index b6d9677..36b0121 100644 --- a/src/dolda/jsvc/ThreadContext.java +++ b/src/dolda/jsvc/ThreadContext.java @@ -118,8 +118,8 @@ public class ThreadContext extends ThreadGroup { } public void shutdown() { - if(root instanceof ContextResponder) - ((ContextResponder)root).destroy(); + if(root instanceof Destroyable) + ((Destroyable)root).destroy(); try { long last = 0; while(true) { diff --git a/src/dolda/jsvc/util/PerSession.java b/src/dolda/jsvc/util/PerSession.java index 562e2c9..0bb1ab0 100644 --- a/src/dolda/jsvc/util/PerSession.java +++ b/src/dolda/jsvc/util/PerSession.java @@ -93,8 +93,8 @@ public class PerSession implements Responder { if(resp == null) { resp = create(sess); sess.put(rcl, resp); - if(resp instanceof ContextResponder) { - final ContextResponder cr = (ContextResponder)resp; + if(resp instanceof Destroyable) { + final Destroyable cr = (Destroyable)resp; sess.listen(new Session.Listener() { public void destroy(Session sess) { cr.destroy();