1 17 18 19 package org.apache.geronimo.jetty6.handler; 20 21 import org.mortbay.jetty.handler.AbstractHandler; 22 import org.mortbay.jetty.Handler; 23 import org.mortbay.jetty.Server; 24 25 28 public abstract class AbstractImmutableHandler extends AbstractHandler { 29 protected final AbstractHandler next; 30 31 protected AbstractImmutableHandler(AbstractHandler next) { 32 this.next = next; 33 } 34 35 protected void doStart() throws Exception { 36 next.start(); 37 } 38 39 protected void doStop() throws Exception { 40 next.stop(); 41 } 42 43 public void setServer(Server server) { 44 super.setServer(server); 45 next.setServer(server); 46 } 47 48 public void lifecycleCommand(LifecycleCommand lifecycleCommand) throws Exception { 49 if (next instanceof AbstractImmutableHandler) { 50 ((AbstractImmutableHandler)next).lifecycleCommand(lifecycleCommand); 51 } else { 52 lifecycleCommand.lifecycleMethod(); 53 } 54 } 55 56 57 } 58 | Popular Tags |