Author: remy.maucherat(a)jboss.com
Date: 2008-10-28 11:48:46 -0400 (Tue, 28 Oct 2008)
New Revision: 822
Removed:
trunk/java/org/apache/catalina/mbeans/DefaultContextMBean.java
Modified:
trunk/build.properties.default
trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
trunk/webapps/docs/changelog.xml
trunk/webapps/docs/config/context.xml
trunk/webapps/docs/config/engine.xml
trunk/webapps/docs/config/globalresources.xml
trunk/webapps/docs/config/host.xml
Log:
- Update NSIS.
- Remove a remnant of DefaultContext.
Modified: trunk/build.properties.default
===================================================================
--- trunk/build.properties.default 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/build.properties.default 2008-10-28 15:48:46 UTC (rev 822)
@@ -59,12 +59,12 @@
commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2.1-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.39
+nsis.home=${base.path}/nsis-2.40
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.39.zip
+nsis.loc=${base-sf.loc}/nsis/nsis-2.40.zip
# ----- JBoss Native, version 2.0 or later -----
jbossnative.home=${base.path}/jboss-native-2.0.4
@@ -78,3 +78,8 @@
commons-daemon.jar=${commons-daemon.lib}/commons-daemon.jar
commons-daemon.loc=${base-commons.loc}/daemon/binaries/commons-daemon-1.0.1.tar.gz
commons-daemon.jsvc.tar.gz=${commons-daemon.lib}/bin/jsvc.tar.gz
+
+# ----- Dojo Toolkit (for test webapp) -----
+dojo-js.home=${base.path}/dojo-release-1.1.1
+dojo-js.loc=http://download.dojotoolkit.org/release-1.1.1/dojo-release-1.1.1.tar.gz
+dojo-js.jar=${dojo-js.home}/dojo/dojo.js
Deleted: trunk/java/org/apache/catalina/mbeans/DefaultContextMBean.java
===================================================================
--- trunk/java/org/apache/catalina/mbeans/DefaultContextMBean.java 2008-10-28 15:47:17 UTC
(rev 821)
+++ trunk/java/org/apache/catalina/mbeans/DefaultContextMBean.java 2008-10-28 15:48:46 UTC
(rev 822)
@@ -1,329 +0,0 @@
-/*
- * 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.catalina.mbeans;
-
-import java.util.ArrayList;
-
-import javax.management.MBeanException;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.RuntimeOperationsException;
-
-import org.apache.catalina.Context;
-import org.apache.catalina.deploy.ContextEnvironment;
-import org.apache.catalina.deploy.ContextResource;
-import org.apache.catalina.deploy.ContextResourceLink;
-import org.apache.catalina.deploy.NamingResources;
-import org.apache.tomcat.util.modeler.BaseModelMBean;
-import org.apache.tomcat.util.modeler.ManagedBean;
-import org.apache.tomcat.util.modeler.Registry;
-
-/**
- * <p>A <strong>ModelMBean</strong> implementation for the
- * <code>org.apache.catalina.core.StandardDefaultContext</code>
component.</p>
- *
- * @author Amy Roh
- * @version $Revision$ $Date$
- */
-
-public class DefaultContextMBean extends BaseModelMBean {
-
-
- // ----------------------------------------------------------- Constructors
-
-
- /**
- * Construct a <code>ModelMBean</code> with default
- * <code>ModelMBeanInfo</code> information.
- *
- * @exception MBeanException if the initializer of an object
- * throws an exception
- * @exception RuntimeOperationsException if an IllegalArgumentException
- * occurs
- */
- public DefaultContextMBean()
- throws MBeanException, RuntimeOperationsException {
-
- super();
-
- }
-
-
- // ----------------------------------------------------- Instance Variables
-
-
- /**
- * The configuration information registry for our managed beans.
- */
- protected Registry registry = MBeanUtils.createRegistry();
-
- /**
- * The <code>ManagedBean</code> information describing this MBean.
- */
- protected ManagedBean managed =
- registry.findManagedBean("DefaultContext");
-
-
- // ------------------------------------------------------------- Attributes
-
-
- /**
- * Return the naming resources associated with this web application.
- */
- private NamingResources getNamingResources() {
-
- return ((Context)this.resource).getNamingResources();
-
- }
-
-
- /**
- * Return the MBean Names of the set of defined environment entries for
- * this web application
- */
- public String[] getEnvironments() {
- ContextEnvironment[] envs = getNamingResources().findEnvironments();
- ArrayList results = new ArrayList();
- for (int i = 0; i < envs.length; i++) {
- try {
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), envs[i]);
- results.add(oname.toString());
- } catch (MalformedObjectNameException e) {
- IllegalArgumentException iae = new IllegalArgumentException
- ("Cannot create object name for environment " + envs[i]);
- iae.initCause(e);
- throw iae;
- }
- }
- return ((String[]) results.toArray(new String[results.size()]));
-
- }
-
-
- /**
- * Return the MBean Names of all the defined resource references for this
- * application.
- */
- public String[] getResources() {
-
- ContextResource[] resources = getNamingResources().findResources();
- ArrayList results = new ArrayList();
- for (int i = 0; i < resources.length; i++) {
- try {
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), resources[i]);
- results.add(oname.toString());
- } catch (MalformedObjectNameException e) {
- IllegalArgumentException iae = new IllegalArgumentException
- ("Cannot create object name for resource " +
resources[i]);
- iae.initCause(e);
- throw iae;
- }
- }
- return ((String[]) results.toArray(new String[results.size()]));
-
- }
-
-
- /**
- * Return the MBean Names of all the defined resource links for this
- * application
- */
- public String[] getResourceLinks() {
-
- ContextResourceLink[] links = getNamingResources().findResourceLinks();
- ArrayList results = new ArrayList();
- for (int i = 0; i < links.length; i++) {
- try {
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), links[i]);
- results.add(oname.toString());
- } catch (MalformedObjectNameException e) {
- IllegalArgumentException iae = new IllegalArgumentException
- ("Cannot create object name for resource " + links[i]);
- iae.initCause(e);
- throw iae;
- }
- }
- return ((String[]) results.toArray(new String[results.size()]));
-
- }
-
- // ------------------------------------------------------------- Operations
-
-
- /**
- * Add an environment entry for this web application.
- *
- * @param envName New environment entry name
- */
- public String addEnvironment(String envName, String type)
- throws MalformedObjectNameException {
-
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return null;
- }
- ContextEnvironment env = nresources.findEnvironment(envName);
- if (env != null) {
- throw new IllegalArgumentException
- ("Invalid environment name - already exists '" + envName +
"'");
- }
- env = new ContextEnvironment();
- env.setName(envName);
- env.setType(type);
- nresources.addEnvironment(env);
-
- // Return the corresponding MBean name
- ManagedBean managed = registry.findManagedBean("ContextEnvironment");
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), env);
- return (oname.toString());
-
- }
-
-
- /**
- * Add a resource reference for this web application.
- *
- * @param resourceName New resource reference name
- */
- public String addResource(String resourceName, String type)
- throws MalformedObjectNameException {
-
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return null;
- }
- ContextResource resource = nresources.findResource(resourceName);
- if (resource != null) {
- throw new IllegalArgumentException
- ("Invalid resource name - already exists'" + resourceName +
"'");
- }
- resource = new ContextResource();
- resource.setName(resourceName);
- resource.setType(type);
- nresources.addResource(resource);
-
- // Return the corresponding MBean name
- ManagedBean managed = registry.findManagedBean("ContextResource");
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), resource);
-
- return (oname.toString());
- }
-
-
- /**
- * Add a resource link for this web application.
- *
- * @param resourceLinkName New resource link name
- */
- public String addResourceLink(String resourceLinkName, String global,
- String name, String type) throws MalformedObjectNameException {
-
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return null;
- }
- ContextResourceLink resourceLink =
- nresources.findResourceLink(resourceLinkName);
- if (resourceLink != null) {
- throw new IllegalArgumentException
- ("Invalid resource link name - already exists'" +
- resourceLinkName +
"'");
- }
- resourceLink = new ContextResourceLink();
- resourceLink.setGlobal(global);
- resourceLink.setName(resourceLinkName);
- resourceLink.setType(type);
- nresources.addResourceLink(resourceLink);
-
- // Return the corresponding MBean name
- ManagedBean managed = registry.findManagedBean("ContextResourceLink");
- ObjectName oname =
- MBeanUtils.createObjectName(managed.getDomain(), resourceLink);
- return (oname.toString());
- }
-
-
- /**
- * Remove any environment entry with the specified name.
- *
- * @param envName Name of the environment entry to remove
- */
- public void removeEnvironment(String envName) {
-
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return;
- }
- ContextEnvironment env = nresources.findEnvironment(envName);
- if (env == null) {
- throw new IllegalArgumentException
- ("Invalid environment name '" + envName +
"'");
- }
- nresources.removeEnvironment(envName);
-
- }
-
-
- /**
- * Remove any resource reference with the specified name.
- *
- * @param resourceName Name of the resource reference to remove
- */
- public void removeResource(String resourceName) {
-
- resourceName = ObjectName.unquote(resourceName);
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return;
- }
- ContextResource resource = nresources.findResource(resourceName);
- if (resource == null) {
- throw new IllegalArgumentException
- ("Invalid resource name '" + resourceName +
"'");
- }
- nresources.removeResource(resourceName);
- }
-
-
- /**
- * Remove any resource link with the specified name.
- *
- * @param resourceLinkName Name of the resource reference to remove
- */
- public void removeResourceLink(String resourceLinkName) {
-
- resourceLinkName = ObjectName.unquote(resourceLinkName);
- NamingResources nresources = getNamingResources();
- if (nresources == null) {
- return;
- }
- ContextResourceLink resource = nresources.findResourceLink(resourceLinkName);
- if (resource == null) {
- throw new IllegalArgumentException
- ("Invalid resource name '" + resourceLinkName +
"'");
- }
- nresources.removeResourceLink(resourceLinkName);
- }
-
-
-}
Modified: trunk/java/org/apache/tomcat/util/http/MimeHeaders.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/MimeHeaders.java 2008-10-28 15:47:17 UTC (rev
821)
+++ trunk/java/org/apache/tomcat/util/http/MimeHeaders.java 2008-10-28 15:48:46 UTC (rev
822)
@@ -99,24 +99,22 @@
* we want to keep add O(1).
*/
protected class NamesEnumerator implements Enumeration {
- int pos;
- int size;
- String next;
- MimeHeaders headers;
+ protected int pos;
+ protected int size;
+ protected String next;
- NamesEnumerator(MimeHeaders headers) {
- this.headers = headers;
+ protected NamesEnumerator() {
pos = 0;
- size = headers.size();
+ size = size();
findNext();
}
private void findNext() {
next = null;
for (; pos < size; pos++) {
- next = headers.getName(pos).toString();
+ next = getName(pos).toString();
for (int j = 0; j < pos; j++) {
- if (headers.getName(j).equalsIgnoreCase(next)) {
+ if (getName(j).equalsIgnoreCase(next)) {
// duplicate.
next = null;
break;
@@ -147,26 +145,24 @@
value element.
*/
protected class ValuesEnumerator implements Enumeration {
- int pos;
- int size;
- MessageBytes next;
- MimeHeaders headers;
- String name;
+ protected int pos;
+ protected int size;
+ protected MessageBytes next;
+ protected String name;
- ValuesEnumerator(MimeHeaders headers, String name) {
+ protected ValuesEnumerator(String name) {
this.name = name;
- this.headers = headers;
pos = 0;
- size = headers.size();
+ size = size();
findNext();
}
private void findNext() {
next = null;
for (; pos < size; pos++) {
- MessageBytes n1 = headers.getName(pos);
+ MessageBytes n1 = getName(pos);
if (n1.equalsIgnoreCase(name)) {
- next = headers.getValue(pos);
+ next = getValue(pos);
break;
}
}
@@ -320,11 +316,11 @@
* that multiple fields with that name exist in this header.
*/
public Enumeration names() {
- return new NamesEnumerator(this);
+ return new NamesEnumerator();
}
public Enumeration values(String name) {
- return new ValuesEnumerator(this, name);
+ return new ValuesEnumerator(name);
}
// -------------------- Adding headers --------------------
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/webapps/docs/changelog.xml 2008-10-28 15:48:46 UTC (rev 822)
@@ -17,6 +17,13 @@
<body>
<section name="JBoss Web 2.1.1.GA (remm)">
+ <subsection name="General">
+ <changelog>
+ <update>
+ NSIS 2.40. (remm)
+ </update>
+ </changelog>
+ </subsection>
<subsection name="Catalina">
<changelog>
<fix>
@@ -58,6 +65,16 @@
<fix>
The default annotation name should be based on the class in which the annotation
was found. (markt)
</fix>
+ <fix>
+ <bug>46075</bug>: Don't create ByteArrayOutputStream at maximum
possible size. (markt)
+ </fix>
+ <fix>
+ <bug>46096</bug>: Support annotation processing whilst running under
a security manager. (markt)
+ </fix>
+ <fix>
+ <bug>46085</bug>: Date handling in sessions should use int offsets,
and longs can get
+ corrupted. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -97,6 +114,9 @@
<fix>
Add maxThreads warning. (markt)
</fix>
+ <fix>
+ Cleanup some type oddities in MimeHeaders. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Modified: trunk/webapps/docs/config/context.xml
===================================================================
--- trunk/webapps/docs/config/context.xml 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/webapps/docs/config/context.xml 2008-10-28 15:48:46 UTC (rev 822)
@@ -158,10 +158,9 @@
<attribute name="override" required="false">
<p>Set to <code>true</code> to have explicit settings in this
- Context element override any corresponding settings in the
- <a href="defaultcontext.html">DefaultContext</a> element
associated
- with our owning <a href="host.html">Host</a>. By default,
settings
- in the DefaultContext element will be used.</p>
+ Context element override any corresponding settings in either the global
+ or <a href="host.html">Host</a> default contexts. By
default, settings
+ from a default context will be used.</p>
<p>If a symbolic link is used for docBase then changes to the
symbolic link will only be effective after a JBoss Web restart or
by undeploying and redeploying the conext. A context reload is not
Modified: trunk/webapps/docs/config/engine.xml
===================================================================
--- trunk/webapps/docs/config/engine.xml 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/webapps/docs/config/engine.xml 2008-10-28 15:48:46 UTC (rev 822)
@@ -114,10 +114,6 @@
have a name that matches the name specified for the
<code>defaultHost</code> attribute, listed above.</p>
- <p>You can optional nest a <a
href="defaultcontext.html">DefaultContext</a>
- element inside this <strong>Engine</strong> element, to define the default
- characteristics of web applications that are automatically deployed.</p>
-
<p>You can nest at most one instance of the following utility components
by nesting a corresponding element inside your <strong>Engine</strong>
element:</p>
Modified: trunk/webapps/docs/config/globalresources.xml
===================================================================
--- trunk/webapps/docs/config/globalresources.xml 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/webapps/docs/config/globalresources.xml 2008-10-28 15:48:46 UTC (rev 822)
@@ -203,21 +203,20 @@
<p>Use <a href="context.html#Resource
Links"><ResourceLink></a>
elements to link resources from the global context into
per-web-application contexts. Here is an example of making a custom
- factory available to all applications in the server, based on the example
- definition in the
+ factory available to an application, based on the example definition in the
<a href="../jndi-resource-howto.html#Generic JavaBean Resources">
JNDI Resource HOW-TO</a>:
</p>
<source>
<![CDATA[
- <DefaultContext>
+ <Context>
<ResourceLink
name="bean/MyBeanFactory"
global="bean/MyBeanFactory"
type="com.mycompany.MyBean"
/>
- </DefaultContext>
+ </Context>
]]>
</source>
Modified: trunk/webapps/docs/config/host.xml
===================================================================
--- trunk/webapps/docs/config/host.xml 2008-10-28 15:47:17 UTC (rev 821)
+++ trunk/webapps/docs/config/host.xml 2008-10-28 15:48:46 UTC (rev 822)
@@ -520,8 +520,7 @@
considerations:</p>
<ul>
<li>Each user web application will be deployed with characteristics
- established by any <a
href="defaultcontext.html">DefaultContext</a>
- element you have configured for this Host.</li>
+ established by the global and host level default context settings.</li>
<li>It is legal to include more than one instance of this Listener
element. This would only be useful, however, in circumstances
where you wanted to configure more than one "homeBase"
directory.</li>