You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2004/10/06 19:58:22 UTC
svn commit: rev 53889 - in geronimo/trunk/modules/jetty/src: etc/META-INF java/org/apache/geronimo/jetty java/org/apache/geronimo/jetty/connector java/org/apache/geronimo/jetty/deployment schema test-resources/deployables/war3/WEB-INF test/org/apache/geronimo/jetty test/org/apache/geronimo/jetty/deployment
Author: dain
Date: Wed Oct 6 10:58:21 2004
New Revision: 53889
Modified:
geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServer.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppHandler.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyXMLConfiguration.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/AJP13Connector.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPConnector.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyGBeanAdapter.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfiguration.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigurer.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java
geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigRoot.java
geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd
geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/jetty-web.xml
geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/web.xml
geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java
geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java
geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java
Log:
Reformat, optimize imports and bring in line with geronimo coding conventions
Modified: geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml
==============================================================================
--- geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml (original)
+++ geronimo/trunk/modules/jetty/src/etc/META-INF/geronimo-service.xml Wed Oct 6 10:58:21 2004
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
+
<service xmlns="http://geronimo.apache.org/xml/ns/deployment">
<dependency>
<uri>jetty/jars/org.mortbay.jetty-5.1.0-SNAPSHOT.jar</uri>
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java Wed Oct 6 10:58:21 2004
@@ -16,18 +16,18 @@
*/
package org.apache.geronimo.jetty;
-import javax.security.auth.Subject;
import java.security.Principal;
import java.util.Stack;
+import javax.security.auth.Subject;
/**
* @version $Rev$ $Date$
*/
public class JAASJettyPrincipal implements Principal {
- private String name;
+ private final String name;
private Subject subject;
- private Stack stack = new Stack();
+ private final Stack stack = new Stack();
public JAASJettyPrincipal(String name) {
this.name = name;
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JAASJettyRealm.java Wed Oct 6 10:58:21 2004
@@ -39,13 +39,12 @@
* @version $Rev$ $Date$
*/
public class JAASJettyRealm implements UserRealm, GBeanLifecycle {
-
private static Log log = LogFactory.getLog(JAASJettyRealm.class);
private final JettyContainer container;
private String realmName;
private String loginModuleName;
- private HashMap userMap = new HashMap();
+ private final HashMap userMap = new HashMap();
public JAASJettyRealm(JettyContainer container) {
this.container = container;
@@ -80,9 +79,9 @@
char[] password;
if (credentials instanceof char[]) {
- password = (char[])credentials;
+ password = (char[]) credentials;
} else if (credentials instanceof String) {
- password = ((String)credentials).toCharArray();
+ password = ((String) credentials).toCharArray();
} else {
throw new LoginException("Cannot extract credentials from class: " + credentials.getClass().getName());
}
@@ -119,7 +118,7 @@
public boolean reauthenticate(Principal user) {
// TODO This is not correct if auth can expire! We need to
- ContextManager.setCurrentCaller(((JAASJettyPrincipal)user).getSubject());
+ ContextManager.setCurrentCaller(((JAASJettyPrincipal) user).getSubject());
// get the user out of the cache
return (userMap.get(user.getName()) != null);
@@ -140,13 +139,13 @@
}
public Principal pushRole(Principal user, String role) {
- ((JAASJettyPrincipal)user).push(ContextManager.getCurrentCaller());
+ ((JAASJettyPrincipal) user).push(ContextManager.getCurrentCaller());
ContextManager.setCurrentCaller(JettyServer.getCurrentWebAppContext().getRoleDesignate(role));
return user;
}
public Principal popRole(Principal user) {
- ContextManager.setCurrentCaller(((JAASJettyPrincipal)user).pop());
+ ContextManager.setCurrentCaller(((JAASJettyPrincipal) user).pop());
return user;
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java Wed Oct 6 10:58:21 2004
@@ -17,22 +17,23 @@
package org.apache.geronimo.jetty;
-import org.mortbay.http.HttpListener;
import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpListener;
import org.mortbay.http.UserRealm;
/**
- *
- *
* @version $Rev$ $Date$
*/
public interface JettyContainer {
void addListener(HttpListener listener);
+
void removeListener(HttpListener listener);
void addContext(HttpContext context);
+
void removeContext(HttpContext context);
void addRealm(UserRealm realm);
+
void removeRealm(UserRealm realm);
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java Wed Oct 6 10:58:21 2004
@@ -30,7 +30,6 @@
* @version $Rev$ $Date$
*/
public class JettyContainerImpl implements JettyContainer, GBeanLifecycle {
-
private final Server server;
public JettyContainerImpl() {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServer.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServer.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServer.java Wed Oct 6 10:58:21 2004
@@ -20,20 +20,18 @@
import java.util.HashMap;
import java.util.Map;
+import org.apache.geronimo.security.ContextManager;
import org.mortbay.http.HttpRequest;
import org.mortbay.http.UserRealm;
import org.mortbay.jetty.Server;
-import org.apache.geronimo.security.ContextManager;
-
/**
* @version $Rev$ $Date$
*/
public class JettyServer extends Server {
-
- private Map realmDelegates = new HashMap();
private final static ThreadLocal currentWebAppContext = new ThreadLocal();
+ private final Map realmDelegates = new HashMap();
public UserRealm addRealm(UserRealm realm) {
RealmDelegate delegate = (RealmDelegate) realmDelegates.get(realm.getName());
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java Wed Oct 6 10:58:21 2004
@@ -16,12 +16,12 @@
*/
package org.apache.geronimo.jetty;
+import java.io.IOException;
+import javax.security.jacc.PolicyContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.UnavailableException;
-import javax.security.jacc.PolicyContext;
-import java.io.IOException;
import org.mortbay.jetty.servlet.ServletHandler;
import org.mortbay.jetty.servlet.ServletHolder;
@@ -32,11 +32,11 @@
* This ServletHolder's sole purpose is to provide the thread's current
* ServletHolder for realms that are interested in the current servlet, e.g.
* current servlet name.
- * @see org.apache.geronimo.jetty.JAASJettyRealm#isUserInRole(java.security.Principal, java.lang.String)
+ *
* @version $Rev$ $Date$
+ * @see org.apache.geronimo.jetty.JAASJettyRealm#isUserInRole(java.security.Principal, java.lang.String)
*/
public class JettyServletHolder extends ServletHolder {
-
private static final ThreadLocal currentServletHolder = new ThreadLocal();
public JettyServletHolder() {
@@ -48,17 +48,12 @@
}
public JettyServletHolder(ServletHandler handler, String name, String className, String forcedPath) {
- super(handler,name, className, forcedPath);
+ super(handler, name, className, forcedPath);
}
/**
* Service a request with this servlet. Set the ThreadLocal to hold the
* current JettyServletHolder.
- * @param request
- * @param response
- * @throws ServletException
- * @throws UnavailableException
- * @throws IOException
*/
public void handle(ServletRequest request, ServletResponse response)
throws ServletException, UnavailableException, IOException {
@@ -66,11 +61,12 @@
currentServletHolder.set(this);
PolicyContext.setHandlerData(ServletHttpRequest.unwrap(request));
- super.handle(request, response);
+ super.handle(request, response);
}
/**
* Provide the thread's current JettyServletHolder
+ *
* @return the thread's current JettyServletHolder
* @see org.apache.geronimo.jetty.JAASJettyRealm#isUserInRole(java.security.Principal, java.lang.String)
*/
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Wed Oct 6 10:58:21 2004
@@ -50,7 +50,6 @@
* @version $Rev$ $Date$
*/
public class JettyWebAppContext extends WebApplicationContext implements GBeanLifecycle {
-
private static Log log = LogFactory.getLog(JettyWebAppContext.class);
private final ConfigurationParent config;
@@ -71,15 +70,15 @@
}
public JettyWebAppContext(URI uri,
- ReadOnlyContext compContext,
- UserTransactionImpl userTransaction,
- ClassLoader classLoader,
- Set unshareableResources,
- Set applicationManagedSecurityResources,
- TransactionContextManager transactionContextManager,
- TrackedConnectionAssociator associator,
- ConfigurationParent config,
- JettyContainer container) {
+ ReadOnlyContext compContext,
+ UserTransactionImpl userTransaction,
+ ClassLoader classLoader,
+ Set unshareableResources,
+ Set applicationManagedSecurityResources,
+ TransactionContextManager transactionContextManager,
+ TrackedConnectionAssociator associator,
+ ConfigurationParent config,
+ JettyContainer container) {
super();
assert container != null;
@@ -117,7 +116,7 @@
* setContextPriorityClassLoader.
*
* @param b True if this context should give web application class in preference over the containers
- * classes, as per the servlet specification recommendations.
+ * classes, as per the servlet specification recommendations.
*/
public void setContextPriorityClassLoader(boolean b) {
contextPriorityClassLoader = b;
@@ -127,9 +126,7 @@
* init the classloader. Uses the value of contextPriorityClassLoader to
* determine if the context needs to create its own classloader.
*/
- protected void initClassLoader(boolean forceContextLoader)
- throws MalformedURLException, IOException {
-
+ protected void initClassLoader(boolean forceContextLoader) throws MalformedURLException, IOException {
setClassLoaderJava2Compliant(!contextPriorityClassLoader);
if (!contextPriorityClassLoader) {
// TODO - once geronimo is correctly setting up the classpath, this should be uncommented.
@@ -144,9 +141,9 @@
}
public void handle(String pathInContext,
- String pathParams,
- HttpRequest httpRequest,
- HttpResponse httpResponse)
+ String pathParams,
+ HttpRequest httpRequest,
+ HttpResponse httpResponse)
throws HttpException, IOException {
// save previous state
@@ -201,7 +198,6 @@
}
public void doStart() throws WaitingException, Exception {
-
// merge Geronimo and Jetty Lifecycles
if (!isStarting()) {
super.start();
@@ -273,7 +269,6 @@
}
public void doStop() throws Exception {
-
// merge Geronimo and Jetty Lifecycles
if (!isStopping()) {
super.stop();
@@ -346,13 +341,12 @@
}
public void doFail() {
-
try {
super.stop();
} catch (InterruptedException e) {
}
- container.removeContext(this);
+ container.removeContext(this);
log.info("JettyWebAppContext failed");
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppHandler.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppHandler.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppHandler.java Wed Oct 6 10:58:21 2004
@@ -34,22 +34,22 @@
* @see org.apache.geronimo.jetty.JAASJettyRealm#isUserInRole(java.security.Principal, java.lang.String)
*/
public class JettyWebAppHandler extends WebApplicationHandler {
-
/**
- * Return an instance of <code>JettyServletHolder</code>.
+ * Return a new instance of <code>JettyServletHolder</code>.
* <p/>
* This method overrides <code>WebApplicationHandler</code>'s implementation.
*
- * @param name The name of the servlet.
- * @param servletClass The class name of the servlet.
- * @param forcedPath If non null, the request attribute
- * javax.servlet.include.servlet_path will be set to this path before
- * service is called.
+ * @param name name of the servlet
+ * @param servletClass class name of the servlet
+ * @param forcedPath if non null the request attribute javax.servlet.include.servlet_path
+ * will be set to this path before service is called.
* @return an instance of <code>JettyServletHolder</code>
* @see org.mortbay.jetty.servlet.WebApplicationHandler#newServletHolder(java.lang.String, java.lang.String, java.lang.String)
*/
public ServletHolder newServletHolder(String name, String servletClass, String forcedPath) {
- if (_nameMap.containsKey(name)) throw new IllegalArgumentException("Named servlet already exists: " + name);
+ if (_nameMap.containsKey(name)) {
+ throw new IllegalArgumentException("Named servlet already exists: " + name);
+ }
ServletHolder holder = new JettyServletHolder(this, name, servletClass, forcedPath);
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java Wed Oct 6 10:58:21 2004
@@ -27,7 +27,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-
import javax.security.auth.Subject;
import javax.security.jacc.PolicyConfiguration;
import javax.security.jacc.PolicyConfigurationFactory;
@@ -75,7 +74,6 @@
* @see org.mortbay.jetty.servlet.WebApplicationContext#checkSecurityConstraints(java.lang.String, org.mortbay.http.HttpRequest, org.mortbay.http.HttpResponse)
*/
public class JettyWebAppJACCContext extends JettyWebAppContext {
-
private static Log log = LogFactory.getLog(JettyWebAppJACCContext.class);
private final String policyContextID;
@@ -84,11 +82,11 @@
private PolicyConfigurationFactory factory;
private PolicyConfiguration policyConfiguration;
- private Map roleDesignates = new HashMap();
+ private final Map roleDesignates = new HashMap();
- private JAASJettyPrincipal defaultPrincipal;
+ private final JAASJettyPrincipal defaultPrincipal;
- private PathMap _constraintMap = new PathMap();
+ private final PathMap constraintMap = new PathMap();
private String formLoginPath;
@@ -97,20 +95,19 @@
}
public JettyWebAppJACCContext(URI uri,
- ReadOnlyContext compContext,
- UserTransactionImpl userTransaction,
- ClassLoader classLoader,
- Set unshareableResources,
- Set applicationManagedSecurityResources,
- String policyContextID,
- Security securityConfig,
- TransactionContextManager transactionContextManager,
- TrackedConnectionAssociator associator,
- ConfigurationParent config,
- JettyContainer container
- ) {
- super(uri, compContext, userTransaction, classLoader, unshareableResources, applicationManagedSecurityResources, transactionContextManager, associator, config, container
- );
+ ReadOnlyContext compContext,
+ UserTransactionImpl userTransaction,
+ ClassLoader classLoader,
+ Set unshareableResources,
+ Set applicationManagedSecurityResources,
+ String policyContextID,
+ Security securityConfig,
+ TransactionContextManager transactionContextManager,
+ TrackedConnectionAssociator associator,
+ ConfigurationParent config,
+ JettyContainer container) {
+
+ super(uri, compContext, userTransaction, classLoader, unshareableResources, applicationManagedSecurityResources, transactionContextManager, associator, config, container);
this.policyContextID = policyContextID;
this.securityConfig = securityConfig;
@@ -143,16 +140,12 @@
* Call each HttpHandler until request is handled.
*
* @param pathInContext Path in context
- * @param pathParams Path parameters such as encoded Session ID
- * @param httpRequest
- * @param httpResponse
- * @throws HttpException
- * @throws IOException
+ * @param pathParams Path parameters such as encoded Session ID
*/
public void handle(String pathInContext,
- String pathParams,
- HttpRequest httpRequest,
- HttpResponse httpResponse)
+ String pathParams,
+ HttpRequest httpRequest,
+ HttpResponse httpResponse)
throws HttpException, IOException {
String savedPolicyContextID = PolicyContext.getContextID();
@@ -177,45 +170,49 @@
* but, to decide whether we should attempt to authenticate the request.
*
* @param pathSpec The path spec to which the secuiryt cosntraint applies
- * @param sc the security constraint
+ * @param sc the security constraint
* TODO Jetty to provide access to this map so we can remove this method
* @see org.mortbay.http.HttpContext#addSecurityConstraint(java.lang.String, org.mortbay.http.SecurityConstraint)
*/
public void addSecurityConstraint(String pathSpec, SecurityConstraint sc) {
super.addSecurityConstraint(pathSpec, sc);
- Object scs = _constraintMap.get(pathSpec);
+ Object scs = constraintMap.get(pathSpec);
scs = LazyList.add(scs, sc);
- _constraintMap.put(pathSpec, scs);
+ constraintMap.put(pathSpec, scs);
- if (log.isDebugEnabled()) log.debug("added " + sc + " at " + pathSpec);
+ if (log.isDebugEnabled()) {
+ log.debug("added " + sc + " at " + pathSpec);
+ }
}
/**
* Check the security constraints using JACC.
*
* @param pathInContext path in context
- * @param request HTTP request
- * @param response HTTP response
- * @return <code>true</code> if the path in context passes the security
- * check, <code>false</code> if it fails or a redirection has occured
- * during authentication.
- * @throws HttpException
- * @throws IOException
+ * @param request HTTP request
+ * @param response HTTP response
+ * @return true if the path in context passes the security check,
+ * false if it fails or a redirection has occured during authentication.
*/
public boolean checkSecurityConstraints(String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException {
-
if (formLoginPath != null) {
String pathToBeTested = (pathInContext.indexOf('?') > 0 ? pathInContext.substring(0, pathInContext.indexOf('?')) : pathInContext);
- if (pathToBeTested.equals(formLoginPath)) return true;
+ if (pathToBeTested.equals(formLoginPath)) {
+ return true;
+ }
}
try {
Principal user = obtainUser(pathInContext, request, response);
- if (user == null) return false;
- if (user == SecurityConstraint.__NOBODY) return true;
+ if (user == null) {
+ return false;
+ }
+ if (user == SecurityConstraint.__NOBODY) {
+ return true;
+ }
AccessControlContext acc = ContextManager.getCurrentContext();
ServletHttpRequest servletHttpRequest = (ServletHttpRequest) request.getWrapper();
@@ -247,19 +244,16 @@
* principal. This is automatically done by <code>JAASJettyRealm</code>.
*
* @param pathInContext path in context
- * @param request HTTP request
- * @param response HTTP response
+ * @param request HTTP request
+ * @param response HTTP response
* @return <code>null</code> if there is no authenticated user at the moment
* and security checking should not proceed and servlet handling should also
* not proceed, e.g. redirect. <code>SecurityConstraint.__NOBODY</code> if
* security checking should not proceed and servlet handling should proceed,
* e.g. login page.
- * @throws HttpException
- * @throws IOException
*/
public Principal obtainUser(String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException {
-
- List scss = _constraintMap.getMatches(pathInContext);
+ List scss = constraintMap.getMatches(pathInContext);
String pattern = null;
boolean unauthenticated = false;
boolean forbidden = false;
@@ -347,7 +341,6 @@
*
* @param securityConfig The Geronimo security configuration.
* @return the default principal
- * @throws GeronimoSecurityException
*/
protected JAASJettyPrincipal generateDefaultPrincipal(Security securityConfig) throws GeronimoSecurityException {
JAASJettyPrincipal result = new JAASJettyPrincipal("default");
@@ -356,9 +349,13 @@
DefaultPrincipal principal = securityConfig.getDefaultPrincipal();
RealmPrincipal realmPrincipal = ConfigurationUtil.generateRealmPrincipal(principal.getPrincipal(), principal.getRealmName());
- if (realmPrincipal == null) throw new GeronimoSecurityException("Unable to create realm principal");
+ if (realmPrincipal == null) {
+ throw new GeronimoSecurityException("Unable to create realm principal");
+ }
PrimaryRealmPrincipal primaryRealmPrincipal = ConfigurationUtil.generatePrimaryRealmPrincipal(principal.getPrincipal(), principal.getRealmName());
- if (primaryRealmPrincipal == null) throw new GeronimoSecurityException("Unable to create primary realm principal");
+ if (primaryRealmPrincipal == null) {
+ throw new GeronimoSecurityException("Unable to create primary realm principal");
+ }
defaultSubject.getPrincipals().add(realmPrincipal);
defaultSubject.getPrincipals().add(primaryRealmPrincipal);
@@ -369,7 +366,6 @@
}
public void doStart() throws WaitingException, Exception {
-
super.doStart();
Authenticator authenticator = getAuthenticator();
@@ -401,10 +397,10 @@
policyConfiguration = factory.getPolicyConfiguration(policyContextID, true);
Configuration[] configurations = getConfigurations();
- for (int i=0;i<configurations.length;i++)
- {
- if (configurations[i] instanceof JettyXMLConfiguration)
- ((JettyXMLConfiguration)configurations[i]).configure(policyConfiguration, securityConfig);
+ for (int i = 0; i < configurations.length; i++) {
+ if (configurations[i] instanceof JettyXMLConfiguration) {
+ ((JettyXMLConfiguration) configurations[i]).configure(policyConfiguration, securityConfig);
+ }
}
policyConfiguration.commit();
} catch (ClassNotFoundException e) {
@@ -436,7 +432,6 @@
}
public void doStop() throws WaitingException, Exception {
-
super.doStop();
/**
@@ -458,17 +453,20 @@
/**
* Delete the policy configuration for this web application
*/
- if (policyConfiguration != null) policyConfiguration.delete();
+ if (policyConfiguration != null) {
+ policyConfiguration.delete();
+ }
log.info("JettyWebAppJACCContext with JACC policy '" + policyContextID + "' stopped");
}
public void doFail() {
-
super.doFail();
try {
- if (policyConfiguration != null) policyConfiguration.delete();
+ if (policyConfiguration != null) {
+ policyConfiguration.delete();
+ }
} catch (PolicyContextException e) {
// do nothing
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyXMLConfiguration.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyXMLConfiguration.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyXMLConfiguration.java Wed Oct 6 10:58:21 2004
@@ -16,13 +16,6 @@
*/
package org.apache.geronimo.jetty;
-import javax.security.auth.Subject;
-import javax.security.jacc.PolicyConfiguration;
-import javax.security.jacc.PolicyContextException;
-import javax.security.jacc.WebResourcePermission;
-import javax.security.jacc.WebRoleRefPermission;
-import javax.security.jacc.WebUserDataPermission;
-import javax.servlet.UnavailableException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
@@ -30,12 +23,16 @@
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import javax.security.auth.Subject;
+import javax.security.jacc.PolicyConfiguration;
+import javax.security.jacc.PolicyContextException;
+import javax.security.jacc.WebResourcePermission;
+import javax.security.jacc.WebRoleRefPermission;
+import javax.security.jacc.WebUserDataPermission;
+import javax.servlet.UnavailableException;
-import org.mortbay.jetty.servlet.XMLConfiguration;
-import org.mortbay.xml.XmlParser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
import org.apache.geronimo.security.GeronimoSecurityException;
import org.apache.geronimo.security.RealmPrincipal;
import org.apache.geronimo.security.deploy.Principal;
@@ -45,6 +42,8 @@
import org.apache.geronimo.security.jacc.RoleMappingConfiguration;
import org.apache.geronimo.security.util.ConfigurationUtil;
import org.apache.geronimo.security.util.URLPattern;
+import org.mortbay.jetty.servlet.XMLConfiguration;
+import org.mortbay.xml.XmlParser;
/**
@@ -54,18 +53,17 @@
* @version $Rev$ $Date$
*/
public class JettyXMLConfiguration extends XMLConfiguration {
-
private static Log log = LogFactory.getLog(JettyXMLConfiguration.class);
- private Set securityRoles = new HashSet();
- private Map uncheckedPatterns = new HashMap();
- private Map excludedPatterns = new HashMap();
- private Map rolesPatterns = new HashMap();
- private Set allSet = new HashSet();
- private Map allMap = new HashMap();
- private Set allRoles = new HashSet();
- private Map roleRefs = new HashMap();
- private Map servletRoles = new HashMap();
+ private final Set securityRoles = new HashSet();
+ private final Map uncheckedPatterns = new HashMap();
+ private final Map excludedPatterns = new HashMap();
+ private final Map rolesPatterns = new HashMap();
+ private final Set allSet = new HashSet();
+ private final Map allMap = new HashMap();
+ private final Set allRoles = new HashSet();
+ private final Map roleRefs = new HashMap();
+ private final Map servletRoles = new HashMap();
protected void initialize(XmlParser.Node config) throws ClassNotFoundException, UnavailableException {
@@ -85,7 +83,7 @@
String name = node.getString("servlet-name", false, true);
if (name == null) name = node.getString("servlet-class", false, true);
- Set roles = (Set)servletRoles.get(name);
+ Set roles = (Set) servletRoles.get(name);
if (roles == null) {
roles = new HashSet();
servletRoles.put(name, roles);
@@ -119,11 +117,11 @@
* permissions. These permissions are placed into the appropriate
* <code>PolicyConfiguration</code> object as defined in the JACC spec.
*
- * @param node the deployment descriptor from which to obtain the
- * security constraints that are to be translated.
- * @throws org.apache.geronimo.security.GeronimoSecurityException
- * if there is any violation of the semantics of
- * the security descriptor or the state of the module configuration.
+ * @param node deployment descriptor from which to obtain the
+ * security constraints that are to be translated.
+ * @throws org.apache.geronimo.security.GeronimoSecurityException if there
+ * is any violation of the semantics of the security descriptor or the state
+ * of the module configuration.
* @see javax.security.jacc.PolicyConfiguration
* @see "Java Authorization Contract for Containers", section 3.1.3
*/
@@ -147,9 +145,9 @@
transport = data.get("transport-guarantee").toString(false, true).toUpperCase();
}
- for (Iterator resourceIiter = node.iterator("web-resource-collection"); resourceIiter.hasNext(); ) {
+ for (Iterator resourceIiter = node.iterator("web-resource-collection"); resourceIiter.hasNext();) {
XmlParser.Node collection = (XmlParser.Node) resourceIiter.next();
- for (Iterator urlPattermIter = collection.iterator("url-pattern"); urlPattermIter.hasNext(); ) {
+ for (Iterator urlPattermIter = collection.iterator("url-pattern"); urlPattermIter.hasNext();) {
String url = ((XmlParser.Node) urlPattermIter.next()).toString(false, true);
URLPattern pattern = (URLPattern) currentPatterns.get(url);
if (pattern == null) {
@@ -165,7 +163,7 @@
}
boolean noMethods = true;
- for (Iterator methodIter = collection.iterator("http-method"); methodIter.hasNext(); ) {
+ for (Iterator methodIter = collection.iterator("http-method"); methodIter.hasNext();) {
String method = ((XmlParser.Node) methodIter.next()).toString(false, true);
pattern.addMethod(method);
allPattern.addMethod(method);
@@ -178,7 +176,7 @@
}
if (currentPatterns == rolesPatterns) {
- for (Iterator roleNameIter = auths.iterator("role-name"); roleNameIter.hasNext(); ) {
+ for (Iterator roleNameIter = auths.iterator("role-name"); roleNameIter.hasNext();) {
String role = ((XmlParser.Node) roleNameIter.next()).toString(false, true);
if (role.equals("*")) {
allRoles.add(pattern);
@@ -195,7 +193,7 @@
protected void initSecurityRole(XmlParser.Node node) {
super.initSecurityRole(node);
-
+
securityRoles.add(node.get("role-name").toString(false, true));
}
@@ -204,15 +202,11 @@
* PolicyConfiguration.
*
* @param configuration the JACC PolicyConfiguration
- * @param security the augmented security information from the geronimo-web.xml file
- * @throws GeronimoSecurityException
+ * @param security the augmented security information from the geronimo-web.xml file
*/
public void configure(PolicyConfiguration configuration, Security security) throws GeronimoSecurityException {
try {
- /**
- *
- */
Iterator iter = excludedPatterns.keySet().iterator();
while (iter.hasNext()) {
URLPattern pattern = (URLPattern) excludedPatterns.get(iter.next());
@@ -223,9 +217,6 @@
configuration.addToExcludedPolicy(new WebUserDataPermission(name, actions));
}
- /**
- *
- */
iter = rolesPatterns.keySet().iterator();
while (iter.hasNext()) {
URLPattern pattern = (URLPattern) rolesPatterns.get(iter.next());
@@ -239,9 +230,6 @@
}
}
- /**
- *
- */
iter = uncheckedPatterns.keySet().iterator();
while (iter.hasNext()) {
URLPattern pattern = (URLPattern) uncheckedPatterns.get(iter.next());
@@ -251,9 +239,6 @@
configuration.addToUncheckedPolicy(new WebResourcePermission(name, actions));
}
- /**
- *
- */
iter = rolesPatterns.keySet().iterator();
while (iter.hasNext()) {
URLPattern pattern = (URLPattern) rolesPatterns.get(iter.next());
@@ -352,10 +337,10 @@
String servletName = (String) keys.next();
Set roles = new HashSet(securityRoles);
- roles.removeAll((Set)servletRoles.get(servletName));
+ roles.removeAll((Set) servletRoles.get(servletName));
iter = roles.iterator();
- while(iter.hasNext()) {
+ while (iter.hasNext()) {
String roleName = (String) iter.next();
configuration.addToRole(roleName, new WebRoleRefPermission(servletName, roleName));
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/AJP13Connector.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/AJP13Connector.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/AJP13Connector.java Wed Oct 6 10:58:21 2004
@@ -17,17 +17,12 @@
package org.apache.geronimo.jetty.connector;
-import java.util.Arrays;
-
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
-import org.apache.geronimo.gbean.GConstructorInfo;
import org.apache.geronimo.jetty.JettyContainer;
import org.mortbay.http.ajp.AJP13Listener;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class AJP13Connector extends JettyConnector {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPConnector.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPConnector.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPConnector.java Wed Oct 6 10:58:21 2004
@@ -17,17 +17,12 @@
package org.apache.geronimo.jetty.connector;
-import java.util.Arrays;
-
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
-import org.apache.geronimo.gbean.GConstructorInfo;
import org.apache.geronimo.jetty.JettyContainer;
import org.mortbay.http.SocketListener;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class HTTPConnector extends JettyConnector {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java Wed Oct 6 10:58:21 2004
@@ -17,17 +17,12 @@
package org.apache.geronimo.jetty.connector;
-import java.util.Arrays;
-
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
-import org.apache.geronimo.gbean.GConstructorInfo;
import org.apache.geronimo.jetty.JettyContainer;
import org.mortbay.http.SunJsseListener;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class HTTPSConnector extends JettyConnector {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyGBeanAdapter.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyGBeanAdapter.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyGBeanAdapter.java Wed Oct 6 10:58:21 2004
@@ -21,13 +21,9 @@
import org.apache.geronimo.xbeans.geronimo.jetty.JettyGbeanType;
/**
- *
- *
* @version $Rev$ $Date$
- *
- * */
+ */
public class JettyGBeanAdapter implements GBeanAdapter {
-
private final JettyGbeanType gbean;
public JettyGBeanAdapter(JettyGbeanType gbean) {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Wed Oct 6 10:58:21 2004
@@ -146,14 +146,13 @@
// load the geronimo-jetty.xml from either the supplied plan or from the earFile
try {
if (plan instanceof XmlObject) {
- jettyWebApp = (JettyWebAppType) SchemaConversionUtils.getNestedObjectAsType(
- (XmlObject) plan,
+ jettyWebApp = (JettyWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
"web-app",
JettyWebAppType.type);
} else {
JettyWebAppDocument jettyWebAppdoc = null;
if (plan != null) {
- jettyWebAppdoc = JettyWebAppDocument.Factory.parse((File)plan);
+ jettyWebAppdoc = JettyWebAppDocument.Factory.parse((File) plan);
} else {
URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
jettyWebAppdoc = JettyWebAppDocument.Factory.parse(path);
@@ -423,14 +422,12 @@
bean.setAttribute("applicationManagedSecurityResources", applicationManagedSecurityResources);
}
-
private static String getJ2eeStringValue(org.apache.geronimo.xbeans.j2ee.String string) {
if (string == null) {
return null;
}
return string.getStringValue();
}
-
private URI getDependencyURI(JettyDependencyType dep) throws DeploymentException {
URI uri;
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfiguration.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfiguration.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfiguration.java Wed Oct 6 10:58:21 2004
@@ -22,14 +22,10 @@
import org.apache.geronimo.deployment.plugin.DeploymentConfigurationSupport;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class WARConfiguration extends DeploymentConfigurationSupport {
-
public WARConfiguration(DeployableObject deployable) {
super(deployable, new WebAppDConfigRoot(deployable.getDDBeanRoot()));
}
-
}
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigurer.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigurer.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WARConfigurer.java Wed Oct 6 10:58:21 2004
@@ -26,8 +26,6 @@
import org.apache.geronimo.gbean.GBeanInfoFactory;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class WARConfigurer implements ModuleConfigurer {
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigBean.java Wed Oct 6 10:58:21 2004
@@ -25,18 +25,15 @@
import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
import org.apache.geronimo.naming.deployment.ENCHelper;
import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
import org.apache.xmlbeans.SchemaTypeLoader;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class WebAppDConfigBean extends DConfigBeanSupport {
-
- private ENCHelper encHelper;
+ private final ENCHelper encHelper;
WebAppDConfigBean(DDBean ddBean, JettyWebAppType webApp) {
super(ddBean, webApp);
@@ -134,15 +131,19 @@
getWebApp().setContextRoot(contextRoot);
}
- /** getContextPriorityClassLoader.
+ /**
+ * getContextPriorityClassLoader.
+ *
* @return True if this context should give web application class in preference over the containers
- * classes, as per the servlet specification recommendations.
+ * classes, as per the servlet specification recommendations.
*/
public boolean getContextPriorityClassLoader() {
return getWebApp().getContextPriorityClassloader();
}
- /** setContextPriorityClassLoader.
+ /**
+ * setContextPriorityClassLoader.
+ *
* @param contextPriority True if this context should give web application class in preference over the containers
* classes, as per the servlet specification recommendations.
*/
Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigRoot.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigRoot.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/WebAppDConfigRoot.java Wed Oct 6 10:58:21 2004
@@ -17,9 +17,8 @@
package org.apache.geronimo.jetty.deployment;
-import java.io.InputStream;
import java.io.IOException;
-
+import java.io.InputStream;
import javax.enterprise.deploy.model.DDBean;
import javax.enterprise.deploy.model.DDBeanRoot;
import javax.enterprise.deploy.spi.DConfigBean;
@@ -33,12 +32,10 @@
import org.apache.xmlbeans.XmlException;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class WebAppDConfigRoot extends DConfigBeanRootSupport {
- static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[] {
+ static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[]{
XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
XmlBeans.typeLoaderForClassLoader(JettyWebAppDocument.class.getClassLoader())
});
@@ -61,7 +58,7 @@
}
JettyWebAppDocument getWebAppDocument() {
- return (JettyWebAppDocument)getXmlObject();
+ return (JettyWebAppDocument) getXmlObject();
}
public String[] getXpaths() {
Modified: geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd
==============================================================================
--- geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd (original)
+++ geronimo/trunk/modules/jetty/src/schema/geronimo-jetty.xsd Wed Oct 6 10:58:21 2004
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
+
<xs:schema
xmlns:jetty="http://geronimo.apache.org/xml/ns/web/jetty"
targetNamespace="http://geronimo.apache.org/xml/ns/web/jetty"
Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml
==============================================================================
--- geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/geronimo-web.xml Wed Oct 6 10:58:21 2004
@@ -15,8 +15,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty" configId="org/apache/geronimo/test" >
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/web/jetty" configId="org/apache/geronimo/test">
<context-root>/test</context-root>
<context-priority-classloader>false</context-priority-classloader>
<security use-context-handler="false">
Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/jetty-web.xml
==============================================================================
--- geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/jetty-web.xml (original)
+++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/jetty-web.xml Wed Oct 6 10:58:21 2004
@@ -20,6 +20,6 @@
<Configure class="org.mortbay.jetty.servlet.WebApplicationContext">
<Set name="statsOn" type="boolean">true</Set>
<Call name="getWebApplicationHandler">
- <Set name="usingCookies">true</Set>
+ <Set name="usingCookies">true</Set>
</Call>
</Configure>
Modified: geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/web.xml
==============================================================================
--- geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/web.xml (original)
+++ geronimo/trunk/modules/jetty/src/test-resources/deployables/war3/WEB-INF/web.xml Wed Oct 6 10:58:21 2004
@@ -32,30 +32,30 @@
</resource-ref>
<security-constraint>
- <web-resource-collection>
- <web-resource-name>Admin Role</web-resource-name>
- <url-pattern>/protected/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>content-administrator</role-name>
- </auth-constraint>
+ <web-resource-collection>
+ <web-resource-name>Admin Role</web-resource-name>
+ <url-pattern>/protected/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>content-administrator</role-name>
+ </auth-constraint>
</security-constraint>
<security-constraint>
- <web-resource-collection>
- <web-resource-name>NO ACCESS</web-resource-name>
- <url-pattern>/auth/logon.html</url-pattern>
- </web-resource-collection>
- <auth-constraint/>
+ <web-resource-collection>
+ <web-resource-name>NO ACCESS</web-resource-name>
+ <url-pattern>/auth/logon.html</url-pattern>
+ </web-resource-collection>
+ <auth-constraint/>
</security-constraint>
<login-config>
- <auth-method>FORM</auth-method>
- <realm-name>Test JAAS Realm</realm-name>
- <form-login-config>
- <form-login-page>/auth/logon.html?param=test</form-login-page>
- <form-error-page>/auth/logonError.html?param=test</form-error-page>
- </form-login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>Test JAAS Realm</realm-name>
+ <form-login-config>
+ <form-login-page>/auth/logon.html?param=test</form-login-page>
+ <form-error-page>/auth/logonError.html?param=test</form-error-page>
+ </form-login-config>
</login-config>
<security-role>
Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java Wed Oct 6 10:58:21 2004
@@ -24,15 +24,13 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
+import junit.framework.TestCase;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.jetty.connector.HTTPConnector;
import org.apache.geronimo.kernel.Kernel;
import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.jetty.connector.HTTPConnector;
-import junit.framework.TestCase;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class ContainerTest extends TestCase {
Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java Wed Oct 6 10:58:21 2004
@@ -17,8 +17,6 @@
package org.apache.geronimo.jetty;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
@@ -28,22 +26,23 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
import junit.framework.TestCase;
-
import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
import org.apache.geronimo.gbean.jmx.GBeanMBean;
import org.apache.geronimo.jetty.connector.HTTPConnector;
import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.security.deploy.DefaultPrincipal;
+import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.Realm;
+import org.apache.geronimo.security.deploy.Role;
+import org.apache.geronimo.security.deploy.Security;
import org.apache.geronimo.system.serverinfo.ServerInfo;
import org.apache.geronimo.transaction.GeronimoTransactionManager;
import org.apache.geronimo.transaction.UserTransactionImpl;
import org.apache.geronimo.transaction.context.TransactionContextManager;
-import org.apache.geronimo.security.deploy.Security;
-import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
-import org.apache.geronimo.security.deploy.Role;
-import org.apache.geronimo.security.deploy.Realm;
/**
@@ -101,7 +100,7 @@
realm.setRealmName("demo-properties-realm");
realm.getPrincipals().add(principal);
role.getRealms().add(realm);
-
+
securityConfig.getRoleMappings().add(role);
URL url = Thread.currentThread().getContextClassLoader().getResource("deployables/war3/");
Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Wed Oct 6 10:58:21 2004
@@ -3,10 +3,10 @@
import java.io.File;
import junit.framework.TestCase;
-import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
+import org.apache.geronimo.schema.SchemaConversionUtils;
import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.jetty.JettyWebAppType;
import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
-import org.apache.geronimo.schema.SchemaConversionUtils;
/**
*/
Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/deployment/WebAppDConfigTest.java Wed Oct 6 10:58:21 2004
@@ -22,13 +22,10 @@
import javax.enterprise.deploy.model.DDBeanRoot;
import javax.enterprise.deploy.spi.DeploymentConfiguration;
-import org.apache.geronimo.deployment.tools.loader.WebDeployable;
-
import junit.framework.TestCase;
+import org.apache.geronimo.deployment.tools.loader.WebDeployable;
/**
- *
- *
* @version $Rev$ $Date$
*/
public class WebAppDConfigTest extends TestCase {