You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xi...@apache.org on 2013/05/13 04:40:36 UTC
svn commit: r1481687 - in
/geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main:
java/org/apache/geronimo/tomcat/model/EngineType.java xsd/server.xsd
Author: xiaming
Date: Mon May 13 02:40:36 2013
New Revision: 1481687
URL: http://svn.apache.org/r1481687
Log:
GERONIMO-6466 Add valve support in engine section, provided by xiezhi
Modified:
geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/xsd/server.xsd
Modified: geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java?rev=1481687&r1=1481686&r2=1481687&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java (original)
+++ geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/model/EngineType.java Mon May 13 02:40:36 2013
@@ -34,7 +34,9 @@ import javax.xml.namespace.QName;
import org.apache.catalina.Engine;
import org.apache.catalina.Host;
import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.Pipeline;
import org.apache.catalina.Realm;
+import org.apache.catalina.Valve;
import org.apache.catalina.core.StandardEngine;
import org.apache.xbean.recipe.ObjectRecipe;
import org.apache.xbean.recipe.Option;
@@ -54,6 +56,7 @@ import org.apache.xbean.recipe.Option;
* <element name="Host" type="{}HostType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="Cluster" type="{}ClusterType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="Listener" type="{}ListenerType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="Valve" type="{}ValveType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="className" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
@@ -72,7 +75,8 @@ import org.apache.xbean.recipe.Option;
"realm",
"host",
"cluster",
- "listener"
+ "listener",
+ "valve"
})
public class EngineType {
@@ -84,6 +88,8 @@ public class EngineType {
protected ClusterType cluster;
@XmlElement(name = "Listener")
protected List<ListenerType> listener;
+ @XmlElement(name = "Valve")
+ protected List<ValveType> valve;
@XmlAttribute
protected String className = StandardEngine.class.getName();
@XmlAttribute
@@ -184,6 +190,35 @@ public class EngineType {
}
/**
+ * Gets the value of the valve property.
+ *
+ * <p>
+ * This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
+ * This is why there is not a <CODE>set</CODE> method for the valve property.
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
+ * <pre>
+ * getValve().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link ValveType }
+ *
+ *
+ */
+ public List<ValveType> getValve() {
+ if (valve == null) {
+ valve = new ArrayList<ValveType>();
+ }
+ return this.valve;
+ }
+
+ /**
* Gets the value of the className property.
*
* @return
@@ -361,6 +396,13 @@ public class EngineType {
engine.addLifecycleListener(listener);
}
+ //valve
+ Pipeline pipeline = engine.getPipeline();
+ for (ValveType valveType : getValve()) {
+ Valve valve = valveType.getValve(cl);
+ pipeline.addValve(valve);
+ }
+
return engine;
}
}
Modified: geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/xsd/server.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/xsd/server.xsd?rev=1481687&r1=1481686&r2=1481687&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/xsd/server.xsd (original)
+++ geronimo/server/branches/3.0/plugins/tomcat/geronimo-tomcat7/src/main/xsd/server.xsd Mon May 13 02:40:36 2013
@@ -59,7 +59,8 @@
</xs:annotation>
</xs:element>
<xs:element name="Cluster" type="ClusterType" minOccurs="0" maxOccurs="unbounded"/>
- <xs:element name="Listener" type="ListenerType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="Listener" type="ListenerType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="Valve" type="ValveType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute type="xs:string" name="className" use="optional"/>
<xs:attribute type="xs:string" name="name"/>