You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2007/03/12 02:14:19 UTC
svn commit: r517062 - in /portals/pluto/trunk/pluto-container: ./
src/main/java/org/apache/pluto/core/ src/main/java/org/apache/pluto/util/
src/main/resources/META-INF/
Author: ddewolf
Date: Sun Mar 11 18:14:19 2007
New Revision: 517062
URL: http://svn.apache.org/viewvc?view=rev&rev=517062
Log:
PLUTO-336; Supporting multiple implementations for resolving application ids: Patching from 1.1.x
Added:
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java (with props)
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java (with props)
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java (with props)
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java (with props)
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java (with props)
portals/pluto/trunk/pluto-container/src/main/resources/META-INF/
portals/pluto/trunk/pluto-container/src/main/resources/META-INF/pluto.properties
Modified:
portals/pluto/trunk/pluto-container/pom.xml
portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
Modified: portals/pluto/trunk/pluto-container/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/pom.xml?view=diff&rev=517062&r1=517061&r2=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/pom.xml (original)
+++ portals/pluto/trunk/pluto-container/pom.xml Sun Mar 11 18:14:19 2007
@@ -83,6 +83,10 @@
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
+ <resource>
+ <directory>src/main/resources/META-INF</directory>
+ <targetPath>/META-INF</targetPath>
+ </resource>
</resources>
<testResources>
<testResource>
Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java (added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java Sun Mar 11 18:14:19 2007
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.core;
+
+import javax.servlet.ServletContext;
+
+public interface ApplicationIdResolver {
+
+ public static final int DECISIVE = 1;
+
+ public static final int MANUAL = 2;
+
+ public static final int DEFAULT = 3;
+
+ /**
+ * Resolve the applicationId for the given
+ * context.
+ *
+ * @param context
+ * @return
+ */
+ String resolveApplicationId(ServletContext context);
+
+ /**
+ * Retrive the degree of authority with which
+ * the resolver speaks.
+ *
+ * @return
+ */
+ int getAuthority();
+
+}
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/ApplicationIdResolver.java
------------------------------------------------------------------------------
svn:keywords = Id Author Date Rev
Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java (added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java Sun Mar 11 18:14:19 2007
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.core;
+
+import javax.servlet.ServletContext;
+
+public class AttributeApplicationIdResolver implements ApplicationIdResolver {
+
+ public static final String CONTEXT_PATH_PARAM = "org.apache.pluto.CONTEXT_PATH";
+
+ public String resolveApplicationId(ServletContext context) {
+ return (String)context.getAttribute(CONTEXT_PATH_PARAM);
+ }
+
+
+ public int getAuthority() {
+ return MANUAL;
+ }
+}
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/AttributeApplicationIdResolver.java
------------------------------------------------------------------------------
svn:keywords = Id Author Date Rev
Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java (added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java Sun Mar 11 18:14:19 2007
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.core;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.servlet.ServletContext;
+import java.net.URL;
+import java.net.MalformedURLException;
+
+
+public class DefaultApplicationIdResolver implements ApplicationIdResolver {
+
+ private static final Log LOG = LogFactory.getLog(DefaultApplicationIdResolver.class);
+
+ private static final String WEB_XML = "/WEB-INF/web.xml";
+
+ public String resolveApplicationId(ServletContext context) {
+ try {
+ URL webXmlUrl = context.getResource(WEB_XML);
+ String path = webXmlUrl.toExternalForm();
+ path = path.substring(0, path.indexOf(WEB_XML));
+ path = path.substring(path.lastIndexOf("/"));
+
+ int id = path.indexOf(".war");
+ if(id > 0) {
+ path = path.substring(0, id);
+ }
+ return path;
+ } catch (MalformedURLException e) {
+ LOG.warn("Erorr retrieving web.xml from ServletContext. Unable to derive contextPath.");
+ return null;
+ }
+ }
+
+ public int getAuthority() {
+ return DEFAULT;
+ }
+}
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultApplicationIdResolver.java
------------------------------------------------------------------------------
svn:keywords = Id Author Date Rev
Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java (added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java Sun Mar 11 18:14:19 2007
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.core;
+
+import javax.servlet.ServletContext;
+
+public class InitParameterApplicationIdResolver implements ApplicationIdResolver {
+
+ public static final String CONTEXT_PATH_PARAM = "org.apache.pluto.CONTEXT_PATH";
+
+ public String resolveApplicationId(ServletContext context) {
+ return context.getInitParameter(CONTEXT_PATH_PARAM);
+ }
+
+ public int getAuthority() {
+ return MANUAL;
+ }
+}
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/InitParameterApplicationIdResolver.java
------------------------------------------------------------------------------
svn:keywords = Id Author Date Rev
Modified: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java?view=diff&rev=517062&r1=517061&r2=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java (original)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java Sun Mar 11 18:14:19 2007
@@ -16,21 +16,6 @@
*/
package org.apache.pluto.core;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.pluto.PortletContainerException;
@@ -45,6 +30,20 @@
import org.apache.pluto.spi.optional.PortletRegistryEvent;
import org.apache.pluto.spi.optional.PortletRegistryListener;
import org.apache.pluto.spi.optional.PortletRegistryService;
+import org.apache.pluto.util.ClasspathScanner;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
/**
* Manager used to cache the portlet configurations which have
@@ -60,13 +59,16 @@
*/
private static final Log LOG = LogFactory.getLog(PortletContextManager.class);
- public static final String CONTEXT_PATH_PARAM = "org.apache.pluto.CONTEXT_PATH";
-
/**
* The singleton manager instance.
*/
private static final PortletContextManager MANAGER = new PortletContextManager();
+ /**
+ * List of application id resolvers. *
+ */
+ private static final List APP_ID_RESOLVERS = new ArrayList();
+
// Private Member Variables ------------------------------------------------
/**
@@ -132,7 +134,6 @@
}
/**
- *
* @param servletContext
* @return
* @throws PortletContainerException
@@ -147,7 +148,7 @@
.getPortletAppDD(servletContext);
PortletContextImpl portletContext = new PortletContextImpl(
- applicationId, servletContext, portletAppDD);
+ applicationId, servletContext, portletAppDD);
if (portletContext.getApplicationId() == null) {
throw new IllegalStateException("Unable to resolve unique identifier for portletContext.");
@@ -157,19 +158,19 @@
fireRegistered(portletContext);
}
- if(LOG.isInfoEnabled()) {
- LOG.info("Registered portlet application with application id '"+applicationId+"'");
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Registered portlet application with application id '" + applicationId + "'");
}
-
- return (InternalPortletContext)portletContexts.get(applicationId);
+
+ return (InternalPortletContext) portletContexts.get(applicationId);
}
public void remove(InternalPortletContext context) {
portletContexts.remove(context);
Iterator configs = portletConfigs.keySet().iterator();
- while(configs.hasNext()) {
- String key = (String)configs.next();
- if(key.startsWith(context.getApplicationId() + "/")) {
+ while (configs.hasNext()) {
+ String key = (String) configs.next();
+ if (key.startsWith(context.getApplicationId() + "/")) {
configs.remove();
}
}
@@ -192,7 +193,7 @@
}
public PortletContext getPortletContext(String applicationId)
- throws PortletContainerException {
+ throws PortletContainerException {
return (InternalPortletContext) portletContexts.get(applicationId);
}
@@ -202,7 +203,7 @@
public PortletDD getPortletDescriptor(String applicationId, String portletName) {
InternalPortletConfig ipc = (InternalPortletConfig) portletConfigs.get(applicationId + "/" + portletName);
- if(ipc != null) {
+ if (ipc != null) {
return ipc.getPortletDefinition();
}
return null;
@@ -251,14 +252,13 @@
LOG.info("Portlet Context '" + context.getApplicationId() + "' removed.");
}
-
//
// Utility
public static ServletContext getPortletContext(ServletContext portalContext, String portletContextPath) {
- if(Configuration.preventUnecessaryCrossContext()) {
+ if (Configuration.preventUnecessaryCrossContext()) {
String portalPath = getContextPath(portalContext);
- if(portalPath.equals(portletContextPath)) {
+ if (portalPath.equals(portletContextPath)) {
return portalContext;
}
}
@@ -289,38 +289,54 @@
}
}
- if(contextPath == null) {
- contextPath = context.getInitParameter(CONTEXT_PATH_PARAM);
- }
-
- if(contextPath == null) {
- context.getAttribute(CONTEXT_PATH_PARAM);
- }
-
- if(contextPath == null) {
+ if (contextPath == null) {
contextPath = computeContextPath(context);
}
return contextPath;
}
- private static final String WEB_XML = "/WEB-INF/web.xml";
+
protected static String computeContextPath(ServletContext context) {
- try {
- URL webXmlUrl = context.getResource(WEB_XML);
- String path = webXmlUrl.toExternalForm();
- path = path.substring(0, path.indexOf(WEB_XML));
- path = path.substring(path.lastIndexOf("/"));
-
- int id = path.indexOf(".war");
- if(id > 0) {
- path = path.substring(0, id);
+ if (APP_ID_RESOLVERS.size() < 1) {
+ List classes = null;
+ try {
+ classes = ClasspathScanner.findConfiguredImplementations(ApplicationIdResolver.class);
+ } catch (IOException e) {
+ throw new RuntimeException("Unable to find any ApplicationIdResolvers");
+ }
+ Iterator i = classes.iterator();
+ while (i.hasNext()) {
+ Class c = (Class) i.next();
+ try {
+ APP_ID_RESOLVERS.add(c.newInstance());
+ } catch (Exception e) {
+ LOG.warn("Unable to instantiate ApplicationIdResolver for class " + c.getName());
+ }
+ }
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Found " +APP_ID_RESOLVERS.size()+" application id resolvers.");
}
+ }
+
+ String path = null;
+ int authority = Integer.MAX_VALUE;
- return path;
- } catch (MalformedURLException e) {
- LOG.warn("Erorr retrieving web.xml from ServletContext. Unable to derive contextPath.");
- return null;
+ Iterator i = APP_ID_RESOLVERS.iterator();
+ while (i.hasNext()) {
+ ApplicationIdResolver resolver = (ApplicationIdResolver) i.next();
+ if (resolver.getAuthority() < authority || path == null) {
+ authority = resolver.getAuthority();
+ String temp = resolver.resolveApplicationId(context);
+ if(temp != null) {
+ path = temp;
+ }
+ }
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Resolved application id '"+path+"' with authority "+authority);
}
+ return path;
}
+
}
Added: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java (added)
+++ portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java Sun Mar 11 18:14:19 2007
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.util;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+public class ClasspathScanner {
+
+ private static final Log LOG = LogFactory.getLog(ClasspathScanner.class);
+
+ /**
+ * Retrieve a lit of all urls matching the specified
+ * path.
+ *
+ * @param path
+ * @return
+ * @throws IOException
+ */
+ public static List scan(String path) throws IOException {
+ List list = scan(path, ClasspathScanner.class.getClassLoader());
+ list.addAll(scan(path, Thread.currentThread().getContextClassLoader()));
+ list.add(ClasspathScanner.class.getResource(path));
+
+ if(LOG.isInfoEnabled()) {
+ LOG.info("Found "+list.size()+" resources for path '"+path+"'.");
+ }
+
+ return list;
+ }
+
+ /**
+ * Retrieve a list of all urls massing the specified path
+ * for the specified classloader.
+ *
+ * @param path
+ * @param loader
+ * @return
+ * @throws IOException
+ */
+ public static List scan(String path, ClassLoader loader) throws IOException {
+ ArrayList list = new ArrayList();
+ if (loader == null) {
+ return list;
+ }
+
+ Enumeration enumeration = loader.getResources(path);
+ while (enumeration.hasMoreElements()) {
+ list.add(enumeration.nextElement());
+ }
+ return list;
+ }
+
+ /**
+ * Mechanism for finding all implementations of the specified
+ * interface. This method is used for resolving low level
+ * implementations of interfaces needed by static and/or non
+ * services. These implementations are not bound to their
+ * container, but instead, are bound to the global application
+ * environment.
+ *
+ * @param implemented interface implemnted by configured impls
+ * @return list of classes
+ * @throws java.io.IOException if an error occurs during classpath scanning.
+ */
+ public static List findConfiguredImplementations(Class implemented)
+ throws IOException {
+ List classes = new ArrayList();
+ List resources = scan("/META-INF/pluto.properties");
+ Iterator i = resources.iterator();
+
+ Properties p = new Properties();
+ while (i.hasNext()) {
+ URL url = (URL) i.next();
+ p.load(url.openStream());
+ String impl = p.getProperty(implemented.getName());
+ if (impl != null) {
+ StringTokenizer st = new StringTokenizer(impl, ",", false);
+ while (st.hasMoreTokens()) {
+ String token = st.nextToken().trim();
+ if (token.length() > 0) {
+ try {
+ classes.add(Class.forName(token));
+ } catch (ClassNotFoundException cnfe) {
+ LOG.warn("Unable to find configured implementation " + impl + " of interface " + implemented.getName());
+ }
+ }
+ }
+ }
+ p.clear();
+ }
+ return classes;
+ }
+}
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/pluto/trunk/pluto-container/src/main/java/org/apache/pluto/util/ClasspathScanner.java
------------------------------------------------------------------------------
svn:keywords = Id Author Date Rev
Added: portals/pluto/trunk/pluto-container/src/main/resources/META-INF/pluto.properties
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-container/src/main/resources/META-INF/pluto.properties?view=auto&rev=517062
==============================================================================
--- portals/pluto/trunk/pluto-container/src/main/resources/META-INF/pluto.properties (added)
+++ portals/pluto/trunk/pluto-container/src/main/resources/META-INF/pluto.properties Sun Mar 11 18:14:19 2007
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+#
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+######################################################################
+
+######################################################################
+# Static and Low Level services required by pluto even before
+# the container is configured are registered within resources
+# named '/META-INF/pluto.properties'. These resources are scanned
+# and each one is given the opportunity to provide implementations
+# of the following services:
+#
+#
+# org.apache.pluto.core.ApplicationIdResolver -
+# used to resolve servlet context names in different environments.
+# In a Servlet 2.5 world this is directly available at initialization
+# however, in 2.4 and below, it must be resolved. Unfortunately,
+# different application servers do not all get resolved in the same
+# manner.
+org.apache.pluto.core.ApplicationIdResolver=org.apache.pluto.core.DefaultApplicationIdResolver,\
+ org.apache.pluto.core.InitParameterApplicationIdResolver,\
+ org.apache.pluto.core.AttributeApplicationIdResolver