You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2010/04/01 11:04:51 UTC
svn commit: r929890 - in /geronimo/server/trunk/plugins:
j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/
jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/
tomcat/geronimo-tomcat7-clustering-wadi/src/main/jav...
Author: xuhaihong
Date: Thu Apr 1 09:04:50 2010
New Revision: 929890
URL: http://svn.apache.org/viewvc?rev=929890&view=rev
Log:
Update Tomcat integration codes according to latest Tomcat 7 changes
Modified:
geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/JspServletOptions.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/JkRouter.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatExecutorWrapper.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/CommonProtocol.java
geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java Thu Apr 1 09:04:50 2010
@@ -31,7 +31,6 @@ import org.apache.geronimo.kernel.config
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.repository.Environment;
import org.apache.xbean.finder.ClassFinder;
-import org.apache.xmlbeans.XmlObject;
/**
* @version $Rev$ $Date$
@@ -61,7 +60,7 @@ public abstract class Module<T, U> {
protected Module(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, T specDD, U vendorDD, String originalSpecDD, String namespace, AnnotatedApp annotatedApp) {
this(standAlone, moduleName, environment, new DeployableJarFile(moduleFile), targetPath, specDD, vendorDD, originalSpecDD, namespace, annotatedApp);
}
-
+
protected Module(boolean standAlone, AbstractName moduleName, Environment environment, Deployable deployable, String targetPath, T specDD, U vendorDD, String originalSpecDD, String namespace, AnnotatedApp annotatedApp) {
assert targetPath != null: "targetPath is null";
assert moduleName != null: "moduleName is null";
@@ -115,13 +114,13 @@ public abstract class Module<T, U> {
return ((DeployableJarFile) deployable).getJarFile();
} else {
throw new RuntimeException("getModuleFile() is not supported on Bundle-based deployment");
- }
+ }
}
-
+
public Deployable getDeployable() {
- return deployable;
+ return deployable;
}
-
+
public String getTargetPath() {
return targetPath;
}
Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/JspServletOptions.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/JspServletOptions.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/JspServletOptions.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/JspServletOptions.java Thu Apr 1 09:04:50 2010
@@ -156,4 +156,8 @@ public class JspServletOptions implement
return delegate.isXpoweredBy();
}
+ public boolean getRecompileOnFail() {
+ return delegate.getRecompileOnFail();
+ }
+
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java Thu Apr 1 09:04:50 2010
@@ -20,6 +20,7 @@
package org.apache.geronimo.tomcat.cluster;
import org.apache.catalina.LifecycleException;
+import org.apache.catalina.LifecycleState;
import org.apache.catalina.Session;
import org.apache.catalina.session.StandardManager;
import org.apache.catalina.session.StandardSession;
@@ -41,13 +42,13 @@ public class ClusteredManager extends St
throw new IllegalArgumentException("sessionManager is required");
}
this.sessionManager = sessionManager;
-
+
nodeName = sessionManager.getNode().getName();
router = newRouter(nodeName);
sessionManager.registerListener(new MigrationListener());
}
-
+
protected Router newRouter(String nodeName) {
return new JkRouter(nodeName);
}
@@ -56,12 +57,13 @@ public class ClusteredManager extends St
public String getJvmRoute() {
return nodeName;
}
-
+
@Override
- public void stop() throws LifecycleException {
- lifecycle.fireLifecycleEvent(STOP_EVENT, null);
+ protected void stopInternal() throws LifecycleException {
+ // lifecycle.fireLifecycleEvent(STOP_EVENT, null);
+ setState(LifecycleState.STOPPING);
}
-
+
@Override
public Session createEmptySession() {
return new ClusteredSession();
@@ -89,14 +91,14 @@ public class ClusteredManager extends St
}
remove(clusteredSession);
}
-
+
protected ClusteredSession getClusteredSession(org.apache.geronimo.clustering.Session session) {
String sessionId = session.getSessionId();
sessionId = router.transformGlobalSessionIdToSessionId(sessionId);
return (ClusteredSession) ClusteredManager.this.sessions.get(sessionId);
}
}
-
+
public class ClusteredSession extends StandardSession {
private org.apache.geronimo.clustering.Session session;
@@ -107,9 +109,9 @@ public class ClusteredManager extends St
protected ClusteredSession(org.apache.geronimo.clustering.Session session) {
super(ClusteredManager.this);
this.session = session;
-
+
attributes = session.getState();
-
+
String sessionId = router.transformGlobalSessionIdToSessionId(session.getSessionId());
super.setId(sessionId);
setValid(true);
@@ -119,15 +121,15 @@ public class ClusteredManager extends St
@Override
public void setId(String id) {
super.setId(id);
-
+
newUnderlyingSession(id);
-
+
attributes = session.getState();
}
protected void newUnderlyingSession(String id) {
String globalSessionId = router.transformSessionIdToGlobalSessionId(id);
-
+
try {
session = sessionManager.createSession(globalSessionId);
} catch (SessionAlreadyExistException e) {
@@ -140,7 +142,7 @@ public class ClusteredManager extends St
super.invalidate();
session.release();
}
-
+
@Override
public void endAccess() {
super.endAccess();
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/JkRouter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/JkRouter.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/JkRouter.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/JkRouter.java Thu Apr 1 09:04:50 2010
@@ -61,10 +61,10 @@ public class JkRouter implements Router
if (null == augmentedSessionID) {
return;
}
-
+
setNewSessionCookie(request, response, augmentedSessionID);
}
-
+
public String transformGlobalSessionIdToSessionId(String sessionId) {
return sessionId + "." + nodeName;
}
@@ -84,8 +84,8 @@ public class JkRouter implements Router
Cookie newCookie = new Cookie(Globals.SESSION_COOKIE_NAME, augmentedSessionID);
newCookie.setMaxAge(-1);
String contextPath = null;
- if (!response.getConnector().getEmptySessionPath() && (context != null)) {
- contextPath = context.getEncodedPath();
+ if (context != null && context.getSessionCookiePath() != null) {
+ contextPath = context.getSessionCookiePath();
}
if ((contextPath != null) && (contextPath.length() > 0)) {
newCookie.setPath(contextPath);
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java Thu Apr 1 09:04:50 2010
@@ -91,19 +91,19 @@ public class GeronimoStandardContext ext
private boolean authenticatorInstalled;
private ConfigurationFactory configurationFactory;
private String policyContextId;
-
+
private Bundle bundle;
private ServiceRegistration serviceRegistration;
public GeronimoStandardContext() {
setXmlNamespaceAware(true);
- // disable Tomcat startup TLD scanning
+ // disable Tomcat startup TLD scanning
setProcessTlds(false);
}
public void setContextProperties(TomcatContext ctx) throws DeploymentException {
bundle = ctx.getBundle();
-
+
setResources(new BundleDirContext(ctx.getBundle(), ctx.getModulePath()));
// Create ReadOnlyContext
@@ -176,7 +176,7 @@ public class GeronimoStandardContext ext
interceptor = new UserTransactionBeforeAfter(interceptor, index++, ctx.getUserTransaction());
addValve(new ProtectedTargetValve());
-
+
Valve clusteredValve = ctx.getClusteredValve();
if (null != clusteredValve) {
addValve(clusteredValve);
@@ -321,7 +321,7 @@ public class GeronimoStandardContext ext
if (serviceRegistration != null) {
serviceRegistration.unregister();
}
-
+
Object context[] = null;
if (beforeAfter != null){
@@ -345,16 +345,11 @@ public class GeronimoStandardContext ext
setDocBase(docBase);
}
- public synchronized void start() throws LifecycleException {
+ protected void startInternal() throws LifecycleException {
if (pipelineInitialized) {
try {
- Valve valve = getFirst();
+ Valve valve = getPipeline().getFirst();
valve.invoke(null, null);
- //Install the DefaultSubjectValve after the authentication valve so the default subject is supplied
- //only if no real subject is authenticated.
-
-// Valve defaultSubjectValve = new DefaultSubjectValve(defaultSubject);
-// addValve(defaultSubjectValve);
// if a servlet uses run-as then make sure role desgnates have been provided
if (hasRunAsServlet()) {
@@ -375,9 +370,9 @@ public class GeronimoStandardContext ext
throw new LifecycleException(e);
}
} else {
- super.start();
+ super.startInternal();
}
-
+
// for OSGi Web Applications support register ServletContext in service registry
if (WebApplicationUtils.isWebApplicationBundle(bundle)) {
serviceRegistration = WebApplicationUtils.registerServletContext(bundle, getServletContext());
@@ -502,7 +497,7 @@ public class GeronimoStandardContext ext
public void invoke(Request request, Response response) throws IOException, ServletException {
if (request == null && response == null) {
try {
- GeronimoStandardContext.super.start();
+ GeronimoStandardContext.super.startInternal();
} catch (LifecycleException e) {
throw (IOException) new IOException("wrapping lifecycle exception").initCause(e);
}
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatContainer.java Thu Apr 1 09:04:50 2010
@@ -51,7 +51,6 @@ import org.apache.geronimo.osgi.web.WebA
import org.apache.geronimo.security.jaas.ConfigurationFactory;
import org.apache.geronimo.security.ContextManager;
import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.tomcat.util.SecurityHolder;
import org.apache.geronimo.webservices.SoapHandler;
import org.apache.geronimo.webservices.WebServiceContainer;
import org.apache.naming.resources.DirContextURLStreamHandlerFactory;
@@ -285,7 +284,7 @@ public class TomcatContainer implements
}
context.setParent(host);
// set the bundle context attribute in the servlet context
- context.getServletContext().setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE,
+ context.getServletContext().setAttribute(WebApplicationConstants.BUNDLE_CONTEXT_ATTRIBUTE,
contextInfo.getBundle().getBundleContext());
// Set the context for the Tomcat implementation
@@ -296,57 +295,13 @@ public class TomcatContainer implements
((GeronimoStandardContext) context).setContextProperties(contextInfo);
}
- //Get the security-realm-name if there is one
- SecurityHolder secHolder = contextInfo.getSecurityHolder() == null? new SecurityHolder(): contextInfo.getSecurityHolder();
-
- //Did we declare a GBean at the context level?
-// if (contextInfo.getRealm() != null) {
-// Realm realm = contextInfo.getRealm();
-//
-// //Allow for the <security-realm-name> override from the
-// //geronimo-web.xml file to be used if our Realm is a JAAS type
-// if (secHolder.getConfigurationFactory() != null) {
-// if (realm instanceof JAASRealm) {
-// ((JAASRealm) realm).setAppName(secHolder.getConfigurationFactory().getConfigurationName());
-// }
-// }
-// context.setRealm(realm);
-// } else {
-// Realm realm = host.getRealm();
-// //Check and see if we have a declared realm name and no match to a parent name
-// if (secHolder.getConfigurationFactory() != null) {
-// //Is the context requiring JACC?
-// if (secHolder.isSecurity()) {
-// //JACC
-// realm = new TomcatGeronimoRealm(secHolder.getConfigurationFactory());
-// } else {
-// //JAAS
-// realm = new TomcatJAASRealm(secHolder.getConfigurationFactory());
-// ((JAASRealm) realm).setUserClassNames("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
-// ((JAASRealm) realm).setRoleClassNames("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
-// }
-//
-// if (log.isDebugEnabled()) {
-// log.debug("The security-realm-name '" + secHolder.getConfigurationFactory().getConfigurationName() +
-// "' was specified and a parent (Engine/Host) is not named the same or no RealmGBean was configured for this context. " +
-// "Creating a default " + realm.getClass().getName() +
-// " adapter for this context.");
-// }
-//
-// context.setRealm(realm);
-// } else {
-// //The same reason with the above
-// //anotherCtxObj.setRealm(realm);
-// }
-// }
-
// add application listeners to the new context
if (applicationListeners != null) {
for (String listener : applicationListeners) {
context.addApplicationListener(listener);
}
}
-
+
Collection<String> listeners = contextInfo.getListeners();
if (listeners != null) {
for (String listener : listeners) {
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatEJBWebServiceContext.java Thu Apr 1 09:04:50 2010
@@ -24,11 +24,7 @@ import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
-import javax.security.jacc.PolicyContext;
import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request;
@@ -56,7 +52,7 @@ public class TomcatEJBWebServiceContext
log.debug("EJB Webservice Context = " + contextPath);
this.classLoader = classLoader;
-
+
//Create a dummy wrapper
Wrapper wrapper = this.createWrapper();
String name = System.currentTimeMillis() + "";
@@ -66,8 +62,8 @@ public class TomcatEJBWebServiceContext
}
- public void start() throws LifecycleException {
- super.start();
+ protected void startInternal() throws LifecycleException {
+ super.startInternal();
addValve(new EJBWebServiceValve());
}
@@ -78,24 +74,24 @@ public class TomcatEJBWebServiceContext
ClassLoader oldClassLoader = currentThread.getContextClassLoader();
currentThread.setContextClassLoader(classLoader);
try {
- handle(req, res);
+ handle(req, res);
} finally {
currentThread.setContextClassLoader(oldClassLoader);
}
}
-
+
private void handle(Request req, Response res) throws IOException, ServletException {
- res.setContentType("text/xml");
+ res.setContentType("text/xml");
RequestAdapter request = new RequestAdapter(req);
ResponseAdapter response = new ResponseAdapter(res);
- request.setAttribute(WebServiceContainer.SERVLET_REQUEST, (HttpServletRequest)req);
- request.setAttribute(WebServiceContainer.SERVLET_RESPONSE, (HttpServletResponse)res);
+ request.setAttribute(WebServiceContainer.SERVLET_REQUEST, req);
+ request.setAttribute(WebServiceContainer.SERVLET_RESPONSE, res);
// TODO: add support for context
request.setAttribute(WebServiceContainer.SERVLET_CONTEXT, null);
req.finishRequest();
-
+
if (isWSDLRequest(req)) {
try {
webServiceContainer.getWsdl(request, response);
@@ -119,9 +115,9 @@ public class TomcatEJBWebServiceContext
}
private boolean isWSDLRequest(Request req) {
- return ("GET".equals(req.getMethod()) && (req.getParameter("wsdl") != null || req.getParameter("xsd") != null));
+ return ("GET".equals(req.getMethod()) && (req.getParameter("wsdl") != null || req.getParameter("xsd") != null));
}
-
+
}
public static class RequestAdapter implements WebServiceContainer.Request {
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatExecutorWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatExecutorWrapper.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatExecutorWrapper.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatExecutorWrapper.java Thu Apr 1 09:04:50 2010
@@ -17,22 +17,21 @@
* under the License.
*/
-
package org.apache.geronimo.tomcat;
import java.util.concurrent.TimeUnit;
import org.apache.catalina.LifecycleException;
-import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.util.LifecycleSupport;
+import org.apache.catalina.LifecycleState;
+import org.apache.catalina.util.LifecycleBase;
import org.apache.geronimo.pool.GeronimoExecutor;
/**
* @version $Rev$ $Date$
*/
-public class TomcatExecutorWrapper implements org.apache.catalina.Executor{
+public class TomcatExecutorWrapper extends LifecycleBase implements org.apache.catalina.Executor {
+
private final GeronimoExecutor executor;
- private final LifecycleSupport lifecycle = new LifecycleSupport(this);
public TomcatExecutorWrapper(GeronimoExecutor executor) {
this.executor = executor;
@@ -47,30 +46,16 @@ public class TomcatExecutorWrapper imple
executor.execute(runnable);
}
- public void addLifecycleListener(LifecycleListener listener) {
- lifecycle.addLifecycleListener(listener);
- }
-
- public LifecycleListener[] findLifecycleListeners() {
- return lifecycle.findLifecycleListeners();
- }
-
- public void removeLifecycleListener(LifecycleListener listener) {
- lifecycle.removeLifecycleListener(listener);
+ @Override
+ protected void startInternal() throws LifecycleException {
+ setState(LifecycleState.STARTING);
}
- public void start() throws LifecycleException {
- lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null);
- lifecycle.fireLifecycleEvent(START_EVENT, null);
- lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
+ @Override
+ protected void stopInternal() throws LifecycleException {
+ setState(LifecycleState.STOPPING);
}
- public void stop() throws LifecycleException {
- lifecycle.fireLifecycleEvent(BEFORE_STOP_EVENT, null);
- lifecycle.fireLifecycleEvent(STOP_EVENT, null);
- lifecycle.fireLifecycleEvent(AFTER_STOP_EVENT, null);
- }
-
@Override
public void execute(Runnable runnable, long timeout, TimeUnit unit) {
// FIXME Figure out how to implement it
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/CommonProtocol.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/CommonProtocol.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/CommonProtocol.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/CommonProtocol.java Thu Apr 1 09:04:50 2010
@@ -21,8 +21,6 @@ package org.apache.geronimo.tomcat.conne
public interface CommonProtocol {
public boolean getAllowTrace();
public void setAllowTrace(boolean allowTrace);
- public boolean getEmptySessionPath();
- public void setEmptySessionPath(boolean emptySessionPath);
public boolean getEnableLookups();
public void setEnableLookups(boolean enableLookups);
public int getMaxPostSize();
Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java?rev=929890&r1=929889&r2=929890&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java Thu Apr 1 09:04:50 2010
@@ -49,26 +49,26 @@ public abstract class ConnectorGBean ext
public final static String CONNECTOR_CONTAINER_REFERENCE = "TomcatContainer";
protected final ServerInfo serverInfo;
-
+
protected final Connector connector;
protected final TomcatContainer container;
private String name;
-
+
private boolean wrappedConnector;
-
+
public ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
@ParamAttribute(manageable=false, name = "protocol") String tomcatProtocol,
@ParamReference(name = "TomcatContainer") TomcatContainer container,
@ParamReference(name = "ServerInfo") ServerInfo serverInfo,
@ParamAttribute(manageable=false, name = "connector") Connector conn) throws Exception {
-
+
//Relief for new Tomcat-only parameters that may come in the future
if (initParams == null){
initParams = new HashMap<String, String>();
-
+
}
// Do we really need this?? For Tomcat I don't think so...
@@ -85,7 +85,7 @@ public abstract class ConnectorGBean ext
if (serverInfo == null){
throw new IllegalArgumentException("serverInfo cannot be null.");
}
-
+
tomcatProtocol = validateProtocol(tomcatProtocol);
this.name = name;
@@ -103,7 +103,7 @@ public abstract class ConnectorGBean ext
connector = conn;
wrappedConnector = true;
}
-
+
setParameters(connector, initParams);
}
@@ -121,66 +121,66 @@ public abstract class ConnectorGBean ext
String executorName=null;
Executor executor=null;
-
+
if (this.connector.getAttribute("executor") != null) {
-
+
Object value = connector.getAttribute("executor");
if (value == null)
executorName=null;
-
+
if (value instanceof String)
executorName= (String)value;
-
+
if(value instanceof Executor){
executorName= ((Executor) value).getName();
}
-
+
executor = TomcatServerGBean.executors.get(executorName);
-
- if (executor == null) {
-
+
+ if (executor == null) {
+
log.warn("No executor found with name:" + executorName+", trying to get default executor with name 'DefaultThreadPool'");
- executor = TomcatServerGBean.executors.get("DefaultThreadPool");
- }
-
-
+ executor = TomcatServerGBean.executors.get("DefaultThreadPool");
+ }
+
+
} else {
-
- executor = TomcatServerGBean.executors.get("DefaultThreadPool");
-
+
+ executor = TomcatServerGBean.executors.get("DefaultThreadPool");
+
if (executor == null) {
-
+
log.warn("No executor found in service with name: DefaultThreadPool");
-
- }
+
+ }
}
-
-
+
+
if (executor != null)
{
- log.info("executor:"+executor.getName()+" found, set it to connector:"+this.getName() );
+ log.info("executor:"+executor.getName()+" found, set it to connector:"+this.getName() );
try {
- IntrospectionUtils.callMethod1(this.connector.getProtocolHandler(),
- "setExecutor",
+ IntrospectionUtils.callMethod1(this.connector.getProtocolHandler(),
+ "setExecutor",
executor,
java.util.concurrent.Executor.class.getName(),
connector.getClass().getClassLoader());
} catch (Exception e) {
-
+
log.info("connector:"+this.getName()+"does not support executor set, do nothing");
}
}
-
+
container.addConnector(this.connector);
-
+
log.debug("{} connector started", name);
}
- public void doStop() {
+ public void doStop() {
if (!wrappedConnector) {
container.removeConnector(connector);
}
@@ -192,15 +192,15 @@ public abstract class ConnectorGBean ext
* @param protocol
*/
protected String validateProtocol(String tomcatProtocol) { return tomcatProtocol;}
-
+
public abstract int getDefaultPort();
-
+
public abstract String getGeronimoProtocol();
-
+
public abstract Stats getStats();
-
+
public abstract void resetStats();
-
+
public Object getInternalObject() {
return connector;
}
@@ -217,10 +217,6 @@ public abstract class ConnectorGBean ext
return connector.getAllowTrace();
}
- public void setEmptySessionPath(boolean emptySessionPath) {
- connector.setEmptySessionPath(emptySessionPath);
- }
-
public void setEnableLookups(boolean enabled) {
connector.setEnableLookups(enabled);
}
@@ -240,7 +236,7 @@ public abstract class ConnectorGBean ext
//to the container's scheme. This whole idea needs rework.
return getGeronimoProtocol();
}
-
+
public String getTomcatProtocol() {
return connector.getProtocol();
}
@@ -276,64 +272,64 @@ public abstract class ConnectorGBean ext
public boolean getUseIPVHosts() {
return connector.getUseIPVHosts();
}
-
+
@Persistent(manageable=false)
public void setMaxSavePostSize(int maxSavePostSize) {
connector.setMaxSavePostSize(maxSavePostSize);
}
-
+
@Persistent(manageable=false)
public void setProxyName(String proxyName) {
if (proxyName.equals(""))
proxyName = null;
connector.setProxyName(proxyName);
}
-
+
@Persistent(manageable=false)
public void setProxyPort(int port) {
connector.setProxyPort(port);
}
-
+
@Persistent(manageable=false)
public void setRedirectPort(int port) {
connector.setRedirectPort(port);
}
-
+
@Persistent(manageable=false)
public void setScheme(String scheme) {
connector.setScheme(scheme);
}
-
+
@Persistent(manageable=false)
public void setSecure(boolean secure) {
connector.setSecure(secure);
}
-
+
public boolean getSslEnabled() {
Object value = connector.getAttribute("SSLEnabled");
return value == null ? false : new Boolean(value.toString()).booleanValue();
}
-
+
@Persistent(manageable=false)
public void setSslEnabled(boolean sslEnabled) {
connector.setAttribute("SSLEnabled", sslEnabled);
}
-
+
@Persistent(manageable=false)
public void setUriEncoding(String uriEncoding) {
connector.setURIEncoding(uriEncoding);
}
-
+
@Persistent(manageable=false)
public void setUseBodyEncodingForURI(boolean useBodyEncodingForURI) {
connector.setUseBodyEncodingForURI(useBodyEncodingForURI);
}
-
+
@Persistent(manageable=false)
public void setUseIPVHosts(boolean useIPVHosts) {
connector.setUseIPVHosts(useIPVHosts);
}
-
+
@Persistent(manageable=false)
public void setXpoweredBy(boolean xpoweredBy) {
connector.setXpoweredBy(xpoweredBy);
@@ -348,10 +344,6 @@ public abstract class ConnectorGBean ext
return value == 0 ? 4096 : value;
}
- public boolean getEmptySessionPath() {
- return connector.getEmptySessionPath();
- }
-
public boolean getXpoweredBy() {
return connector.getXpoweredBy();
}