01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.tomcat50;
05:
06: import org.apache.catalina.Container;
07: import org.apache.catalina.Valve;
08: import org.apache.catalina.core.StandardPipeline;
09:
10: import com.tc.tomcat50.session.SessionValve50;
11:
12: public class TerracottaPipeline extends StandardPipeline {
13:
14: private final SessionValve50 tcValve;
15:
16: public TerracottaPipeline(Container container) {
17: super (container);
18: this .tcValve = new SessionValve50();
19: super .addValve(this .tcValve);
20: }
21:
22: public void removeValve(Valve valve) {
23: if (valve == tcValve) {
24: throw new IllegalArgumentException(
25: "Cannot remove the terracotta session valve");
26: }
27: super .removeValve(valve);
28: }
29:
30: public Valve[] getValves() {
31: Valve[] rv = super .getValves();
32: if (super .valves == rv) {
33: // make defensive copy
34: rv = (Valve[]) rv.clone();
35: }
36: return rv;
37: }
38:
39: }
|