Trimming trailing spaces, removing tabs, formatting - appserver/web
diff --git a/appserver/web/admin/pom.xml b/appserver/web/admin/pom.xml
index 396a050..4e6413e 100644
--- a/appserver/web/admin/pom.xml
+++ b/appserver/web/admin/pom.xml
@@ -60,7 +60,7 @@
</developers>
<build>
- <resources>
+ <resources>
<resource>
<directory>src/main/java</directory>
<includes>
@@ -74,15 +74,15 @@
<include>**/*.1</include>
</includes>
</resource>
- </resources>
+ </resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
- <manifestEntries>
- <probe-provider-class-names>org.glassfish.web.admin.monitor.WebModuleProbeProvider,org.glassfish.web.admin.monitor.RequestProbeProvider,org.glassfish.web.admin.monitor.JspProbeProvider,org.glassfish.web.admin.monitor.ServletProbeProvider,org.glassfish.web.admin.monitor.SessionProbeProvider</probe-provider-class-names>
+ <manifestEntries>
+<probe-provider-class-names>org.glassfish.web.admin.monitor.WebModuleProbeProvider,org.glassfish.web.admin.monitor.RequestProbeProvider,org.glassfish.web.admin.monitor.JspProbeProvider,org.glassfish.web.admin.monitor.ServletProbeProvider,org.glassfish.web.admin.monitor.SessionProbeProvider</probe-provider-class-names>
</manifestEntries>
</archive>
</configuration>
@@ -91,16 +91,16 @@
</build>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.glassfish.main.flashlight</groupId>
<artifactId>flashlight-framework</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>org.glassfish.main.admin</groupId>
<artifactId>monitoring-core</artifactId>
<version>${project.version}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.glassfish.hk2</groupId>
<artifactId>hk2-core</artifactId>
@@ -131,7 +131,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.glassfish.main.common</groupId>
+ <groupId>org.glassfish.main.common</groupId>
<artifactId>internal-api</artifactId>
<version>${project.version}</version>
</dependency>
diff --git a/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/AltServletStatsImpl.java b/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/AltServletStatsImpl.java
index ac92dd2..b70629d 100644
--- a/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/AltServletStatsImpl.java
+++ b/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/AltServletStatsImpl.java
@@ -44,10 +44,12 @@
private final static String displayFormat = "%1$-10s %2$-10s %3$-10s";
+ @Override
public String getName() {
return name;
}
+ @Override
public ActionReport process(final ActionReport report, final String filter) {
if (mrdr == null) {
@@ -63,11 +65,11 @@
return report;
}
- String [] patternArr = new String [] {"server.web.servlet.*"};
+ String[] patternArr = new String [] {"server.web.servlet.*"};
- long activeServletsLoadedCount = 0;
- long maxServletsLoadedCount = 0;
- long totalServletsLoadedCount = 0;
+ long activeServletsLoadedCount = 0;
+ long maxServletsLoadedCount = 0;
+ long totalServletsLoadedCount = 0;
for (String pattern : patternArr) {
List<TreeNode> tnL = serverNode.getNodes(pattern);
@@ -85,9 +87,8 @@
}
}
- report.setMessage(String.format(displayFormat,
- activeServletsLoadedCount, maxServletsLoadedCount,
- totalServletsLoadedCount));
+ report.setMessage(
+ String.format(displayFormat, activeServletsLoadedCount, maxServletsLoadedCount, totalServletsLoadedCount));
report.setActionExitCode(ExitCode.SUCCESS);
return report;
@@ -95,7 +96,9 @@
private long getCountStatisticValue(Object obj) {
long l = 0L;
- if (obj == null) return l;
+ if (obj == null) {
+ return l;
+ }
if (obj instanceof CountStatistic) {
return ((CountStatistic)obj).getCount();
}
@@ -104,7 +107,9 @@
private long getRangeStatisticValue(Object obj) {
long l = 0L;
- if (obj == null) return l;
+ if (obj == null) {
+ return l;
+ }
if (obj instanceof RangeStatistic) {
return ((RangeStatistic)obj).getCurrent();
}
diff --git a/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/WebModuleVirtualServerStatsImpl.java b/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/WebModuleVirtualServerStatsImpl.java
index 1e10017..4200899 100644
--- a/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/WebModuleVirtualServerStatsImpl.java
+++ b/appserver/web/admin/src/main/java/org/glassfish/web/admin/monitor/statistics/WebModuleVirtualServerStatsImpl.java
@@ -67,13 +67,15 @@
private final static String name = "webmodule";
- private final static String displayFormat =
- "%1$-5s %2$-5s %3$-5s %4$-5s %5$-5s %6$-5s %7$-5s %8$-8s %9$-10s %10$-5s";
+ private final static String displayFormat
+ = "%1$-5s %2$-5s %3$-5s %4$-5s %5$-5s %6$-5s %7$-5s %8$-8s %9$-10s %10$-5s";
+ @Override
public String getName() {
return name;
}
+ @Override
public ActionReport process(final ActionReport report, final String filter) {
if (mrdr == null) {
@@ -99,18 +101,18 @@
"server.web.servlet.*", "server.web.jsp.*"};
}
- long activeSessionsCount = 0;
- long sessionsTotal = 0;
- long rejectedSessionsTotal = 0;
- long activatedSessionsTotal = 0;
+ long activeSessionsCount = 0;
+ long sessionsTotal = 0;
+ long rejectedSessionsTotal = 0;
+ long activatedSessionsTotal = 0;
- long activeJspsLoadedCount = 0;
- long maxJspsLoadedCount = 0;
- long totalJspsLoadedCount = 0;
+ long activeJspsLoadedCount = 0;
+ long maxJspsLoadedCount = 0;
+ long totalJspsLoadedCount = 0;
- long activeServletsLoadedCount = 0;
- long maxServletsLoadedCount = 0;
- long totalServletsLoadedCount = 0;
+ long activeServletsLoadedCount = 0;
+ long maxServletsLoadedCount = 0;
+ long totalServletsLoadedCount = 0;
long lval = 0;
@@ -160,7 +162,9 @@
private long getCountStatisticValue(Object obj) {
long l = 0L;
- if (obj == null) return l;
+ if (obj == null) {
+ return l;
+ }
if (obj instanceof CountStatistic) {
return ((CountStatistic)obj).getCount();
}
@@ -169,7 +173,9 @@
private long getRangeStatisticValue(Object obj) {
long l = 0L;
- if (obj == null) return l;
+ if (obj == null) {
+ return l;
+ }
if (obj instanceof RangeStatistic) {
return ((RangeStatistic)obj).getCurrent();
}
diff --git a/appserver/web/gf-web-connector/src/main/java/org/glassfish/web/config/serverbeans/WebContainerAvailability.java b/appserver/web/gf-web-connector/src/main/java/org/glassfish/web/config/serverbeans/WebContainerAvailability.java
index 776bbed..d6baab2 100644
--- a/appserver/web/gf-web-connector/src/main/java/org/glassfish/web/config/serverbeans/WebContainerAvailability.java
+++ b/appserver/web/gf-web-connector/src/main/java/org/glassfish/web/config/serverbeans/WebContainerAvailability.java
@@ -40,8 +40,7 @@
}) */
@Configured
-public interface WebContainerAvailability extends ConfigBeanProxy,
- PropertyBag, AvailabilityServiceExtension {
+public interface WebContainerAvailability extends ConfigBeanProxy, PropertyBag, AvailabilityServiceExtension {
/**
* Gets the value of the availabilityEnabled property.
@@ -55,19 +54,17 @@
* If this attribute is missing, it "inherits" the value of the global
* availability-enabled under availability-service. Default is "true".
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Attribute (defaultValue="true")
- public String getAvailabilityEnabled();
+ String getAvailabilityEnabled();
/**
* Sets the value of the availabilityEnabled property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setAvailabilityEnabled(String value) throws PropertyVetoException;
+ void setAvailabilityEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the persistenceType property.
@@ -75,19 +72,17 @@
* Specifies the session persistence mechanism for web applications that
* have availability enabled. Default is "replicated".
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Attribute (defaultValue="replicated")
- public String getPersistenceType();
+ String getPersistenceType();
/**
* Sets the value of the persistenceType property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setPersistenceType(String value) throws PropertyVetoException;
+ void setPersistenceType(String value) throws PropertyVetoException;
/**
* Gets the value of the persistenceFrequency property.
@@ -96,19 +91,17 @@
* when persistence-type = "ha". Values may be "time-based" or "web-event"
* If it is missing, then the persistence-type will revert to "memory".
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Attribute (defaultValue="web-method")
- public String getPersistenceFrequency();
+ String getPersistenceFrequency();
/**
* Sets the value of the persistenceFrequency property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setPersistenceFrequency(String value) throws PropertyVetoException;
+ void setPersistenceFrequency(String value) throws PropertyVetoException;
/**
* Gets the value of the persistenceScope property.
@@ -118,19 +111,17 @@
* "modified-attribute". If it is missing, then the persistence-type will
* revert to "memory".
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Attribute (defaultValue="session")
- public String getPersistenceScope();
+ String getPersistenceScope();
/**
* Sets the value of the persistenceScope property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setPersistenceScope(String value) throws PropertyVetoException;
+ void setPersistenceScope(String value) throws PropertyVetoException;
/**
* Gets the value of the persistenceStoreHealthCheckEnabled property.
@@ -139,39 +130,35 @@
* enabling/disabling HADB health check, refer to store-healthcheck-enabled
* attribute in the availability-service element.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Deprecated
@Attribute (defaultValue="false",dataType=Boolean.class)
- public String getPersistenceStoreHealthCheckEnabled();
+ String getPersistenceStoreHealthCheckEnabled();
/**
* Sets the value of the persistenceStoreHealthCheckEnabled property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setPersistenceStoreHealthCheckEnabled(String value) throws PropertyVetoException;
+ void setPersistenceStoreHealthCheckEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the ssoFailoverEnabled property.
*
* Controls whether Single-Sign-On state will be made available for failover
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Attribute (defaultValue="false",dataType=Boolean.class)
- public String getSsoFailoverEnabled();
+ String getSsoFailoverEnabled();
/**
* Sets the value of the ssoFailoverEnabled property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setSsoFailoverEnabled(String value) throws PropertyVetoException;
+ void setSsoFailoverEnabled(String value) throws PropertyVetoException;
/**
* Gets the value of the httpSessionStorePoolName property.
@@ -181,20 +168,18 @@
* to value of store-pool-name under availability-service
* (ultimately "jdbc/hastore").
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String}
*/
@Deprecated
@Attribute
- public String getHttpSessionStorePoolName();
+ String getHttpSessionStorePoolName();
/**
* Sets the value of the httpSessionStorePoolName property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String}
*/
- public void setHttpSessionStorePoolName(String value) throws PropertyVetoException;
+ void setHttpSessionStorePoolName(String value) throws PropertyVetoException;
/**
* Gets thevalue of disableJreplica property.
@@ -204,18 +189,19 @@
* @return returns the string representation of the boolean value
*/
@Attribute (defaultValue="false",dataType=Boolean.class)
- public String getDisableJreplica();
+ String getDisableJreplica();
/**
* Sets the disableJreplica property
* @param value allowed object is {@link String}
* @throws PropertyVetoException
*/
- public void setDisableJreplica(String value) throws PropertyVetoException;
+ void setDisableJreplica(String value) throws PropertyVetoException;
/**
- Properties as per {@link PropertyBag}
+ * Properties as per {@link PropertyBag}
*/
+ @Override
@ToDo(priority=ToDo.Priority.IMPORTANT, details="Provide PropertyDesc for legal props" )
@PropertiesDesc(props={})
@Element
diff --git a/appserver/web/gf-weld-connector/pom.xml b/appserver/web/gf-weld-connector/pom.xml
index 6d49a9e..2a23841 100644
--- a/appserver/web/gf-weld-connector/pom.xml
+++ b/appserver/web/gf-weld-connector/pom.xml
@@ -20,7 +20,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.glassfish.main.web</groupId>
+ <groupId>org.glassfish.main.web</groupId>
<artifactId>web</artifactId>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
diff --git a/appserver/web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java b/appserver/web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
index 2ad4914..4829ac1 100644
--- a/appserver/web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
+++ b/appserver/web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
@@ -101,11 +101,8 @@
* @author Craig R. McClanahan
* @version $Revision: 1.1.2.1 $ $Date: 2007/08/17 15:46:27 $
*/
-public class WebappClassLoader
- extends URLClassLoader
- implements Reloader, InstrumentableClassLoader, PreDestroy,
- DDPermissionsLoader, JarFileResourcesProvider
-{
+public class WebappClassLoader extends URLClassLoader
+ implements Reloader, InstrumentableClassLoader, PreDestroy, DDPermissionsLoader, JarFileResourcesProvider {
// ------------------------------------------------------- Static Variables
private static final Logger logger = LogFacade.getLogger();
@@ -1368,7 +1365,7 @@
@Override
public Enumeration<URL> getResources(String name) throws IOException {
- final Enumeration[] enums = new Enumeration[2];
+ final Enumeration[] enums = new Enumeration[2];
Enumeration<URL> localResources = findResources(name);
Enumeration<URL> parentResources = null;
@@ -3284,22 +3281,22 @@
private String getJavaVersion() {
- String version = null;
+ String version = null;
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- version = AccessController.doPrivileged(
- new PrivilegedAction<String>() {
- public String run() {
- return System.getProperty("java.version");
- }
- });
- } else {
- version = System.getProperty("java.version");
- }
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null) {
+ version = AccessController.doPrivileged(
+ new PrivilegedAction<String>() {
+ public String run() {
+ return System.getProperty("java.version");
+ }
+ });
+ } else {
+ version = System.getProperty("java.version");
+ }
- return version;
- }
+ return version;
+ }
private void setAccessible(final Field field) {
diff --git a/appserver/web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties b/appserver/web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties
index 5878223..55ef910 100644
--- a/appserver/web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties
+++ b/appserver/web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties
@@ -34,7 +34,7 @@
webcontainer.notYet=WEB0109: Property [{0}] is not yet supported
webcontainer.invalidProperty=WEB0110: Ignoring invalid property [{0}] = [{1}]
webcontainer.filePersistence=WEB0111: Enabling file-based persistence for web module [{0}]''s sessions
-webcontainer.duplicateContextRoot=WEB0113: Virtual server [{0}] already has a web module [{1}] loaded at [{2}]; therefore web module [{3}] cannot be loaded at this context path on this virtual server.\u0020
+webcontainer.duplicateContextRoot=WEB0113: Virtual server [{0}] already has a web module [{1}] loaded at [{2}]; therefore web module [{3}] cannot be loaded at this context path on this virtual server.
webcontainer.altDDName=WEB0116: Using alternate deployment descriptor [{0}] for web module [{1}]
# START S1AS8PE 4817642
webcontainer.sessionIDsReused=WEB0121: Enabled session ID reuse for web module [{0}] deployed on virtual server [{1}]
@@ -80,7 +80,7 @@
webcontainer.defaultWebModuleConflict=WEB0145: Unable to deploy web module [{0}] at root context of virtual server [{1}], because this virtual server declares a default-web-module
WEB0145.diag.cause.1=There can be at most one web module occupying a virtual server's root context at any time
WEB0145.diag.check.1=You must first undeclare a virtual server's default-web-module in order to be able to deploy to the virtual server's root context
-webcontainer.nullWebModuleProperty=WEB0146: Web module [{0}] has a property with missing name or value\u0020
+webcontainer.nullWebModuleProperty=WEB0146: Web module [{0}] has a property with missing name or value
vs.invalidListener=WEB0147: Unable to add listener of type [{0}] to virtual server [{1}]
WEB0147.diag.cause.1=Declared listener is neither of type org.apache.catalina.ContainerListener nor org.apache.catalina.LifecycleListener
WEB0147.diag.check.1=Make sure the declared listener implements org.apache.catalina.ContainerListener or org.apache.catalina.LifecycleListener
@@ -129,15 +129,15 @@
WEB0203.diag.check.1=Make sure that the web module that has been designated as the default-web-module for the virtual server has been deployed
vs.defaultWebModuleDisabled=WEB0204: The default-web-module [{0}] is either disabled or does not specify virtual server [{1}]
vs.invalidAuthRealm=WEB0206: Virtual server [{0}] has invalid authentication realm [{1}]
-vs.invalidSsoCookieSecure=WEB0207: Invalid sso-cookie-secure configuration [{0}] for virtual server [{1}]\u0020
+vs.invalidSsoCookieSecure=WEB0207: Invalid sso-cookie-secure configuration [{0}] for virtual server [{1}]
WEB0207.diag.cause.1=The sso-cookie-secure attribute of the virtual server has an unsupported value
WEB0207.diag.check.1=Make sure the value of the sso-cookie-secure attribute of the virtual server is set to 'true', 'false', or 'dynamic'
virtualServerValve.vsDisabled=WEB0208: Virtual server {0} has been disabled
virtualServerValve.vsOff=WEB0209: Virtual server {0} has been turned off
vs.ignoreInvalidRealm=WEB0210: Realm [{0}] is not an instance of [{1}], and will be ignored
-vs.addHttpProbes.codeFiltersNull=WEB0211: Error adding HttpProbes. NetworkListener [{0}]'s HttpCodecFilter is [{1}]\u0020
+vs.addHttpProbes.codeFiltersNull=WEB0211: Error adding HttpProbes. NetworkListener [{0}]'s HttpCodecFilter is [{1}]
vs.addHttpProbes.ProxyNull=WEB0212: Error adding HttpProbes. NetworkListener [{0}]'s GrizzlyProxy is [{1}]
-vs.addHttpProbes.error=WEB0213: Error adding HttpProbes.\u0020
+vs.addHttpProbes.error=WEB0213: Error adding HttpProbes.
#
# com.sun.enterprise.web.PEWebContainer
@@ -166,12 +166,12 @@
peaccesslogvalve.unableToRenameLogFile=WEB0333: Unable to rename access log file {0} to {1}
peaccesslogvalve.unableToWrite=WEB0340: Unable to write access log file {0}
pewebcontainer.invalid_accessLog_writerInterval=WEB0342: Invalid accessLogWriterInterval value [{0}]
-pewebcontainer.missingJKProperties=WEB0343: JK properties file {0} does not exist\u0020
+pewebcontainer.missingJKProperties=WEB0343: JK properties file {0} does not exist
pewebcontainer.configureJK=WEB0344: Unable to configure JK properties for connector listening to {0}
accessLogValve.notStarted=WEB0345: Access log valve cannot be stopped because it has not been started
pewebcontainer.accesslog.reconfigure=WEB0346: Unable to reconfigure access log valve
pewebcontainer.httpListener.mustNotDisable=WEB0347: Must not disable network-listener [{0}], because it is associated with admin virtual server [{1}]
-peaccesslogvalve.invalidAccessLogPattern=WEB0348: Illegal access log pattern [{0}], is not a valid nickname and does not contain any ''%''\u0020
+peaccesslogvalve.invalidAccessLogPattern=WEB0348: Illegal access log pattern [{0}], is not a valid nickname and does not contain any ''%''
peaccesslogvalve.alreadyStarted=WEB0350: Access logger has already been started
peaccesslogvalve.notStarted=WEB0351: Access logger has not yet been started
pewebcontainer.invalidMaxPendingCount=WEB0352: Invalid max-pending-count attribute value [{0}], using default [{1}]
@@ -188,7 +188,7 @@
WEB0358.diag.check.1=Make sure to specify an Integer as the attribute value
webcontainer.invalidAnnotationScope=WEB0359: The class [{0}] is annotated with an invalid scope
WEB0359.diag.cause.1=The offending class is annotated with jakarta.enterprise.context.ApplicationScoped, jakarta.enterprise.context.ConversationScoped, jakarta.enterprise.context.RequestScoped, or jakarta.enterprise.context.SessionScoped, which is a violation of the Servlet specification
-WEB0359.diag.check.1=Make sure that the offending class does not have any scope annotation or is annotated with the jakarta.enterprise.context.Dependent scope, which is the only valid scope for Servlets, Filters, and Listeners\u0020
+WEB0359.diag.check.1=Make sure that the offending class does not have any scope annotation or is annotated with the jakarta.enterprise.context.Dependent scope, which is the only valid scope for Servlets, Filters, and Listeners
webcontainer.unableToCreate=WEB0360: Unable to create {0}
webcontainer.unableToDelete=WEB0361: Unable to delete {0}
@@ -204,7 +204,7 @@
# com.sun.enterprise.web.WebModule
#
webmodule.defaultLocaleDeprecated=WEB0500: default-locale attribute of locale-charset-info element is being ignored
-WEB0500.diag.cause.1=This attribute has been deprecated\u0020
+WEB0500.diag.cause.1=This attribute has been deprecated
WEB0500.diag.check.1=Use default-charset attribute of parameter-encoding element instead
#no ID on webmodule.adHocContextValve.adHocServletServiceError as it is sent to client
webmodule.adHocContextValve.adHocServletServiceError=Error processing request received on ad-hoc path {0}
diff --git a/appserver/web/web-core/src/main/java/com/sun/enterprise/web/connector/grizzly/CoyoteConnectorLauncher.java b/appserver/web/web-core/src/main/java/com/sun/enterprise/web/connector/grizzly/CoyoteConnectorLauncher.java
index 5024080..4a0d797 100644
--- a/appserver/web/web-core/src/main/java/com/sun/enterprise/web/connector/grizzly/CoyoteConnectorLauncher.java
+++ b/appserver/web/web-core/src/main/java/com/sun/enterprise/web/connector/grizzly/CoyoteConnectorLauncher.java
@@ -19,7 +19,6 @@
import java.util.HashMap;
import java.util.Map;
-import javax.management.ObjectName;
import org.apache.catalina.connector.ProtocolHandler;
import org.glassfish.grizzly.config.ssl.ServerSocketFactory;
@@ -138,7 +137,7 @@
protected boolean secure;
// socket factory attributes ( XXX replace with normal setters )
- protected Map<String, Object> attributes = new HashMap<String, Object>();
+ protected Map<String, Object> attributes = new HashMap<>();
protected String socketFactoryName=null;
protected String sslImplementationName=null;
@@ -320,7 +319,7 @@
/** Set the maximum number of Keep-Alive requests that we will honor.
*/
public void setMaxKeepAliveRequests(int mkar) {
- maxKeepAliveRequests = mkar;
+ maxKeepAliveRequests = mkar;
setAttribute("maxKeepAliveRequests", "" + mkar);
}
@@ -333,20 +332,18 @@
setAttribute("socketCloseDelay", "" + d);
}
- protected static ServerSocketFactory string2SocketFactory( String val)
- throws ClassNotFoundException, IllegalAccessException,
- InstantiationException
- {
- Class chC=Class.forName( val );
- return (ServerSocketFactory)chC.newInstance();
+ protected static ServerSocketFactory string2SocketFactory(String val)
+ throws ClassNotFoundException, IllegalAccessException, InstantiationException {
+ Class chC = Class.forName(val);
+ return (ServerSocketFactory) chC.newInstance();
}
public int getTimeout() {
return timeout;
}
- public void setTimeout( int timeouts ) {
- timeout = timeouts * 1000;
+ public void setTimeout(int timeouts) {
+ timeout = timeouts * 1000;
setAttribute("timeout", "" + timeouts);
}
@@ -354,15 +351,15 @@
return reportedname;
}
- public void setReportedname( String reportedName) {
- reportedname = reportedName;
+ public void setReportedname(String reportedName) {
+ reportedname = reportedName;
}
// START OF SJSAS PE 8.1 6172948
/**
* Set the request input buffer size
*/
- public void setBufferSize(int requestBufferSize){
+ public void setBufferSize(int requestBufferSize) {
this.requestBufferSize = requestBufferSize;
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/AuthenticatorBase.java b/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 755fa78..4f0265a 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -389,8 +389,7 @@
* authentication, <code>false</code> to do not perform the
* change.
*/
- public void setChangeSessionIdOnAuthentication(
- boolean changeSessionIdOnAuthentication) {
+ public void setChangeSessionIdOnAuthentication(boolean changeSessionIdOnAuthentication) {
this.changeSessionIdOnAuthentication = changeSessionIdOnAuthentication;
}
@@ -865,10 +864,8 @@
// Construct a cookie to be returned to the client
if (sso == null)
return;
- HttpServletRequest hreq =
- (HttpServletRequest) request.getRequest();
- HttpServletResponse hres =
- (HttpServletResponse) response.getResponse();
+ HttpServletRequest hreq = (HttpServletRequest) request.getRequest();
+ HttpServletResponse hres = (HttpServletResponse) response.getResponse();
// Use the connector's random number generator (if any) for
// generating the session ID. If none, then fall back to the default
@@ -971,7 +968,7 @@
return END_PIPELINE;
}
}
- return INVOKE_NEXT;
+ return INVOKE_NEXT;
}
// ------------------------------------------------------ Lifecycle Methods
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/Connector.java b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/Connector.java
index 9a7030a..2c9a6ad 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/Connector.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/Connector.java
@@ -17,19 +17,24 @@
package org.apache.catalina.connector;
+import com.sun.appserv.ProxyHandler;
+
import java.lang.reflect.Constructor;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.security.cert.X509Certificate;
import java.text.MessageFormat;
-import java.util.*;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
+
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
-import jakarta.servlet.http.HttpServletRequest;
-import com.sun.appserv.ProxyHandler;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
@@ -43,8 +48,10 @@
import org.apache.catalina.net.ServerSocketFactory;
import org.apache.catalina.util.LifecycleSupport;
import org.glassfish.grizzly.http.server.HttpHandler;
-import org.glassfish.web.util.IntrospectionUtils;
import org.glassfish.grizzly.http.server.util.Mapper;
+import org.glassfish.web.util.IntrospectionUtils;
+
+import jakarta.servlet.http.HttpServletRequest;
/**
* Implementation of a Coyote connector for Tomcat 5.x.
@@ -1442,24 +1449,24 @@
* internal protocol names.
*/
private String translateAttributeName(String name) {
- if ("clientAuth".equals(name)) {
- return "clientauth";
- } else if ("keystoreFile".equals(name)) {
- return "keystore";
- } else if ("randomFile".equals(name)) {
- return "randomfile";
- } else if ("rootFile".equals(name)) {
- return "rootfile";
- } else if ("keystorePass".equals(name)) {
- return "keypass";
- } else if ("keystoreType".equals(name)) {
- return "keytype";
- } else if ("sslProtocol".equals(name)) {
- return "protocol";
- } else if ("sslProtocols".equals(name)) {
- return "protocols";
- }
- return name;
+ if ("clientAuth".equals(name)) {
+ return "clientauth";
+ } else if ("keystoreFile".equals(name)) {
+ return "keystore";
+ } else if ("randomFile".equals(name)) {
+ return "randomfile";
+ } else if ("rootFile".equals(name)) {
+ return "rootfile";
+ } else if ("keystorePass".equals(name)) {
+ return "keypass";
+ } else if ("keystoreType".equals(name)) {
+ return "keytype";
+ } else if ("sslProtocol".equals(name)) {
+ return "protocol";
+ } else if ("sslProtocols".equals(name)) {
+ return "protocols";
+ }
+ return name;
}
/**
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteServerSocketFactory.java b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteServerSocketFactory.java
index 3d75c80..ad48d96 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteServerSocketFactory.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteServerSocketFactory.java
@@ -295,7 +295,7 @@
* enabled
*/
public String getCiphers() {
- return this.cipherSuites;
+ return this.cipherSuites;
}
/**
@@ -307,7 +307,7 @@
* @param ciphers Comma-separated list of SSL cipher suites
*/
public void setCiphers(String ciphers) {
- this.cipherSuites = ciphers;
+ this.cipherSuites = ciphers;
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteWriter.java b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteWriter.java
index bbc3630..8f910f4 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteWriter.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/connector/CoyoteWriter.java
@@ -181,7 +181,7 @@
public void write(char buf[]) {
- write(buf, 0, buf.length);
+ write(buf, 0, buf.length);
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/core/ApplicationContextFacade.java b/appserver/web/web-core/src/main/java/org/apache/catalina/core/ApplicationContextFacade.java
index e5dcb37..19a430f 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/core/ApplicationContextFacade.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/core/ApplicationContextFacade.java
@@ -1047,13 +1047,12 @@
log.log(Level.FINE, "ApplicationContextFacade." + methodName, ex);
}
- if (ex instanceof PrivilegedActionException) {
+ if (ex instanceof PrivilegedActionException) {
ex = ((PrivilegedActionException) ex).getException();
- }
+ }
if (ex instanceof InvocationTargetException) {
- realException =
- ((InvocationTargetException) ex).getTargetException();
+ realException = ((InvocationTargetException) ex).getTargetException();
} else {
realException = ex;
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/core/ContainerBase.java b/appserver/web/web-core/src/main/java/org/apache/catalina/core/ContainerBase.java
index 8d84b33..ccd0b8d 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/core/ContainerBase.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/core/ContainerBase.java
@@ -383,7 +383,7 @@
Loader oldLoader;
try {
- writeLock.lock();
+ writeLock.lock();
// Change components if necessary
oldLoader = this.loader;
@@ -413,7 +413,7 @@
}
}
} finally {
- writeLock.unlock();
+ writeLock.unlock();
}
// Report this property change to interested listeners
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java
index 696c8d5..66f26cd 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java
@@ -7204,7 +7204,7 @@
// START SJAS 6318494
("jndi", "", 0, getJNDIUri(hostName, fullPath),
// END SJSAS 6318494
- new DirContextURLStreamHandler(resources));
+ new DirContextURLStreamHandler(resources));
} catch (Exception e) {
// do nothing
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardPipeline.java b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardPipeline.java
index b98461f..4e26c09 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardPipeline.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardPipeline.java
@@ -664,22 +664,20 @@
private Request getRequest(Request request) {
- Request r = (Request)
- request.getNote(Globals.WRAPPED_REQUEST);
- if (r == null) {
- r = request;
- }
- return r;
+ Request r = (Request) request.getNote(Globals.WRAPPED_REQUEST);
+ if (r == null) {
+ r = request;
+ }
+ return r;
}
private Response getResponse(Request request, Response response) {
- Response r = (Response)
- request.getNote(Globals.WRAPPED_RESPONSE);
- if (r == null) {
- r = response;
- }
- return r;
+ Response r = (Response) request.getNote(Globals.WRAPPED_RESPONSE);
+ if (r == null) {
+ r = response;
+ }
+ return r;
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardWrapper.java b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardWrapper.java
index 6a3db8d..8cd579a 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardWrapper.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/core/StandardWrapper.java
@@ -1978,17 +1978,14 @@
}
if ((parentMethods != null) && (parentMethods.length > 0)) {
- Method[] allMethods =
- new Method[parentMethods.length + thisMethods.length];
- System.arraycopy(parentMethods, 0, allMethods, 0,
- parentMethods.length);
- System.arraycopy(thisMethods, 0, allMethods, parentMethods.length,
- thisMethods.length);
+ Method[] allMethods = new Method[parentMethods.length + thisMethods.length];
+ System.arraycopy(parentMethods, 0, allMethods, 0, parentMethods.length);
+ System.arraycopy(thisMethods, 0, allMethods, parentMethods.length, thisMethods.length);
- thisMethods = allMethods;
- }
+ thisMethods = allMethods;
+ }
- return thisMethods;
+ return thisMethods;
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/deploy/ApplicationParameter.java b/appserver/web/web-core/src/main/java/org/apache/catalina/deploy/ApplicationParameter.java
index ccaef47..5d2c02f 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/deploy/ApplicationParameter.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/deploy/ApplicationParameter.java
@@ -128,8 +128,8 @@
if (!(obj instanceof ApplicationParameter)) {
return false;
}
- ApplicationParameter that = (ApplicationParameter) obj;
- return this.name.equals(that.name);
+ ApplicationParameter that = (ApplicationParameter) obj;
+ return this.name.equals(that.name);
}
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/session/StandardSession.java b/appserver/web/web-core/src/main/java/org/apache/catalina/session/StandardSession.java
index d91e0d3..717e101 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/session/StandardSession.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/session/StandardSession.java
@@ -2117,30 +2117,31 @@
//following is replacement code from Hercules
try {
stream.writeObject(saveValues.get(i));
- if (debug >= 2)
- log(" storing attribute '" + saveNames.get(i) +
- "' with value '" + saveValues.get(i) + "'");
+ if (debug >= 2) {
+ log(" storing attribute '" + saveNames.get(i) + "' with value '" + saveValues.get(i) + "'");
+ }
} catch (NotSerializableException e) {
String msg = MessageFormat.format(rb.getString(LogFacade.CANNOT_SERIALIZE_SESSION_EXCEPTION),
- new Object[] {saveNames.get(i), id});
+ new Object[] {saveNames.get(i), id});
log(msg, e);
stream.writeObject(NOT_SERIALIZED);
- if (debug >= 2)
- log(" storing attribute '" + saveNames.get(i) +
- "' with value NOT_SERIALIZED");
+ if (debug >= 2) {
+ log(" storing attribute '" + saveNames.get(i) + "' with value NOT_SERIALIZED");
+ }
} catch (IOException ioe) {
- if ( ioe.getCause() instanceof NotSerializableException ) {
- String msg = MessageFormat.format(rb.getString(LogFacade.CANNOT_SERIALIZE_SESSION_EXCEPTION),
- new Object[] {saveNames.get(i), id});
+ if (ioe.getCause() instanceof NotSerializableException) {
+ String msg = MessageFormat.format(rb.getString(LogFacade.CANNOT_SERIALIZE_SESSION_EXCEPTION),
+ new Object[] {saveNames.get(i), id});
log(msg, ioe);
stream.writeObject(NOT_SERIALIZED);
- if (debug >= 2)
- log(" storing attribute '" + saveNames.get(i) +
- "' with value NOT_SERIALIZED");
- } else
- throw ioe;
- }
- //end HERCULES:mod
+ if (debug >= 2) {
+ log(" storing attribute '" + saveNames.get(i) + "' with value NOT_SERIALIZED");
+ }
+ } else {
+ throw ioe;
+ }
+ }
+ // end HERCULES:mod
}
stream.writeObject(sipAppSessionId);
@@ -2167,9 +2168,9 @@
protected void evaluateIfValid() {
/*
- * If this session has expired or is in the process of expiring or
- * will never expire, return
- */
+ * If this session has expired or is in the process of expiring or
+ * will never expire, return
+ */
if (!this.isValid || expiring || maxInactiveInterval < 0)
return;
diff --git a/appserver/web/web-core/src/main/java/org/apache/catalina/util/URLEncoder.java b/appserver/web/web-core/src/main/java/org/apache/catalina/util/URLEncoder.java
index 9a01272..7994484 100644
--- a/appserver/web/web-core/src/main/java/org/apache/catalina/util/URLEncoder.java
+++ b/appserver/web/web-core/src/main/java/org/apache/catalina/util/URLEncoder.java
@@ -63,7 +63,7 @@
}
public void addSafeCharacter( char c ) {
- safeCharacters.set( c );
+ safeCharacters.set( c );
}
public String encode( String path ) {
diff --git a/appserver/web/web-core/src/main/java/org/glassfish/web/valve/ServletContainerInterceptor.java b/appserver/web/web-core/src/main/java/org/glassfish/web/valve/ServletContainerInterceptor.java
index 69b527c..7b28f15 100644
--- a/appserver/web/web-core/src/main/java/org/glassfish/web/valve/ServletContainerInterceptor.java
+++ b/appserver/web/web-core/src/main/java/org/glassfish/web/valve/ServletContainerInterceptor.java
@@ -26,7 +26,6 @@
* extend the Web Container.
*
* @author Jeremy_Lv
- *
*/
@Contract
public interface ServletContainerInterceptor {
@@ -37,7 +36,7 @@
* @param req
* @param res
*/
- public void preInvoke(Request req, Response res);
+ void preInvoke(Request req, Response res);
/**
* User can remove some useful informations after
@@ -45,5 +44,5 @@
* @param req
* @param res
*/
- public void postInvoke(Request req, Response res);
+ void postInvoke(Request req, Response res);
}
diff --git a/appserver/web/web-embed/api/src/main/java/org/glassfish/embeddable/web/WebListener.java b/appserver/web/web-embed/api/src/main/java/org/glassfish/embeddable/web/WebListener.java
index 8149059..27be08e 100644
--- a/appserver/web/web-embed/api/src/main/java/org/glassfish/embeddable/web/WebListener.java
+++ b/appserver/web/web-embed/api/src/main/java/org/glassfish/embeddable/web/WebListener.java
@@ -27,7 +27,6 @@
* @author Rajiv Mordani
* @author Amy Roh
*/
-
public interface WebListener {
/**
@@ -35,42 +34,42 @@
*
* @param id for this <tt>WebListener</tt>
*/
- public void setId(String id);
+ void setId(String id);
/**
* Gets the id of this <tt>WebListener</tt>.
*
* @return id of this <tt>WebListener</tt>
*/
- public String getId();
+ String getId();
/**
* Sets the port number for this <tt>WebListener</tt>.
*
* @param port the port number for this <tt>WebListener</tt>
*/
- public void setPort(int port);
+ void setPort(int port);
/**
* Gets the port number of this <tt>WebListener</tt>.
*
* @return the port number of this <tt>WebListener</tt>
*/
- public int getPort();
+ int getPort();
/**
* Sets the protocol for this <tt>WebListener</tt>.
*
* @param protocol the protocol for this <tt>WebListener</tt>
*/
- public void setProtocol(String protocol);
+ void setProtocol(String protocol);
/**
* Gets the protocol of this <tt>WebListener</tt>.
*
* @return the protocol of this <tt>WebListener</tt>
*/
- public String getProtocol();
+ String getProtocol();
/**
* Reconfigures this <tt>WebListener</tt> with the given
@@ -86,8 +85,7 @@
* @throws GlassFishException if an error occurs,
* and this <tt>WebListener</tt> fails to be restarted
*/
- public void setConfig(WebListenerConfig config)
- throws ConfigException, GlassFishException;
+ void setConfig(WebListenerConfig config) throws ConfigException, GlassFishException;
/**
* Gets the current configuration of this <tt>WebListener</tt>.
@@ -96,16 +94,16 @@
* or <tt>null</tt> if no special configuration was ever applied to this
* <tt>WebListener</tt>
*/
- public WebListenerConfig getConfig();
+ WebListenerConfig getConfig();
/**
* Sets the <tt>WebContainer</tt> which will be used by this <tt>WebListener</tt>.
*/
- public void setWebContainer(WebContainer webContainer);
+ void setWebContainer(WebContainer webContainer);
/**
* Gets the <tt>WebContainer</tt> used by this <tt>WebListener</tt>.
*/
- public WebContainer getWebContainer();
+ WebContainer getWebContainer();
}
diff --git a/appserver/web/web-glue/src/main/java/com/sun/appserv/web/cache/CacheManagerListener.java b/appserver/web/web-glue/src/main/java/com/sun/appserv/web/cache/CacheManagerListener.java
index 71f1162..a672d46 100644
--- a/appserver/web/web-glue/src/main/java/com/sun/appserv/web/cache/CacheManagerListener.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/appserv/web/cache/CacheManagerListener.java
@@ -23,10 +23,10 @@
/**
* cache manager was enabled
*/
- public void cacheManagerEnabled();
+ void cacheManagerEnabled();
/**
* cache manager was disabled
*/
- public void cacheManagerDisabled();
+ void cacheManagerDisabled();
}
diff --git a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/ShutdownCleanupCapable.java b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/ShutdownCleanupCapable.java
index e234844..9e9948f 100755
--- a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/ShutdownCleanupCapable.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/ShutdownCleanupCapable.java
@@ -30,10 +30,10 @@
*/
public interface ShutdownCleanupCapable {
- public int doShutdownCleanup();
+ int doShutdownCleanup();
- public void doCloseCachedConnection();
+ void doCloseCachedConnection();
- public void putConnection(Connection conn);
+ void putConnection(Connection conn);
}
diff --git a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/connector/coyote/PECoyoteConnector.java b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/connector/coyote/PECoyoteConnector.java
index 91979c1..d23c907 100644
--- a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/connector/coyote/PECoyoteConnector.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/connector/coyote/PECoyoteConnector.java
@@ -1348,7 +1348,7 @@
}*/
/*
- * Truststore
+ * Truststore
*/
prop = System.getProperty("javax.net.ssl.trustStore");
if (prop != null) {
diff --git a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/logger/IASLogger.java b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/logger/IASLogger.java
index 56f124a..34031c1 100644
--- a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/logger/IASLogger.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/logger/IASLogger.java
@@ -114,14 +114,14 @@
StackTraceElement stack[] = (new Throwable()).getStackTrace();
_classname = "";
_methodname = "";
- for (int ix=0; ix < stack.length; ix++) {
- StackTraceElement frame = stack[ix];
- _classname = frame.getClassName();
- if (!_classname.startsWith("com.sun.enterprise.web.logger")) {
- // We've found the relevant frame. Get Method Name.
- _methodname = frame.getMethodName();
- return;
- }
+ for (int ix = 0; ix < stack.length; ix++) {
+ StackTraceElement frame = stack[ix];
+ _classname = frame.getClassName();
+ if (!_classname.startsWith("com.sun.enterprise.web.logger")) {
+ // We've found the relevant frame. Get Method Name.
+ _methodname = frame.getMethodName();
+ return;
+ }
}
}
}
diff --git a/appserver/web/web-glue/src/main/java/com/sun/web/server/J2EEInstanceListener.java b/appserver/web/web-glue/src/main/java/com/sun/web/server/J2EEInstanceListener.java
index 384a032..9c8ef3c 100644
--- a/appserver/web/web-glue/src/main/java/com/sun/web/server/J2EEInstanceListener.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/web/server/J2EEInstanceListener.java
@@ -160,61 +160,61 @@
if (request != null && request instanceof HttpServletRequest) {
HttpServletRequest hreq = (HttpServletRequest)request;
- HttpServletRequest base = hreq;
+ HttpServletRequest base = hreq;
- Principal prin = hreq.getUserPrincipal();
- Principal basePrincipal = prin;
+ Principal prin = hreq.getUserPrincipal();
+ Principal basePrincipal = prin;
- boolean wrapped = false;
+ boolean wrapped = false;
- while (prin != null) {
+ while (prin != null) {
- if (base instanceof ServletRequestWrapper) {
- // unwarp any wrappers to find the base object
- ServletRequest sr =
- ((ServletRequestWrapper) base).getRequest();
+ if (base instanceof ServletRequestWrapper) {
+ // unwarp any wrappers to find the base object
+ ServletRequest sr =
+ ((ServletRequestWrapper) base).getRequest();
- if (sr instanceof HttpServletRequest) {
+ if (sr instanceof HttpServletRequest) {
- base = (HttpServletRequest) sr;
- wrapped = true;
- continue;
- }
- }
+ base = (HttpServletRequest) sr;
+ wrapped = true;
+ continue;
+ }
+ }
- if (wrapped) {
- basePrincipal = base.getUserPrincipal();
- }
+ if (wrapped) {
+ basePrincipal = base.getUserPrincipal();
+ }
- else if (base instanceof RequestFacade) {
- // try to avoid the getUnWrappedCoyoteRequest call
- // when we can identify see we have the texact class.
- if (base.getClass() != RequestFacade.class) {
- basePrincipal = ((RequestFacade)base).
- getUnwrappedCoyoteRequest().getUserPrincipal();
- }
- } else {
- basePrincipal = base.getUserPrincipal();
- }
+ else if (base instanceof RequestFacade) {
+ // try to avoid the getUnWrappedCoyoteRequest call
+ // when we can identify see we have the texact class.
+ if (base.getClass() != RequestFacade.class) {
+ basePrincipal = ((RequestFacade)base).
+ getUnwrappedCoyoteRequest().getUserPrincipal();
+ }
+ } else {
+ basePrincipal = base.getUserPrincipal();
+ }
- break;
- }
+ break;
+ }
- if (prin != null && prin == basePrincipal &&
- prin.getClass().getName().equals(SecurityConstants.WEB_PRINCIPAL_CLASS)) {
+ if (prin != null && prin == basePrincipal
+ && prin.getClass().getName().equals(SecurityConstants.WEB_PRINCIPAL_CLASS)) {
securityContext.setSecurityContextWithPrincipal(prin);
- } else if (prin != basePrincipal) {
+ } else if (prin != basePrincipal) {
- // the wrapper has overridden getUserPrincipal
- // reject the request if the wrapper does not have
- // the necessary permission.
+ // the wrapper has overridden getUserPrincipal
+ // reject the request if the wrapper does not have
+ // the necessary permission.
- checkObjectForDoAsPermission(hreq);
+ checkObjectForDoAsPermission(hreq);
securityContext.setSecurityContextWithPrincipal(prin);
- }
+ }
- }
+ }
}
// END OF IASRI 4713234
// END IASRI 4688449
@@ -249,26 +249,26 @@
private static javax.security.auth.AuthPermission doAsPrivilegedPerm =
- new javax.security.auth.AuthPermission("doAsPrivileged");
+ new javax.security.auth.AuthPermission("doAsPrivileged");
private static void checkObjectForDoAsPermission(final Object o)
throws AccessControlException{
- if (System.getSecurityManager() != null) {
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- ProtectionDomain pD = o.getClass().getProtectionDomain();
- Policy p = Policy.getPolicy();
- if (!p.implies(pD,doAsPrivilegedPerm)) {
- throw new AccessControlException
- ("permission required to override getUserPrincipal",
- doAsPrivilegedPerm);
- }
- return null;
+ if (System.getSecurityManager() != null) {
+ AccessController.doPrivileged(new PrivilegedAction<Void>() {
+ public Void run() {
+ ProtectionDomain pD = o.getClass().getProtectionDomain();
+ Policy p = Policy.getPolicy();
+ if (!p.implies(pD,doAsPrivilegedPerm)) {
+ throw new AccessControlException
+ ("permission required to override getUserPrincipal",
+ doAsPrivilegedPerm);
+ }
+ return null;
+ }
+ });
}
- });
- }
}
private void handleAfterEvent(InstanceEvent event,
@@ -332,8 +332,7 @@
if (eventType == InstanceEvent.EventType.AFTER_SERVICE_EVENT) {
ServletResponse response = event.getResponse();
int status = -1;
- if (response != null &&
- response instanceof HttpServletResponse) {
+ if (response != null && response instanceof HttpServletResponse) {
status = ((HttpServletResponse) response).getStatus();
}
wm.afterServiceEvent(wrapper.getName(), status);
diff --git a/appserver/web/web-glue/src/main/java/com/sun/web/server/WebContainerListener.java b/appserver/web/web-glue/src/main/java/com/sun/web/server/WebContainerListener.java
index f9685f3..c0098cd 100644
--- a/appserver/web/web-glue/src/main/java/com/sun/web/server/WebContainerListener.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/web/server/WebContainerListener.java
@@ -126,10 +126,10 @@
public void containerEvent(ContainerEvent event) {
if(_logger.isLoggable(Level.FINEST)) {
- _logger.log(Level.FINEST, LogFacade.CONTAINER_EVENT,
- event.getType() + "," +
- event.getContainer() + "," +
- event.getData());
+ _logger.log(Level.FINEST, LogFacade.CONTAINER_EVENT,
+ event.getType() + "," +
+ event.getContainer() + "," +
+ event.getData());
}
String type = event.getType();
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AppListenerDescriptorImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AppListenerDescriptorImpl.java
index 075ac65..6c72f0a 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AppListenerDescriptorImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AppListenerDescriptorImpl.java
@@ -25,15 +25,13 @@
* Servlet 2.3 spec.
* @author Vivek Nagar
*/
+public class AppListenerDescriptorImpl extends Descriptor implements AppListenerDescriptor {
-public class AppListenerDescriptorImpl extends Descriptor
- implements AppListenerDescriptor
-{
private String listenerClass;
private String displayName;
/** The default constructor.
- */
+ */
public AppListenerDescriptorImpl() {
}
@@ -42,52 +40,57 @@
* @param the listener class name.
*/
public AppListenerDescriptorImpl(String clz) {
- this.listenerClass = clz;
+ this.listenerClass = clz;
}
/**
* Return the listener class.
* @return the listener class name or empty string if none.
*/
+ @Override
public String getListener() {
- if (this.listenerClass == null) {
- this.listenerClass = "";
- }
- return this.listenerClass;
+ if (this.listenerClass == null) {
+ this.listenerClass = "";
+ }
+ return this.listenerClass;
}
/**
* Sets the listener class.
* @param the listener class name.
*/
+ @Override
public void setListener(String clz) {
- this.listenerClass = clz;
+ this.listenerClass = clz;
}
/** set display name */
+ @Override
public void setDisplayName(String name) {
- this.displayName = (name != null)? name : "";
+ this.displayName = (name != null)? name : "";
}
/** get display name */
+ @Override
public String getDisplayName() {
- String n = this.displayName;
- if ((n == null) || n.equals("")) {
- n = this.getName();
- }
- return n;
+ String n = this.displayName;
+ if ((n == null) || n.equals("")) {
+ n = this.getName();
+ }
+ return n;
}
/**
* Test for equals
*/
+ @Override
public boolean equals(Object obj) {
- return (obj instanceof AppListenerDescriptorImpl)?
- this.getListener().equals(
- ((AppListenerDescriptorImpl)obj).getListener()) :
- super.equals(obj);
+ return (obj instanceof AppListenerDescriptorImpl)
+ ? this.getListener().equals(((AppListenerDescriptorImpl) obj).getListener())
+ : super.equals(obj);
}
+ @Override
public int hashCode() {
int result = 17;
result = 37*result + getListener().hashCode();
@@ -98,6 +101,7 @@
/**
* A formatted version of the state as a String.
*/
+ @Override
public void print(StringBuffer toStringBuffer) {
toStringBuffer.append("Listener Class ").append(this.getListener());
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AuthorizationConstraintImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AuthorizationConstraintImpl.java
index 991f7a6..bce7ac0 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AuthorizationConstraintImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/AuthorizationConstraintImpl.java
@@ -32,9 +32,8 @@
*
* @author Danny Coward
*/
+public class AuthorizationConstraintImpl extends Descriptor implements AuthorizationConstraint {
-public class AuthorizationConstraintImpl extends Descriptor implements
- AuthorizationConstraint {
private Set<SecurityRole> securityRoles;
/**
@@ -48,17 +47,17 @@
* Copy constructor.
*/
public AuthorizationConstraintImpl(AuthorizationConstraintImpl other) {
- this.securityRoles = new HashSet<SecurityRole>(other.getSecurityRoleSet());
+ this.securityRoles = new HashSet<>(other.getSecurityRoleSet());
}
/**
* Return the set of roles.
*/
private Set<SecurityRole> getSecurityRoleSet() {
- if (this.securityRoles == null) {
- this.securityRoles = new HashSet<SecurityRole>();
- }
- return this.securityRoles;
+ if (this.securityRoles == null) {
+ this.securityRoles = new HashSet<>();
+ }
+ return this.securityRoles;
}
/**
@@ -66,19 +65,21 @@
* enumeration is empty if there are none.
* @return the enumeration of security roles in this constraint.
*/
+ @Override
public Enumeration getSecurityRoles() {
- if (this.securityRoles == null) {
- this.securityRoles = new HashSet<SecurityRole>();
- }
- return (new Vector<SecurityRole>(this.getSecurityRoleSet())).elements();
+ if (this.securityRoles == null) {
+ this.securityRoles = new HashSet<>();
+ }
+ return (new Vector<>(this.getSecurityRoleSet())).elements();
}
/**
* Adds a role to the authorization constraint.
* @param the role to be added.
*/
+ @Override
public void addSecurityRole(SecurityRole securityRole) {
- this.getSecurityRoleSet().add(securityRole);
+ this.getSecurityRoleSet().add(securityRole);
}
/**
@@ -96,16 +97,16 @@
* @param the role to be removed.
*/
public void removeSecurityRole(SecurityRole securityRole) {
- this.getSecurityRoleSet().remove(securityRole);
+ this.getSecurityRoleSet().remove(securityRole);
}
/**
* Prints a formatted representation of this object.
*/
+ @Override
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("AuthorizationConstraint ");
- super.print(toStringBuffer);
- toStringBuffer.append(" securityRoles ").append(this.securityRoles);
+ toStringBuffer.append("AuthorizationConstraint ");
+ super.print(toStringBuffer);
+ toStringBuffer.append(" securityRoles ").append(this.securityRoles);
}
-
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ErrorPageDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ErrorPageDescriptor.java
index da06730..e5b968c 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ErrorPageDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ErrorPageDescriptor.java
@@ -16,98 +16,115 @@
package org.glassfish.web.deployment.descriptor;
-
-/** Objects exhiniting this interface represent an error page and the exception type or
-** error code that will cause the redirect from the web container.
-* @author Danny Coward
-*/
-
+/**
+ * Objects exhiniting this interface represent an error page and the exception type or
+ * error code that will cause the redirect from the web container.
+ *
+ * @author Danny Coward
+ */
public class ErrorPageDescriptor implements java.io.Serializable{
private int errorCode = -1; // none
private String exceptionType;
private String location;
- /** The default constructor.
- */
+ /**
+ * The default constructor.
+ */
public ErrorPageDescriptor() {
-
}
- /** Constructor for error code to error page mapping.*/
+
+ /** Constructor for error code to error page mapping. */
public ErrorPageDescriptor(int errorCode, String location) {
- this.errorCode = errorCode;
- this.location = location;
+ this.errorCode = errorCode;
+ this.location = location;
}
- /** Constructor for Java exception type to error page mapping.*/
+
+ /** Constructor for Java exception type to error page mapping. */
public ErrorPageDescriptor(String exceptionType, String location) {
- this.exceptionType = exceptionType;
- this.location = location;
+ this.exceptionType = exceptionType;
+ this.location = location;
}
+
+
/** Return the error code. -1 if none. */
public int getErrorCode() {
- return this.errorCode;
+ return this.errorCode;
}
- /** Sets the error code.*/
+
+
+ /** Sets the error code. */
public void setErrorCode(int errorCode) {
- this.errorCode = errorCode;
+ this.errorCode = errorCode;
}
+
+
/**
- * If there is an exception type, then the exception type is returned.
- * Otherwise, if the error code is not -1, then the error code is returned as a string.
- * If the error code is -1, then nul is returned.
+ * If there is an exception type, then the exception type is returned.
+ * Otherwise, if the error code is not -1, then the error code is returned as a string.
+ * If the error code is -1, then nul is returned.
*/
public String getErrorSignifierAsString() {
if ("".equals(this.getExceptionType())) {
- if (getErrorCode() == -1) {
- return null;
- } else {
- return String.valueOf(this.getErrorCode());
- }
+ if (getErrorCode() == -1) {
+ return null;
+ } else {
+ return String.valueOf(this.getErrorCode());
+ }
}
return this.getExceptionType();
}
- /**Sets the error code if the argument is parsable as an int, or the exception type else.*/
+
+
+ /** Sets the error code if the argument is parsable as an int, or the exception type else. */
public void setErrorSignifierAsString(String errorSignifier) {
- try {
- int errorCode = Integer.parseInt(errorSignifier);
- this.setErrorCode(errorCode);
- this.setExceptionType(null);
- return;
- } catch (NumberFormatException nfe) {
+ try {
+ int errorCode = Integer.parseInt(errorSignifier);
+ this.setErrorCode(errorCode);
+ this.setExceptionType(null);
+ return;
+ } catch (NumberFormatException nfe) {
- }
- this.setExceptionType(errorSignifier);
+ }
+ this.setExceptionType(errorSignifier);
}
- /** Return the exception type or the empty string if none.*/
+
+ /** Return the exception type or the empty string if none. */
public String getExceptionType() {
- if (this.exceptionType == null) {
- this.exceptionType = "";
- }
- return this.exceptionType;
+ if (this.exceptionType == null) {
+ this.exceptionType = "";
+ }
+ return this.exceptionType;
}
- /** Sets the exception type.*/
+
+ /** Sets the exception type. */
public void setExceptionType(String exceptionType) {
- this.exceptionType = exceptionType;
+ this.exceptionType = exceptionType;
}
+
+
/** Return the page to map to */
public String getLocation() {
- if (this.location == null) {
- this.location = "";
+ if (this.location == null) {
+ this.location = "";
+ }
+ return this.location;
}
- return this.location;
- }
- /* Set the page to map to */
+
+
+ /** Set the page to map to */
public void setLocation(String location) {
- this.location = location;
+ this.location = location;
}
- /* A formatted version of my state as a String. */
+
+
+ /** Appends a formatted version of my state as a String. */
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("ErrorPage ").append(this.getErrorCode()).append(" ").append(
- this.getExceptionType()).append(" ").append(this.getLocation());
+ toStringBuffer.append("ErrorPage ").append(this.getErrorCode())
+ .append(" ").append(this.getExceptionType()).append(" ").append(this.getLocation());
}
}
-
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/JspGroupDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/JspGroupDescriptor.java
index 6359d35..8744016 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/JspGroupDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/JspGroupDescriptor.java
@@ -192,11 +192,11 @@
}
public String getPageEncoding() {
- return pageEncoding;
+ return pageEncoding;
}
public void setPageEncoding(String encoding) {
- pageEncoding = encoding;
+ pageEncoding = encoding;
}
/**
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LocalizedContentDescriptorImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LocalizedContentDescriptorImpl.java
index 02e8aa1..1a22cd7 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LocalizedContentDescriptorImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LocalizedContentDescriptorImpl.java
@@ -27,36 +27,40 @@
}
public LocalizedContentDescriptorImpl(String locale, String url) {
- this.locale = locale;
- this.url = url;
+ this.locale = locale;
+ this.url = url;
}
+ @Override
public String getLocale() {
- if (this.locale == null) {
- this.locale = "";
- }
- return this.locale;
+ if (this.locale == null) {
+ this.locale = "";
+ }
+ return this.locale;
}
+ @Override
public void setLocale(String locale) {
- this.locale = locale;
+ this.locale = locale;
}
+ @Override
public String getUrl() {
- if (this.url == null) {
- this.url = "";
- }
- return this.url;
+ if (this.url == null) {
+ this.url = "";
+ }
+ return this.url;
}
+ @Override
public void setUrl(String url) {
- this.url = url;
+ this.url = url;
}
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("LocalizedContent: ");
- toStringBuffer.append(" locale: ").append(locale);
- toStringBuffer.append(" url: ").append(url);
+ toStringBuffer.append("LocalizedContent: ");
+ toStringBuffer.append(" locale: ").append(locale);
+ toStringBuffer.append(" url: ").append(url);
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LoginConfigurationImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LoginConfigurationImpl.java
index 68e7558..4d9060f 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LoginConfigurationImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/LoginConfigurationImpl.java
@@ -32,7 +32,6 @@
* I dictate how the web app I belong to should be logged into.
* @author Danny Coward
*/
-
public class LoginConfigurationImpl extends Descriptor implements LoginConfiguration {
static final Logger _logger = LogFacade.getLogger();
@@ -50,96 +49,115 @@
private String realmName = "";
private String formLoginPage = "";
private String formErrorPage = "";
- private static LocalStringManagerImpl localStrings =
- new LocalStringManagerImpl(LoginConfigurationImpl.class);
+ private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(LoginConfigurationImpl.class);
/** Return my authentication method. */
+ @Override
public String getAuthenticationMethod() {
- if (this.authenticationMethod == null) {
- //START OF IASRI 4660482 - warning log if authentication method isn't defined in descriptor
+ if (this.authenticationMethod == null) {
+ // START OF IASRI 4660482 - warning log if authentication method isn't defined in
+ // descriptor
_logger.log(Level.WARNING, LogFacade.AUTH_METHOD_NOT_FOUND);
- //END OF IASRI 4660482
- this.authenticationMethod = AUTHENTICATION_METHOD_BASIC;
- }
- return this.authenticationMethod;
+ // END OF IASRI 4660482
+ this.authenticationMethod = AUTHENTICATION_METHOD_BASIC;
+ }
+ return this.authenticationMethod;
}
/** Sets my authentication method. */
+ @Override
public void setAuthenticationMethod(String authenticationMethod) {
- if ( this.isBoundsChecking() ) {
+ if (Descriptor.isBoundsChecking()) {
- if (!LoginConfiguration.BASIC_AUTHENTICATION.equals(authenticationMethod)
- && !LoginConfiguration.DIGEST_AUTHENTICATION.equals(authenticationMethod)
- && !LoginConfiguration.FORM_AUTHENTICATION.equals(authenticationMethod)
- && !LoginConfiguration.CLIENT_CERTIFICATION_AUTHENTICATION.equals(authenticationMethod) ) {
+ if (!LoginConfiguration.BASIC_AUTHENTICATION.equals(authenticationMethod)
+ && !LoginConfiguration.DIGEST_AUTHENTICATION.equals(authenticationMethod)
+ && !LoginConfiguration.FORM_AUTHENTICATION.equals(authenticationMethod)
+ && !LoginConfiguration.CLIENT_CERTIFICATION_AUTHENTICATION.equals(authenticationMethod) ) {
- throw new IllegalArgumentException(
+ throw new IllegalArgumentException(
MessageFormat.format(
- _logger.getResourceBundle().getString(LogFacade.EXCEPTION_AUTH_METHOD),
- authenticationMethod));
+ _logger.getResourceBundle().getString(LogFacade.EXCEPTION_AUTH_METHOD),
+ authenticationMethod));
+ }
}
- }
- this.authenticationMethod = authenticationMethod;
+ this.authenticationMethod = authenticationMethod;
}
+
/** Obtain the realm the server should use for basic authentication. */
+ @Override
public String getRealmName() {
- if (this.realmName == null) {
- this.realmName = "";
+ if (this.realmName == null) {
+ this.realmName = "";
+ }
+ return this.realmName;
}
- return this.realmName;
- }
+
/** Set the realm the server should use for basic authentication. */
+ @Override
public void setRealmName(String realmName) {
- this.realmName = realmName;
+ this.realmName = realmName;
}
+
/** Get the name of the login page for form login. */
+ @Override
public String getFormLoginPage() {
- if (this.formLoginPage == null) {
- this.formLoginPage = "";
- }
- return this.formLoginPage;
- }
- /** Set the name of the login page for form login. */
- public void setFormLoginPage(String formLoginPage) {
- this.formLoginPage = formLoginPage;
+ if (this.formLoginPage == null) {
+ this.formLoginPage = "";
+ }
+ return this.formLoginPage;
}
+
+ /** Set the name of the login page for form login. */
+ @Override
+ public void setFormLoginPage(String formLoginPage) {
+ this.formLoginPage = formLoginPage;
+ }
+
+
/** Get the name of the error page for form login. */
+ @Override
public String getFormErrorPage() {
- if (this.formErrorPage == null) {
- this.formErrorPage = "";
+ if (this.formErrorPage == null) {
+ this.formErrorPage = "";
+ }
+ return this.formErrorPage;
}
- return this.formErrorPage;
- }
+
+
/** Set the name of the error page for form login. */
+ @Override
public void setFormErrorPage(String formErrorPage) {
- this.formErrorPage = formErrorPage;
+ this.formErrorPage = formErrorPage;
}
/** My representation as a formatted String.*/
+ @Override
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("LoginConfig:(").append(authenticationMethod).append(" ").append(
+ toStringBuffer.append("LoginConfig:(").append(authenticationMethod).append(" ").append(
realmName).append(" ").append(formLoginPage).append(" ").append(formErrorPage).append(")");
}
+ @Override
public boolean equals(Object obj) {
boolean result = false;
if (obj instanceof LoginConfigurationImpl) {
LoginConfigurationImpl other = (LoginConfigurationImpl)obj;
result = getAuthenticationMethod().equals(other.getAuthenticationMethod()) &&
- getRealmName().equals(other.getRealmName()) &&
- getFormLoginPage().equals(other.getFormLoginPage()) &&
- getFormErrorPage().equals(other.getFormErrorPage());
+ getRealmName().equals(other.getRealmName()) &&
+ getFormLoginPage().equals(other.getFormLoginPage()) &&
+ getFormErrorPage().equals(other.getFormErrorPage());
}
return result;
}
+ @Override
public int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + getAuthenticationMethod().hashCode();
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/MimeMappingDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/MimeMappingDescriptor.java
index 1e1082f..a26ff3a 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/MimeMappingDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/MimeMappingDescriptor.java
@@ -20,59 +20,74 @@
import java.io.Serializable;
- /*** I represent a mapping between a mime type and a file extension for specifiying how
- * to handle mime types in a J2EE WAR.
- *@author Danny Coward
- */
-
+/***
+ * I represent a mapping between a mime type and a file extension for specifiying how
+ * to handle mime types in a J2EE WAR.
+ *
+ * @author Danny Coward
+ */
public class MimeMappingDescriptor implements MimeMapping, Serializable {
+
private String extension;
private String mimeType;
/** copy constructor */
public MimeMappingDescriptor(MimeMappingDescriptor other) {
- // super(other);
- extension = other.extension;
- mimeType = other.mimeType;
+ // super(other);
+ extension = other.extension;
+ mimeType = other.mimeType;
}
+
/** Construct the mapping for the given extension to the given mime type. */
public MimeMappingDescriptor(String extension, String mimeType) {
- this.extension = extension;
- this.mimeType = mimeType;
+ this.extension = extension;
+ this.mimeType = mimeType;
}
+
/* Default constructor. */
public MimeMappingDescriptor() {
}
+
/** Return the filename extension for this mapping. */
+ @Override
public String getExtension() {
- if (this.extension == null) {
- this.extension = "";
+ if (this.extension == null) {
+ this.extension = "";
+ }
+ return this.extension;
}
- return this.extension;
- }
+
/** Set the filename extension for this mapping. */
+ @Override
public void setExtension(String extension) {
- this.extension = extension;
+ this.extension = extension;
}
+
/** Get the mime type for this mapping. */
+ @Override
public String getMimeType() {
- if (this.mimeType == null) {
- this.mimeType = "";
+ if (this.mimeType == null) {
+ this.mimeType = "";
+ }
+ return this.mimeType;
}
- return this.mimeType;
- }
+
+
/** Set the mime type for this mapping. */
+ @Override
public void setMimeType(String mimeType) {
- this.mimeType = mimeType;
+ this.mimeType = mimeType;
}
+
+
/** My pretty format. */
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("MimeMapping: ").append(this.getExtension()).append("@").append(this.getMimeType());
+ toStringBuffer.append("MimeMapping: ").append(this.getExtension()).append("@").append(this.getMimeType());
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/SecurityConstraintImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/SecurityConstraintImpl.java
index de5aa3e..131f494 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/SecurityConstraintImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/SecurityConstraintImpl.java
@@ -26,12 +26,11 @@
import java.util.Set;
- /**
- * Objects exhibiting this interface represent a security constraint on the web application
- * that owns them.
- * @author Danny Coward
- */
-
+/**
+ * Objects exhibiting this interface represent a security constraint on the web application
+ * that owns them.
+ * @author Danny Coward
+ */
public class SecurityConstraintImpl extends Descriptor implements SecurityConstraint {
private Set<WebResourceCollection> webResourceCollections;
private AuthorizationConstraint authorizationConstraint;
@@ -61,12 +60,12 @@
/** Return all the web resource collection.
- */
+ */
public Set<WebResourceCollection> getWebResourceCollections() {
- if (this.webResourceCollections == null) {
- this.webResourceCollections = new HashSet<WebResourceCollection>();
- }
- return this.webResourceCollections;
+ if (this.webResourceCollections == null) {
+ this.webResourceCollections = new HashSet<WebResourceCollection>();
+ }
+ return this.webResourceCollections;
}
/** Adds a web resource collection to this constraint.*/
@@ -85,38 +84,38 @@
/** The authorization constraint. */
public AuthorizationConstraint getAuthorizationConstraint() {
- return this.authorizationConstraint;
+ return this.authorizationConstraint;
}
/** Sets the authorization constraint.*/
public void setAuthorizationConstraint(AuthorizationConstraint authorizationConstraint) {
- this.authorizationConstraint = authorizationConstraint;
+ this.authorizationConstraint = authorizationConstraint;
}
/** Sets the authorization constraint.*/
public void setAuthorizationConstraint(AuthorizationConstraintImpl authorizationConstraint) {
- setAuthorizationConstraint((AuthorizationConstraint) authorizationConstraint);
+ setAuthorizationConstraint((AuthorizationConstraint) authorizationConstraint);
}
/** The user data constraint. */
public UserDataConstraint getUserDataConstraint() {
- return this.userDataConstraint;
+ return this.userDataConstraint;
}
/** Sets the user data constraint. */
public void setUserDataConstraint(UserDataConstraint userDataConstraint) {
- this.userDataConstraint = userDataConstraint;
+ this.userDataConstraint = userDataConstraint;
}
public void setUserDataConstraint(UserDataConstraintImpl userDataConstraint) {
- setUserDataConstraint((UserDataConstraint) userDataConstraint);
+ setUserDataConstraint((UserDataConstraint) userDataConstraint);
}
/** Returns a formatted String representing of my state.*/
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("SecurityConstraint: ");
- toStringBuffer.append(" webResourceCollections: ").append(webResourceCollections);
- toStringBuffer.append(" authorizationConstraint ").append(authorizationConstraint);
- toStringBuffer.append(" userDataConstraint ").append(userDataConstraint);
+ toStringBuffer.append("SecurityConstraint: ");
+ toStringBuffer.append(" webResourceCollections: ").append(webResourceCollections);
+ toStringBuffer.append(" authorizationConstraint ").append(authorizationConstraint);
+ toStringBuffer.append(" userDataConstraint ").append(userDataConstraint);
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterDescriptor.java
index e6e8d8f..9525c8f 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterDescriptor.java
@@ -29,8 +29,8 @@
* @author Martin D. Flynn
*/
public class ServletFilterDescriptor
- extends Descriptor
- implements ServletFilter
+extends Descriptor
+implements ServletFilter
{
/** class name */
@@ -51,48 +51,48 @@
private boolean conflict = false;
/* ----
- */
+ */
/** generic constructor */
public ServletFilterDescriptor() {
- super("", ""/*description*/);
- this.setClassName("");
+ super("", ""/*description*/);
+ this.setClassName("");
}
/** constructor specifying descriptor name (Filter name) & displayName */
public ServletFilterDescriptor(String className, String name) {
- super(name, ""/*description*/);
- this.setClassName(className);
+ super(name, ""/*description*/);
+ this.setClassName(className);
}
/* ----
- */
+ */
/** set class name */
public void setClassName(String name) {
- this.className = (name != null)? name : "";
+ this.className = (name != null)? name : "";
}
/** get class name */
public String getClassName() {
- if (this.className == null) {
- this.className = "";
- }
- return this.className;
+ if (this.className == null) {
+ this.className = "";
+ }
+ return this.className;
}
/** set display name */
public void setDisplayName(String name) {
- this.displayName = (name != null)? name : "";
+ this.displayName = (name != null)? name : "";
}
/** get display name */
public String getDisplayName() {
- String n = this.displayName;
- if ((n == null) || n.equals("")) {
- n = this.getName();
- }
- return n;
+ String n = this.displayName;
+ if ((n == null) || n.equals("")) {
+ n = this.getName();
+ }
+ return n;
}
public boolean hasSetDisplayName() {
@@ -106,42 +106,42 @@
/** get filter name */
public String getName() {
- if ((filterName == null) || filterName.equals("")) {
- String c = this.getClassName();
- int p = c.lastIndexOf('.');
- filterName = (p < 0)? c : c.substring(p + 1);
- }
- return filterName;
+ if ((filterName == null) || filterName.equals("")) {
+ String c = this.getClassName();
+ int p = c.lastIndexOf('.');
+ filterName = (p < 0)? c : c.substring(p + 1);
+ }
+ return filterName;
}
/* ----
- */
+ */
/* set initialization parameters */
public void setInitializationParameters(Collection<InitializationParameter> c) {
- this.initParms.clear();
- this.initParms.addAll(c);
+ this.initParms.clear();
+ this.initParms.addAll(c);
}
/* get initialization parameters */
@SuppressWarnings("unchecked")
public Vector<InitializationParameter> getInitializationParameters() {
- return (Vector<InitializationParameter>)this.initParms.clone();
+ return (Vector<InitializationParameter>)this.initParms.clone();
}
/* add a single initialization parameter */
public void addInitializationParameter(InitializationParameter ref) {
- this.initParms.addElement(ref);
+ this.initParms.addElement(ref);
}
/* add a single initialization parameter */
public void addInitializationParameter(EnvironmentProperty ref) {
- addInitializationParameter((InitializationParameter) ref);
+ addInitializationParameter((InitializationParameter) ref);
}
/* remove a single initialization parameter */
public void removeInitializationParameter(InitializationParameter ref) {
- this.initParms.removeElement(ref);
+ this.initParms.removeElement(ref);
}
/* set asyncSupported */
@@ -182,17 +182,15 @@
}
/* ----
- */
+ */
/** compare equals */
public boolean equals(Object obj) {
//Should allow a filter with different name mapping
//to the same class.
if (obj instanceof ServletFilter) {
- if (this.getClassName().equals(
- ((ServletFilter)obj).getClassName())
- && this.getName().equals(
- ((ServletFilter)obj).getName())) {
+ if (this.getClassName().equals(((ServletFilter) obj).getClassName())
+ && this.getName().equals(((ServletFilter) obj).getName())) {
return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterMappingDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterMappingDescriptor.java
index 4dd1830..561ae60 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterMappingDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/ServletFilterMappingDescriptor.java
@@ -17,9 +17,14 @@
package org.glassfish.web.deployment.descriptor;
import com.sun.enterprise.deployment.web.ServletFilterMapping;
+
+import java.util.EnumSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
import org.glassfish.deployment.common.Descriptor;
-import java.util.*;
import jakarta.servlet.DispatcherType;
/**
@@ -27,8 +32,8 @@
* @author Martin D. Flynn
*/
public final class ServletFilterMappingDescriptor
- extends Descriptor
- implements com.sun.enterprise.deployment.web.ServletFilterMapping
+extends Descriptor
+implements com.sun.enterprise.deployment.web.ServletFilterMapping
{
private EnumSet<DispatcherType> dispatchers;
@@ -37,7 +42,7 @@
/** generic constructor */
public ServletFilterMappingDescriptor() {
- super(""/*name*/, ""/*description*/);
+ super(""/*name*/, ""/*description*/);
}
/** copy constructor */
@@ -98,12 +103,12 @@
Set<DispatcherType> otherDispatchers = o.getDispatchers();
boolean sameDispatchers =
( (dispatchers == null &&
- (otherDispatchers == null || otherDispatchers.size() == 0)) ||
+ (otherDispatchers == null || otherDispatchers.size() == 0)) ||
(dispatchers != null && dispatchers.equals(otherDispatchers)) );
if ( this.getName().equals(o.getName())
- && this.getServletNames().equals(o.getServletNames())
- && this.getUrlPatterns().equals(o.getUrlPatterns())
- && sameDispatchers ) {
+ && this.getServletNames().equals(o.getServletNames())
+ && this.getUrlPatterns().equals(o.getUrlPatterns())
+ && sameDispatchers ) {
return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/TagLibConfigurationDescriptor.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/TagLibConfigurationDescriptor.java
index f3861ad..14cbb86 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/TagLibConfigurationDescriptor.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/TagLibConfigurationDescriptor.java
@@ -25,9 +25,7 @@
*
* @author Danny Coward
*/
-
-public class TagLibConfigurationDescriptor
- implements Serializable, TaglibDescriptor {
+public class TagLibConfigurationDescriptor implements Serializable, TaglibDescriptor {
private String uri;
private String location;
@@ -44,8 +42,8 @@
* @param the location.
*/
public TagLibConfigurationDescriptor(String uri, String location) {
- this.uri = uri;
- this.location = location;
+ this.uri = uri;
+ this.location = location;
}
/**
@@ -61,10 +59,10 @@
* @return the URI of the tag library.
*/
public String getTagLibURI() {
- if (this.uri == null) {
- this.uri = "";
- }
- return this.uri;
+ if (this.uri == null) {
+ this.uri = "";
+ }
+ return this.uri;
}
public String getTaglibURI() {
@@ -84,10 +82,10 @@
* @return the location of the tag library.
*/
public String getTagLibLocation() {
- if (this.location == null) {
- this.location = "";
- }
- return this.location;
+ if (this.location == null) {
+ this.location = "";
+ }
+ return this.location;
}
public String getTaglibLocation() {
@@ -98,7 +96,7 @@
* Return a formatted String representing my state.
*/
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("TGLIB: ").append(uri).append(", ").append(location);
+ toStringBuffer.append("TGLIB: ").append(uri).append(", ").append(location);
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/UserDataConstraintImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/UserDataConstraintImpl.java
index 278affc..96abbb6 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/UserDataConstraintImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/UserDataConstraintImpl.java
@@ -22,12 +22,12 @@
/**
- * I represent the information about how the web application's data should be protected.
- *
- * @author Danny Coward
- */
-
+ * I represent the information about how the web application's data should be protected.
+ *
+ * @author Danny Coward
+ */
public class UserDataConstraintImpl extends Descriptor implements UserDataConstraint {
+
/** The transport is unspecified.*/
public static final String TRANSPORT_GUARANTEE_NONE = UserDataConstraint.NONE_TRANSPORT;
/** HTTP.*/
@@ -38,55 +38,54 @@
/** JACC Specific **/
public static final String TRANSPORT_GUARANTEE_CLEAR = UserDataConstraint.CLEAR;
private String transportGuarantee;
- private static LocalStringManagerImpl localStrings =
- new LocalStringManagerImpl(UserDataConstraintImpl.class);
+ private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(UserDataConstraintImpl.class);
/**
- * Return my transport type.
- */
+ * Return my transport type.
+ */
public String getTransportGuarantee() {
- if (transportGuarantee == null) {
- transportGuarantee = TRANSPORT_GUARANTEE_NONE;
- }
- return transportGuarantee;
+ if (transportGuarantee == null) {
+ transportGuarantee = TRANSPORT_GUARANTEE_NONE;
+ }
+ return transportGuarantee;
}
public String[] getUnacceptableTransportGuarantees(){
- String acceptable = getTransportGuarantee();
- if(acceptable.equals(TRANSPORT_GUARANTEE_NONE))
- return (String[]) null;
- else if (acceptable.equals(TRANSPORT_GUARANTEE_INTEGRAL)){
- String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_CONFIDENTIAL };
- return ret;
- } else if (acceptable.equals(TRANSPORT_GUARANTEE_CONFIDENTIAL)){
- String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_INTEGRAL };
- return ret;
- }
- return (String[]) null;
+ String acceptable = getTransportGuarantee();
+ if(acceptable.equals(TRANSPORT_GUARANTEE_NONE))
+ return (String[]) null;
+ else if (acceptable.equals(TRANSPORT_GUARANTEE_INTEGRAL)){
+ String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_CONFIDENTIAL };
+ return ret;
+ } else if (acceptable.equals(TRANSPORT_GUARANTEE_CONFIDENTIAL)){
+ String[] ret = new String[] {TRANSPORT_GUARANTEE_CLEAR, TRANSPORT_GUARANTEE_INTEGRAL };
+ return ret;
+ }
+ return (String[]) null;
}
/**
- * Sets my transport type to the given value. Throws an illegal argument exception
- * if the value is not allowed.
- */
+ * Sets my transport type to the given value. Throws an illegal argument exception
+ * if the value is not allowed.
+ */
public void setTransportGuarantee(String transportGuarantee) {
- if (this.isBoundsChecking()) {
- if ( !UserDataConstraint.NONE_TRANSPORT.equals(transportGuarantee)
- && !UserDataConstraint.INTEGRAL_TRANSPORT.equals(transportGuarantee)
- && !UserDataConstraint.CONFIDENTIAL_TRANSPORT.equals(transportGuarantee)) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptiontransportguarentee",
- "{0} is not a valid transport guarantee", new Object[] {transportGuarantee}));
+ if (this.isBoundsChecking()) {
+ if ( !UserDataConstraint.NONE_TRANSPORT.equals(transportGuarantee)
+ && !UserDataConstraint.INTEGRAL_TRANSPORT.equals(transportGuarantee)
+ && !UserDataConstraint.CONFIDENTIAL_TRANSPORT.equals(transportGuarantee)) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptiontransportguarentee",
+ "{0} is not a valid transport guarantee", new Object[] {transportGuarantee}));
+ }
}
- }
- this.transportGuarantee = transportGuarantee;
+ this.transportGuarantee = transportGuarantee;
}
/**
- * Returns a formatted String of my state.
- */
+ * Returns a formatted String of my state.
+ */
public void print(StringBuffer toStringBuffer) {
- toStringBuffer.append("UserDataConstraint ");
- toStringBuffer.append(" description ").append(super.getDescription());
- toStringBuffer.append(" transportGuarantee ").append(getTransportGuarantee());
+ toStringBuffer.append("UserDataConstraint ");
+ toStringBuffer.append(" description ").append(super.getDescription());
+ toStringBuffer.append(" transportGuarantee ").append(getTransportGuarantee());
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/WebBundleDescriptorImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/WebBundleDescriptorImpl.java
index c8f594d..0d3185f 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/WebBundleDescriptorImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/descriptor/WebBundleDescriptorImpl.java
@@ -22,8 +22,34 @@
import com.sun.enterprise.deployment.util.ComponentPostVisitor;
import com.sun.enterprise.deployment.util.ComponentVisitor;
import com.sun.enterprise.deployment.util.DOLUtils;
-import com.sun.enterprise.deployment.web.*;
+import com.sun.enterprise.deployment.web.AppListenerDescriptor;
+import com.sun.enterprise.deployment.web.ContextParameter;
+import com.sun.enterprise.deployment.web.EnvironmentEntry;
+import com.sun.enterprise.deployment.web.LoginConfiguration;
+import com.sun.enterprise.deployment.web.MimeMapping;
+import com.sun.enterprise.deployment.web.ResourceReference;
+import com.sun.enterprise.deployment.web.SecurityConstraint;
+import com.sun.enterprise.deployment.web.SecurityRole;
+import com.sun.enterprise.deployment.web.SecurityRoleReference;
+import com.sun.enterprise.deployment.web.ServletFilter;
+import com.sun.enterprise.deployment.web.ServletFilterMapping;
+import com.sun.enterprise.deployment.web.SessionConfig;
+import com.sun.enterprise.deployment.web.WebResourceCollection;
import com.sun.enterprise.util.LocalStringManagerImpl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
import org.glassfish.api.deployment.archive.ArchiveType;
import org.glassfish.deployment.common.Descriptor;
import org.glassfish.deployment.common.DescriptorVisitor;
@@ -36,21 +62,18 @@
import org.glassfish.web.deployment.util.WebBundleValidator;
import org.glassfish.web.deployment.util.WebBundleVisitor;
-import java.util.*;
-
/**
- *
- * The concrete implementation of abstract super class com.sun.enterprise.deployment.WebBundleDescriptor.
- * TODO WebBundleDescriptor could be changed from abstract class to an interface in the future, with this
- * class as its implementation.
- */
-
-public class WebBundleDescriptorImpl extends WebBundleDescriptor {
+ * The concrete implementation of abstract super class
+ * com.sun.enterprise.deployment.WebBundleDescriptor.
+ * TODO WebBundleDescriptor could be changed from abstract class to an interface in the future,
+ * with this
+ * class as its implementation.
+ */
+ public class WebBundleDescriptorImpl extends WebBundleDescriptor {
private final static String DEPLOYMENT_DESCRIPTOR_DIR = "WEB-INF";
- private static LocalStringManagerImpl localStrings =
- new LocalStringManagerImpl(WebBundleDescriptor.class);
+ private static LocalStringManagerImpl localStrings = new LocalStringManagerImpl(WebBundleDescriptor.class);
private Set<WebComponentDescriptor> webComponentDescriptors;
private SessionConfig sessionConfig;
@@ -65,18 +88,12 @@
private Set<MessageDestinationReferenceDescriptor> messageDestReferences;
private Set<ServiceReferenceDescriptor> serviceReferences;
- private Set<LifecycleCallbackDescriptor> postConstructDescs =
- new HashSet<LifecycleCallbackDescriptor>();
- private Set<LifecycleCallbackDescriptor> preDestroyDescs =
- new HashSet<LifecycleCallbackDescriptor>();
+ private Set<LifecycleCallbackDescriptor> postConstructDescs = new HashSet<>();
+ private Set<LifecycleCallbackDescriptor> preDestroyDescs = new HashSet<>();
- private Set<EntityManagerFactoryReferenceDescriptor>
- entityManagerFactoryReferences =
- new HashSet<EntityManagerFactoryReferenceDescriptor>();
+ private Set<EntityManagerFactoryReferenceDescriptor> entityManagerFactoryReferences = new HashSet<>();
- private Set<EntityManagerReferenceDescriptor>
- entityManagerReferences =
- new HashSet<EntityManagerReferenceDescriptor>();
+ private Set<EntityManagerReferenceDescriptor> entityManagerReferences = new HashSet<>();
private boolean distributable = false;
private boolean denyUncoveredHttpMethods = false;
@@ -102,7 +119,7 @@
//
private Map<String, String> extensionProperty = null;
- private Map<String, String> jarName2WebFragNameMap = null;
+ private Map<String, String> jarName2WebFragNameMap = null;
// this is for checking whether there are more than one servlets for a given url-pattern
private Map<String, String> urlPattern2ServletName = null;
@@ -134,6 +151,7 @@
addCommonWebBundleDescriptor(webBundleDescriptor, false);
}
+
public void addDefaultWebBundleDescriptor(WebBundleDescriptor webBundleDescriptor) {
if (getWelcomeFilesSet().size() == 0) {
getWelcomeFilesSet().addAll(webBundleDescriptor.getWelcomeFilesSet());
@@ -150,8 +168,7 @@
/**
* This method combines all except welcome file set for two webBundleDescriptors.
*/
- private void addCommonWebBundleDescriptor(WebBundleDescriptor wbd,
- boolean defaultDescriptor) {
+ private void addCommonWebBundleDescriptor(WebBundleDescriptor wbd, boolean defaultDescriptor) {
super.addBundleDescriptor(wbd);
WebBundleDescriptorImpl webBundleDescriptor = (WebBundleDescriptorImpl) wbd;
@@ -172,7 +189,7 @@
servletName = urlPattern2ServletName.get(urlPattern);
}
if (servletName != null &&
- (!servletName.equals(webComponentDescriptor.getCanonicalName()))) {
+ (!servletName.equals(webComponentDescriptor.getCanonicalName()))) {
// url pattern already exists in current bundle
// need to remove the url pattern in current bundle servlet
if (removeUrlPatterns == null) {
@@ -2239,55 +2256,56 @@
}
}
- protected void combineResourceDescriptors(JndiNameEnvironment env, JavaEEResourceType javaEEResourceType) {
- for (ResourceDescriptor desc : env.getResourceDescriptors(javaEEResourceType)) {
- ResourceDescriptor descriptor = getResourceDescriptor(javaEEResourceType, desc.getName());
- if (descriptor == null) {
- if (env instanceof WebBundleDescriptor) {
- WebBundleDescriptor wbDesc = (WebBundleDescriptor)env;
- if (javaEEResourceType.equals(JavaEEResourceType.AODD) &&
- wbDesc.isConflictAdminObjectDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictadministeredobjectdefinition",
- "There are more than one administered object definitions defined in web fragments with the same name, but not overrided in web.xml"));
- } else if (javaEEResourceType.equals(JavaEEResourceType.MSD) &&
- wbDesc.isConflictMailSessionDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictmailsessiondefinition",
- "There are more than one mail-session definitions defined in web fragments with the same name, but not overrided in web.xml"));
- } else if (javaEEResourceType.equals(JavaEEResourceType.DSD) &&
- wbDesc.isConflictDataSourceDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictdatasourcedefinition",
- "There are more than one datasource definitions defined in web fragments with the same name, but not overrided in web.xml"));
- } else if (javaEEResourceType.equals(JavaEEResourceType.CFD) &&
- wbDesc.isConflictConnectionFactoryDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictconnectionfactorydefinition",
- "There are more than one connection factory definitions defined in web fragments with the same name, but not overrided in web.xml"));
- } else if (javaEEResourceType.equals(JavaEEResourceType.JMSCFDD) &&
- wbDesc.isConflictJMSConnectionFactoryDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictjmsconnectionfactorydefinition",
- "There are more than one jms connection factory definitions defined in web fragments with the same name, but not overrided in web.xml"));
- } else if (javaEEResourceType.equals(JavaEEResourceType.JMSDD) &&
- wbDesc.isConflictJMSDestinationDefinition()) {
- throw new IllegalArgumentException(localStrings.getLocalString(
- "web.deployment.exceptionconflictjmsdestinationdefinition",
- "There are more than one jms destination definitions defined in web fragments with the same name, but not overrided in web.xml"));
- }
- }
- if (desc.getResourceType().equals(JavaEEResourceType.DSD) ||
- desc.getResourceType().equals(JavaEEResourceType.MSD) ||
- desc.getResourceType().equals(JavaEEResourceType.CFD) ||
- desc.getResourceType().equals(JavaEEResourceType.AODD) ||
- desc.getResourceType().equals(JavaEEResourceType.JMSCFDD) ||
- desc.getResourceType().equals(JavaEEResourceType.JMSDD)) {
- getResourceDescriptors(javaEEResourceType).add(desc);
- }
- }
- }
+ protected void combineResourceDescriptors(JndiNameEnvironment env, JavaEEResourceType javaEEResourceType) {
+ for (ResourceDescriptor desc : env.getResourceDescriptors(javaEEResourceType)) {
+ ResourceDescriptor descriptor = getResourceDescriptor(javaEEResourceType, desc.getName());
+ if (descriptor == null) {
+ if (env instanceof WebBundleDescriptor) {
+ WebBundleDescriptor wbDesc = (WebBundleDescriptor) env;
+
+ if (javaEEResourceType.equals(JavaEEResourceType.AODD)
+ && wbDesc.isConflictAdminObjectDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictadministeredobjectdefinition",
+ "There are more than one administered object definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ } else if (javaEEResourceType.equals(JavaEEResourceType.MSD)
+ && wbDesc.isConflictMailSessionDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictmailsessiondefinition",
+ "There are more than one mail-session definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ } else if (javaEEResourceType.equals(JavaEEResourceType.DSD)
+ && wbDesc.isConflictDataSourceDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictdatasourcedefinition",
+ "There are more than one datasource definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ } else if (javaEEResourceType.equals(JavaEEResourceType.CFD)
+ && wbDesc.isConflictConnectionFactoryDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictconnectionfactorydefinition",
+ "There are more than one connection factory definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ } else if (javaEEResourceType.equals(JavaEEResourceType.JMSCFDD)
+ && wbDesc.isConflictJMSConnectionFactoryDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictjmsconnectionfactorydefinition",
+ "There are more than one jms connection factory definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ } else if (javaEEResourceType.equals(JavaEEResourceType.JMSDD)
+ && wbDesc.isConflictJMSDestinationDefinition()) {
+ throw new IllegalArgumentException(localStrings.getLocalString(
+ "web.deployment.exceptionconflictjmsdestinationdefinition",
+ "There are more than one jms destination definitions defined in web fragments with the same name, but not overrided in web.xml"));
+ }
+ }
+ if (desc.getResourceType().equals(JavaEEResourceType.DSD)
+ || desc.getResourceType().equals(JavaEEResourceType.MSD)
+ || desc.getResourceType().equals(JavaEEResourceType.CFD)
+ || desc.getResourceType().equals(JavaEEResourceType.AODD)
+ || desc.getResourceType().equals(JavaEEResourceType.JMSCFDD)
+ || desc.getResourceType().equals(JavaEEResourceType.JMSDD)) {
+ getResourceDescriptors(javaEEResourceType).add(desc);
+ }
+ }
+ }
}
/*******************************************************************************************
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/JspConfigNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/JspConfigNode.java
index 61b992c..5187285 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/JspConfigNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/JspConfigNode.java
@@ -30,10 +30,11 @@
* This node represents the <jsp-config> element in a web application.
*/
public class JspConfigNode extends DeploymentDescriptorNode<JspConfigDescriptorImpl> {
+
public JspConfigNode() {
- super();
- registerElementHandler(new XMLElement(WebTagNames.TAGLIB), TagLibNode.class, "addTagLib");
- registerElementHandler(new XMLElement(WebTagNames.JSP_GROUP), JspGroupNode.class, "addJspGroup");
+ super();
+ registerElementHandler(new XMLElement(WebTagNames.TAGLIB), TagLibNode.class, "addTagLib");
+ registerElementHandler(new XMLElement(WebTagNames.JSP_GROUP), JspGroupNode.class, "addJspGroup");
}
protected JspConfigDescriptorImpl descriptor = null;
@@ -43,12 +44,13 @@
*/
@Override
public JspConfigDescriptorImpl getDescriptor() {
- if (descriptor==null) {
+ if (descriptor == null) {
descriptor = new JspConfigDescriptorImpl();
}
return descriptor;
}
+
/**
* write the descriptor class to a DOM tree and return it
*
@@ -57,18 +59,17 @@
* @param the descriptor to write
* @return the DOM tree top node
*/
+ @Override
public Node writeDescriptor(Node parent, String nodeName, JspConfigDescriptorImpl descriptor) {
- Node myNode = appendChild(parent, nodeName);
- TagLibNode lNode = new TagLibNode();
- for (TaglibDescriptor desc : descriptor.getTaglibs()) {
- lNode.writeDescriptor(myNode, WebTagNames.TAGLIB,
- (TagLibConfigurationDescriptor) desc);
- }
- JspGroupNode jspGroup = new JspGroupNode();
- for(JspPropertyGroupDescriptor desc : descriptor.getJspPropertyGroups()) {
- jspGroup.writeDescriptor(myNode, WebTagNames.JSP_GROUP,
- (JspGroupDescriptor) desc);
- }
+ Node myNode = appendChild(parent, nodeName);
+ TagLibNode lNode = new TagLibNode();
+ for (TaglibDescriptor desc : descriptor.getTaglibs()) {
+ lNode.writeDescriptor(myNode, WebTagNames.TAGLIB, (TagLibConfigurationDescriptor) desc);
+ }
+ JspGroupNode jspGroup = new JspGroupNode();
+ for (JspPropertyGroupDescriptor desc : descriptor.getJspPropertyGroups()) {
+ jspGroup.writeDescriptor(myNode, WebTagNames.JSP_GROUP, (JspGroupDescriptor) desc);
+ }
return myNode;
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/LocaleEncodingMappingListNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/LocaleEncodingMappingListNode.java
index ad5c2fc..da96045 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/LocaleEncodingMappingListNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/LocaleEncodingMappingListNode.java
@@ -29,8 +29,12 @@
*/
public class LocaleEncodingMappingListNode extends DeploymentDescriptorNode {
public LocaleEncodingMappingListNode() {
- super();
- registerElementHandler(new XMLElement(WebTagNames.LOCALE_ENCODING_MAPPING), LocaleEncodingMappingNode.class, "addLocaleEncodingMapping");
+ super();
+ registerElementHandler(
+ new XMLElement(WebTagNames.LOCALE_ENCODING_MAPPING),
+ LocaleEncodingMappingNode.class,
+ "addLocaleEncodingMapping"
+ );
}
protected LocaleEncodingMappingListDescriptor descriptor = null;
@@ -55,12 +59,12 @@
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, LocaleEncodingMappingListDescriptor descriptor) {
- Node myNode = appendChild(parent, nodeName);
- LocaleEncodingMappingNode lNode = new LocaleEncodingMappingNode();
- for(Enumeration en = descriptor.getLocaleEncodingMappings();
- en.hasMoreElements();) {
- lNode.writeDescriptor(myNode, WebTagNames.LOCALE_ENCODING_MAPPING, (LocaleEncodingMappingDescriptor) en.nextElement());
- }
+ Node myNode = appendChild(parent, nodeName);
+ LocaleEncodingMappingNode lNode = new LocaleEncodingMappingNode();
+ for (Enumeration en = descriptor.getLocaleEncodingMappings(); en.hasMoreElements();) {
+ lNode.writeDescriptor(
+ myNode, WebTagNames.LOCALE_ENCODING_MAPPING, (LocaleEncodingMappingDescriptor) en.nextElement());
+ }
return myNode;
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/SecurityConstraintNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/SecurityConstraintNode.java
index 246db90..a2b1115 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/SecurityConstraintNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/SecurityConstraintNode.java
@@ -25,13 +25,17 @@
import com.sun.enterprise.deployment.node.DeploymentDescriptorNode;
import com.sun.enterprise.deployment.node.XMLElement;
import com.sun.enterprise.deployment.web.WebResourceCollection;
-import org.glassfish.web.deployment.descriptor.*;
+import com.sun.enterprise.deployment.xml.TagNames;
+
+import java.util.Map;
+
+import org.glassfish.web.deployment.descriptor.AuthorizationConstraintImpl;
+import org.glassfish.web.deployment.descriptor.SecurityConstraintImpl;
+import org.glassfish.web.deployment.descriptor.UserDataConstraintImpl;
+import org.glassfish.web.deployment.descriptor.WebResourceCollectionImpl;
import org.glassfish.web.deployment.xml.WebTagNames;
import org.w3c.dom.Node;
-import java.util.Enumeration;
-import java.util.Map;
-
/**
* This node handles the security-contraint xml tag
*
@@ -42,12 +46,12 @@
public SecurityConstraintNode() {
super();
- registerElementHandler(new XMLElement(WebTagNames.USERDATA_CONSTRAINT),
- UserDataConstraintNode.class, "setUserDataConstraint");
- registerElementHandler(new XMLElement(WebTagNames.AUTH_CONSTRAINT),
- AuthConstraintNode.class, "setAuthorizationConstraint");
- registerElementHandler(new XMLElement(WebTagNames.WEB_RESOURCE_COLLECTION),
- WebResourceCollectionNode.class, "addWebResourceCollection");
+ registerElementHandler(new XMLElement(WebTagNames.USERDATA_CONSTRAINT), UserDataConstraintNode.class,
+ "setUserDataConstraint");
+ registerElementHandler(new XMLElement(WebTagNames.AUTH_CONSTRAINT), AuthConstraintNode.class,
+ "setAuthorizationConstraint");
+ registerElementHandler(new XMLElement(WebTagNames.WEB_RESOURCE_COLLECTION), WebResourceCollectionNode.class,
+ "addWebResourceCollection");
}
protected SecurityConstraintImpl descriptor = null;
@@ -74,8 +78,8 @@
@Override
protected Map<String, String> getDispatchTable() {
Map<String, String> table = super.getDispatchTable();
- table.put(WebTagNames.NAME, "setName");
- return table;
+ table.put(TagNames.NAME, "setName");
+ return table;
}
/**
@@ -89,7 +93,7 @@
@Override
public Node writeDescriptor(Node parent, String nodeName, SecurityConstraintImpl descriptor) {
Node myNode = appendChild(parent, nodeName);
- appendTextChild(myNode, WebTagNames.NAME, descriptor.getName());
+ appendTextChild(myNode, TagNames.NAME, descriptor.getName());
// web-resource-collection+
WebResourceCollectionNode wrcNode = new WebResourceCollectionNode();
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/WebCommonNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/WebCommonNode.java
index 92679fc..3ced697 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/WebCommonNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/WebCommonNode.java
@@ -53,47 +53,42 @@
registerElementHandler(new XMLElement(TagNames.EJB_LOCAL_REFERENCE), EjbLocalReferenceNode.class);
JndiEnvRefNode serviceRefNode = habitat.getService(JndiEnvRefNode.class, WebServicesTagNames.SERVICE_REF);
if (serviceRefNode != null) {
- registerElementHandler(new XMLElement(WebServicesTagNames.SERVICE_REF), serviceRefNode.getClass(),"addServiceReferenceDescriptor");
+ registerElementHandler(new XMLElement(WebServicesTagNames.SERVICE_REF), serviceRefNode.getClass(),
+ "addServiceReferenceDescriptor");
}
- registerElementHandler(new XMLElement(TagNames.RESOURCE_REFERENCE),
- ResourceRefNode.class, "addResourceReferenceDescriptor");
- registerElementHandler(new XMLElement(TagNames.RESOURCE_ENV_REFERENCE),
- ResourceEnvRefNode.class, "addResourceEnvReferenceDescriptor");
- registerElementHandler(new XMLElement(TagNames.MESSAGE_DESTINATION_REFERENCE), MessageDestinationRefNode.class, "addMessageDestinationReferenceDescriptor");
- registerElementHandler(new XMLElement(TagNames.PERSISTENCE_CONTEXT_REF), EntityManagerReferenceNode.class, "addEntityManagerReferenceDescriptor");
- registerElementHandler(new XMLElement(TagNames.PERSISTENCE_UNIT_REF), EntityManagerFactoryReferenceNode.class, "addEntityManagerFactoryReferenceDescriptor");
- registerElementHandler(new XMLElement(TagNames.ROLE),
- SecurityRoleNode.class, "addRole");
+ registerElementHandler(new XMLElement(TagNames.RESOURCE_REFERENCE), ResourceRefNode.class,
+ "addResourceReferenceDescriptor");
+ registerElementHandler(new XMLElement(TagNames.RESOURCE_ENV_REFERENCE), ResourceEnvRefNode.class,
+ "addResourceEnvReferenceDescriptor");
+ registerElementHandler(new XMLElement(TagNames.MESSAGE_DESTINATION_REFERENCE), MessageDestinationRefNode.class,
+ "addMessageDestinationReferenceDescriptor");
+ registerElementHandler(new XMLElement(TagNames.PERSISTENCE_CONTEXT_REF), EntityManagerReferenceNode.class,
+ "addEntityManagerReferenceDescriptor");
+ registerElementHandler(new XMLElement(TagNames.PERSISTENCE_UNIT_REF), EntityManagerFactoryReferenceNode.class,
+ "addEntityManagerFactoryReferenceDescriptor");
+ registerElementHandler(new XMLElement(TagNames.ROLE), SecurityRoleNode.class, "addRole");
registerElementHandler(new XMLElement(WebTagNames.SERVLET), ServletNode.class);
registerElementHandler(new XMLElement(WebTagNames.SERVLET_MAPPING), ServletMappingNode.class);
registerElementHandler(new XMLElement(WebTagNames.SESSION_CONFIG), SessionConfigNode.class);
- registerElementHandler(new XMLElement(WebTagNames.MIME_MAPPING),
- MimeMappingNode.class, "addMimeMapping");
- registerElementHandler(new XMLElement(WebTagNames.CONTEXT_PARAM),
- InitParamNode.class, "addContextParameter");
- registerElementHandler(new XMLElement(WebTagNames.SECURITY_CONSTRAINT),
- SecurityConstraintNode.class, "addSecurityConstraint");
- registerElementHandler(new XMLElement(WebTagNames.FILTER),
- FilterNode.class, "addServletFilter");
- registerElementHandler(new XMLElement(WebTagNames.FILTER_MAPPING),
- FilterMappingNode.class, "addServletFilterMapping");
- registerElementHandler(new XMLElement(WebTagNames.LISTENER),
- ListenerNode.class, "addAppListenerDescriptor");
- registerElementHandler(new XMLElement(WebTagNames.ERROR_PAGE),
- ErrorPageNode.class, "addErrorPageDescriptor");
- registerElementHandler(new XMLElement(WebTagNames.LOGIN_CONFIG),
- LoginConfigNode.class);
+ registerElementHandler(new XMLElement(WebTagNames.MIME_MAPPING), MimeMappingNode.class, "addMimeMapping");
+ registerElementHandler(new XMLElement(WebTagNames.CONTEXT_PARAM), InitParamNode.class, "addContextParameter");
+ registerElementHandler(new XMLElement(WebTagNames.SECURITY_CONSTRAINT), SecurityConstraintNode.class,
+ "addSecurityConstraint");
+ registerElementHandler(new XMLElement(WebTagNames.FILTER), FilterNode.class, "addServletFilter");
+ registerElementHandler(new XMLElement(WebTagNames.FILTER_MAPPING), FilterMappingNode.class,
+ "addServletFilterMapping");
+ registerElementHandler(new XMLElement(WebTagNames.LISTENER), ListenerNode.class, "addAppListenerDescriptor");
+ registerElementHandler(new XMLElement(WebTagNames.ERROR_PAGE), ErrorPageNode.class, "addErrorPageDescriptor");
+ registerElementHandler(new XMLElement(WebTagNames.LOGIN_CONFIG), LoginConfigNode.class);
// for backward compatibility, from Servlet 2.4 the taglib element is in jsp-config
- registerElementHandler(new XMLElement(WebTagNames.TAGLIB),
- TagLibNode.class);
- registerElementHandler(new XMLElement(WebTagNames.JSPCONFIG),
- JspConfigNode.class);
- registerElementHandler(new XMLElement(WebTagNames.LOCALE_ENCODING_MAPPING),
- LocaleEncodingMappingNode.class, "addLocaleEncodingMappingDescriptor");
- registerElementHandler(new XMLElement(TagNames.MESSAGE_DESTINATION),
- MessageDestinationNode.class,
- "addMessageDestination");
- registerElementHandler(new XMLElement(TagNames.POST_CONSTRUCT), LifecycleCallbackNode.class, "addPostConstructDescriptor");
+ registerElementHandler(new XMLElement(WebTagNames.TAGLIB), TagLibNode.class);
+ registerElementHandler(new XMLElement(WebTagNames.JSPCONFIG), JspConfigNode.class);
+ registerElementHandler(new XMLElement(WebTagNames.LOCALE_ENCODING_MAPPING), LocaleEncodingMappingNode.class,
+ "addLocaleEncodingMappingDescriptor");
+ registerElementHandler(new XMLElement(TagNames.MESSAGE_DESTINATION), MessageDestinationNode.class,
+ "addMessageDestination");
+ registerElementHandler(
+ new XMLElement(TagNames.POST_CONSTRUCT), LifecycleCallbackNode.class, "addPostConstructDescriptor");
registerElementHandler(new XMLElement(TagNames.PRE_DESTROY), LifecycleCallbackNode.class, "addPreDestroyDescriptor");
registerElementHandler(new XMLElement(TagNames.DATA_SOURCE), DataSourceDefinitionNode.class, "addResourceDescriptor");
registerElementHandler(new XMLElement(TagNames.CONNECTION_FACTORY), ConnectionFactoryDefinitionNode.class, "addResourceDescriptor");
@@ -112,8 +107,7 @@
public void addDescriptor(Object newDescriptor) {
Logger logger = DOLUtils.getDefaultLogger();
if (newDescriptor instanceof EjbReference) {
- descriptor.addEjbReferenceDescriptor(
- (EjbReference) newDescriptor);
+ descriptor.addEjbReferenceDescriptor((EjbReference) newDescriptor);
} else if (newDescriptor instanceof EnvironmentProperty) {
if (logger.isLoggable(Level.FINE)) {
logger.fine("Adding env entry" + newDescriptor);
@@ -139,8 +133,7 @@
logger.fine("Adding JSP Config Descriptor" + newDescriptor);
}
if (descriptor.getJspConfigDescriptor()!=null) {
- throw new RuntimeException(
- "Has more than one jsp-config element!");
+ throw new RuntimeException("Has more than one jsp-config element!");
}
descriptor.setJspConfigDescriptor(
(JspConfigDescriptorImpl)newDescriptor);
@@ -148,18 +141,15 @@
if (logger.isLoggable(Level.FINE)) {
logger.fine("Adding Login Config Descriptor" + newDescriptor);
}
- if (descriptor.getLoginConfiguration()!=null) {
- throw new RuntimeException(
- "Has more than one login-config element!");
+ if (descriptor.getLoginConfiguration() != null) {
+ throw new RuntimeException("Has more than one login-config element!");
}
- descriptor.setLoginConfiguration(
- (LoginConfiguration)newDescriptor);
+ descriptor.setLoginConfiguration((LoginConfiguration) newDescriptor);
} else if (newDescriptor instanceof SessionConfig) {
if (descriptor.getSessionConfig() != null) {
- throw new RuntimeException(
- "Has more than one session-config element!");
+ throw new RuntimeException("Has more than one session-config element!");
}
- descriptor.setSessionConfig((SessionConfig)newDescriptor);
+ descriptor.setSessionConfig((SessionConfig) newDescriptor);
} else {
super.addDescriptor(newDescriptor);
}
@@ -329,13 +319,11 @@
}
// jsp-config *
- JspConfigDescriptorImpl jspConf = webBundleDesc.getJspConfigDescriptor();
- if(jspConf != null) {
- JspConfigNode ln = new JspConfigNode();
- ln.writeDescriptor(jarNode,
- WebTagNames.JSPCONFIG,
- jspConf);
- }
+ JspConfigDescriptorImpl jspConf = webBundleDesc.getJspConfigDescriptor();
+ if(jspConf != null) {
+ JspConfigNode ln = new JspConfigNode();
+ ln.writeDescriptor(jarNode, WebTagNames.JSPCONFIG, jspConf);
+ }
// security-constraint*
Enumeration securityConstraints = webBundleDesc.getSecurityConstraints();
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheHelperNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheHelperNode.java
index 51f8700..dc16018 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheHelperNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheHelperNode.java
@@ -20,8 +20,10 @@
import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode;
import com.sun.enterprise.deployment.runtime.RuntimeDescriptor;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
+
import org.glassfish.web.deployment.runtime.CacheHelper;
import org.glassfish.web.deployment.runtime.WebProperty;
+import org.glassfish.web.deployment.runtime.WebPropertyContainer;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -33,9 +35,7 @@
public class CacheHelperNode extends RuntimeDescriptorNode<CacheHelper> {
public CacheHelperNode() {
-
- registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY),
- WebPropertyNode.class, "addWebProperty");
+ registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY), WebPropertyNode.class, "addWebProperty");
}
protected CacheHelper descriptor = null;
@@ -61,16 +61,16 @@
*/
@Override
protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) {
- RuntimeDescriptor descriptor = getDescriptor();
- if (attributeName.getQName().equals(RuntimeTagNames.NAME)) {
- descriptor.setAttributeValue(CacheHelper.NAME, value);
- return true;
- } else
- if (attributeName.getQName().equals(RuntimeTagNames.CLASS_NAME)) {
- descriptor.setAttributeValue(CacheHelper.CLASS_NAME, value);
- return true;
- }
- return false;
+ RuntimeDescriptor descriptor = getDescriptor();
+ if (attributeName.getQName().equals(RuntimeTagNames.NAME)) {
+ descriptor.setAttributeValue(WebPropertyContainer.NAME, value);
+ return true;
+ } else
+ if (attributeName.getQName().equals(RuntimeTagNames.CLASS_NAME)) {
+ descriptor.setAttributeValue(CacheHelper.CLASS_NAME, value);
+ return true;
+ }
+ return false;
}
/**
@@ -84,19 +84,19 @@
@Override
public Node writeDescriptor(Node parent, String nodeName, CacheHelper descriptor) {
- Element cacheHelper = (Element) super.writeDescriptor(parent, nodeName, descriptor);
+ Element cacheHelper = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- // property*
- WebProperty[] properties = descriptor.getWebProperty();
- if (properties.length>0) {
- WebPropertyNode wpn = new WebPropertyNode();
- wpn.writeDescriptor(cacheHelper, RuntimeTagNames.PROPERTY, properties);
- }
+ // property*
+ WebProperty[] properties = descriptor.getWebProperty();
+ if (properties.length>0) {
+ WebPropertyNode wpn = new WebPropertyNode();
+ wpn.writeDescriptor(cacheHelper, RuntimeTagNames.PROPERTY, properties);
+ }
- // name, class-name attribute
- setAttribute(cacheHelper, RuntimeTagNames.NAME, (String) descriptor.getAttributeValue(CacheHelper.NAME));
- setAttribute(cacheHelper, RuntimeTagNames.CLASS_NAME, (String) descriptor.getAttributeValue(CacheHelper.CLASS_NAME));
+ // name, class-name attribute
+ setAttribute(cacheHelper, RuntimeTagNames.NAME, descriptor.getAttributeValue(WebPropertyContainer.NAME));
+ setAttribute(cacheHelper, RuntimeTagNames.CLASS_NAME, descriptor.getAttributeValue(CacheHelper.CLASS_NAME));
- return cacheHelper;
+ return cacheHelper;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheMappingNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheMappingNode.java
index 23e7797..f1c4d19 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheMappingNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheMappingNode.java
@@ -35,9 +35,8 @@
public class CacheMappingNode extends RuntimeDescriptorNode<CacheMapping> {
public CacheMappingNode() {
-
- registerElementHandler(new XMLElement(RuntimeTagNames.CONSTRAINT_FIELD),
- ConstraintFieldNode.class, "addNewConstraintField");
+ registerElementHandler(new XMLElement(RuntimeTagNames.CONSTRAINT_FIELD), ConstraintFieldNode.class,
+ "addNewConstraintField");
}
protected CacheMapping descriptor = null;
@@ -61,55 +60,53 @@
*/
@Override
protected Map<String, String> getDispatchTable() {
- Map<String, String> dispatchTable = super.getDispatchTable();
- dispatchTable.put(RuntimeTagNames.SERVLET_NAME, "setServletName");
- dispatchTable.put(RuntimeTagNames.URL_PATTERN, "setURLPattern");
- dispatchTable.put(RuntimeTagNames.CACHE_HELPER_REF, "setCacheHelperRef");
- dispatchTable.put(RuntimeTagNames.TIMEOUT, "setTimeout");
- dispatchTable.put(RuntimeTagNames.HTTP_METHOD, "addNewHttpMethod");
- dispatchTable.put(RuntimeTagNames.DISPATCHER, "addNewDispatcher");
- return dispatchTable;
+ Map<String, String> dispatchTable = super.getDispatchTable();
+ dispatchTable.put(RuntimeTagNames.SERVLET_NAME, "setServletName");
+ dispatchTable.put(RuntimeTagNames.URL_PATTERN, "setURLPattern");
+ dispatchTable.put(RuntimeTagNames.CACHE_HELPER_REF, "setCacheHelperRef");
+ dispatchTable.put(RuntimeTagNames.TIMEOUT, "setTimeout");
+ dispatchTable.put(RuntimeTagNames.HTTP_METHOD, "addNewHttpMethod");
+ dispatchTable.put(RuntimeTagNames.DISPATCHER, "addNewDispatcher");
+ return dispatchTable;
}
+ @Override
public void startElement(XMLElement element, Attributes attributes) {
CacheMapping descriptor = getDescriptor();
- if (element.getQName().equals(RuntimeTagNames.TIMEOUT)) {
- for (int i=0; i<attributes.getLength();i++) {
+ if (element.getQName().equals(RuntimeTagNames.TIMEOUT)) {
+ for (int i = 0; i < attributes.getLength(); i++) {
if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME, attributes.getValue(i));
- } else
- if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
- int index=0;
- while (descriptor.getAttributeValue(CacheMapping.TIMEOUT, index, CacheMapping.NAME)!=null) {
+ descriptor.setAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME, attributes.getValue(i));
+ } else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
+ int index = 0;
+ while (descriptor.getAttributeValue(CacheMapping.TIMEOUT, index, CacheMapping.NAME) != null) {
index++;
}
- descriptor.setAttributeValue(CacheMapping.TIMEOUT, index-1, CacheMapping.SCOPE, attributes.getValue(i));
- }
- }
- } else
- if (element.getQName().equals(RuntimeTagNames.REFRESH_FIELD)) {
- descriptor.setRefreshField(true);
- for (int i=0; i<attributes.getLength();i++) {
- if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.NAME, attributes.getValue(i));
- } else
- if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.SCOPE, attributes.getValue(i));
+ descriptor.setAttributeValue(CacheMapping.TIMEOUT, index-1, CacheMapping.SCOPE, attributes.getValue(i));
}
- }
- } else
- if (element.getQName().equals(RuntimeTagNames.KEY_FIELD)) {
- descriptor.addKeyField(true);
+ }
+ } else if (element.getQName().equals(RuntimeTagNames.REFRESH_FIELD)) {
+ descriptor.setRefreshField(true);
for (int i=0; i<attributes.getLength();i++) {
if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(CacheMapping.KEY_FIELD, CacheMapping.NAME, attributes.getValue(i));
- } else
- if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.NAME, attributes.getValue(i));
+ } else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(CacheMapping.REFRESH_FIELD, 0, CacheMapping.SCOPE, attributes.getValue(i));
+ }
+ }
+ } else if (element.getQName().equals(RuntimeTagNames.KEY_FIELD)) {
+ descriptor.addKeyField(true);
+ for (int i=0; i<attributes.getLength();i++) {
+ if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(CacheMapping.KEY_FIELD, CacheMapping.NAME, attributes.getValue(i));
+ } else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
int index = descriptor.sizeKeyField();
- descriptor.setAttributeValue(CacheMapping.KEY_FIELD, index-1, CacheMapping.SCOPE, attributes.getValue(i));
+ descriptor.setAttributeValue(CacheMapping.KEY_FIELD, index-1, CacheMapping.SCOPE, attributes.getValue(i));
+ }
}
- }
- } else super.startElement(element, attributes);
+ } else {
+ super.startElement(element, attributes);
+ }
}
/**
@@ -120,28 +117,29 @@
* @param the descriptor to write
* @return the DOM tree top node
*/
+ @Override
public Node writeDescriptor(Node parent, String nodeName, CacheMapping descriptor) {
- Node cacheMapping = super.writeDescriptor(parent, nodeName, descriptor);
- if (descriptor.getServletName()!=null) {
- appendTextChild(cacheMapping, RuntimeTagNames.SERVLET_NAME, descriptor.getServletName());
- } else {
- appendTextChild(cacheMapping, RuntimeTagNames.URL_PATTERN, descriptor.getURLPattern());
- }
+ Node cacheMapping = super.writeDescriptor(parent, nodeName, descriptor);
+ if (descriptor.getServletName()!=null) {
+ appendTextChild(cacheMapping, RuntimeTagNames.SERVLET_NAME, descriptor.getServletName());
+ } else {
+ appendTextChild(cacheMapping, RuntimeTagNames.URL_PATTERN, descriptor.getURLPattern());
+ }
- // cache-helper-ref
- appendTextChild(cacheMapping, RuntimeTagNames.CACHE_HELPER_REF,
+ // cache-helper-ref
+ appendTextChild(cacheMapping, RuntimeTagNames.CACHE_HELPER_REF,
(String) descriptor.getValue(CacheMapping.CACHE_HELPER_REF));
- //dispatcher*
- String[] dispatchers = descriptor.getDispatcher();
- if (dispatchers!=null) {
- for (int i=0;i<dispatchers.length;i++) {
- appendTextChild(cacheMapping, RuntimeTagNames.DISPATCHER, dispatchers[i]);
+ //dispatcher*
+ String[] dispatchers = descriptor.getDispatcher();
+ if (dispatchers!=null) {
+ for (String dispatcher : dispatchers) {
+ appendTextChild(cacheMapping, RuntimeTagNames.DISPATCHER, dispatcher);
+ }
}
- }
- // timeout?
- Element timeout = (Element) forceAppendTextChild(cacheMapping, RuntimeTagNames.TIMEOUT,
+ // timeout?
+ Element timeout = (Element) forceAppendTextChild(cacheMapping, RuntimeTagNames.TIMEOUT,
(String) descriptor.getValue(CacheMapping.TIMEOUT));
// timeout attributes
String name = descriptor.getAttributeValue(CacheMapping.TIMEOUT, CacheMapping.NAME);
@@ -154,43 +152,43 @@
}
//refresh-field?,
- if (descriptor.isRefreshField()) {
- Element refreshField = (Element) appendChild(cacheMapping, RuntimeTagNames.REFRESH_FIELD);
- setAttribute(refreshField, RuntimeTagNames.NAME,
- (String) descriptor.getAttributeValue(CacheMapping.REFRESH_FIELD, CacheMapping.NAME));
- setAttribute(refreshField, RuntimeTagNames.SCOPE,
- (String) descriptor.getAttributeValue(CacheMapping.REFRESH_FIELD, CacheMapping.SCOPE));
- }
-
- //http-method*
- String[] httpMethods = descriptor.getHttpMethod();
- if (httpMethods!=null) {
- for (int i=0;i<httpMethods.length;i++) {
- appendTextChild(cacheMapping, RuntimeTagNames.HTTP_METHOD, httpMethods[i]);
+ if (descriptor.isRefreshField()) {
+ Element refreshField = appendChild(cacheMapping, RuntimeTagNames.REFRESH_FIELD);
+ setAttribute(refreshField, RuntimeTagNames.NAME,
+ descriptor.getAttributeValue(CacheMapping.REFRESH_FIELD, CacheMapping.NAME));
+ setAttribute(refreshField, RuntimeTagNames.SCOPE,
+ descriptor.getAttributeValue(CacheMapping.REFRESH_FIELD, CacheMapping.SCOPE));
}
- }
- //key-field*
- if (descriptor.sizeKeyField()>0) {
- for (int i=0;i<descriptor.sizeKeyField();i++) {
-
- if (descriptor.isKeyField(i)) {
- Element keyField = (Element) appendChild(cacheMapping, RuntimeTagNames.KEY_FIELD);
- setAttribute(keyField, RuntimeTagNames.NAME,
- (String) descriptor.getAttributeValue(CacheMapping.KEY_FIELD, i, CacheMapping.NAME));
- setAttribute(keyField, RuntimeTagNames.SCOPE,
- (String) descriptor.getAttributeValue(CacheMapping.KEY_FIELD, i, CacheMapping.SCOPE));
+ //http-method*
+ String[] httpMethods = descriptor.getHttpMethod();
+ if (httpMethods!=null) {
+ for (String httpMethod : httpMethods) {
+ appendTextChild(cacheMapping, RuntimeTagNames.HTTP_METHOD, httpMethod);
+ }
}
- }
- }
- //constraint-field*
- if (descriptor.sizeConstraintField()>0) {
+ //key-field*
+ if (descriptor.sizeKeyField() > 0) {
+ for (int i = 0; i < descriptor.sizeKeyField(); i++) {
+
+ if (descriptor.isKeyField(i)) {
+ Element keyField = appendChild(cacheMapping, RuntimeTagNames.KEY_FIELD);
+ setAttribute(keyField, RuntimeTagNames.NAME,
+ descriptor.getAttributeValue(CacheMapping.KEY_FIELD, i, CacheMapping.NAME));
+ setAttribute(keyField, RuntimeTagNames.SCOPE,
+ descriptor.getAttributeValue(CacheMapping.KEY_FIELD, i, CacheMapping.SCOPE));
+ }
+ }
+ }
+
+ //constraint-field*
+ if (descriptor.sizeConstraintField()>0) {
ConstraintField[] constraintFields = descriptor.getConstraintField();
ConstraintFieldNode cfn = new ConstraintFieldNode();
- cfn.writeDescriptor(cacheMapping, RuntimeTagNames.CONSTRAINT_FIELD, constraintFields);
- }
+ cfn.writeDescriptor(cacheMapping, RuntimeTagNames.CONSTRAINT_FIELD, constraintFields);
+ }
- return cacheMapping;
+ return cacheMapping;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheNode.java
index fcf8a44..ff04005 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/CacheNode.java
@@ -68,22 +68,22 @@
*/
@Override
protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) {
- RuntimeDescriptor descriptor = getDescriptor();
- if (attributeName.getQName().equals(RuntimeTagNames.MAX_ENTRIES)) {
- descriptor.setAttributeValue(Cache.MAX_ENTRIES, value);
- return true;
- } else
- if (attributeName.getQName().equals(RuntimeTagNames.TIMEOUT_IN_SECONDS)) {
- descriptor.setAttributeValue(Cache.TIMEOUT_IN_SECONDS, value);
- return true;
- } else
- if (attributeName.getQName().equals(RuntimeTagNames.ENABLED)) {
- descriptor.setAttributeValue(Cache.ENABLED, value);
- return true;
- } else
- return false;
+ RuntimeDescriptor descriptor = getDescriptor();
+ if (attributeName.getQName().equals(RuntimeTagNames.MAX_ENTRIES)) {
+ descriptor.setAttributeValue(Cache.MAX_ENTRIES, value);
+ return true;
+ } else if (attributeName.getQName().equals(RuntimeTagNames.TIMEOUT_IN_SECONDS)) {
+ descriptor.setAttributeValue(Cache.TIMEOUT_IN_SECONDS, value);
+ return true;
+ } else if (attributeName.getQName().equals(RuntimeTagNames.ENABLED)) {
+ descriptor.setAttributeValue(Cache.ENABLED, value);
+ return true;
+ } else {
+ return false;
+ }
}
+
/**
* write the descriptor class to a DOM tree and return it
*
@@ -95,43 +95,43 @@
@Override
public Node writeDescriptor(Node parent, String nodeName, Cache descriptor) {
- Element cache = (Element) super.writeDescriptor(parent, nodeName, descriptor);
+ Element cache = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- // cache-helpers*
- CacheHelper[] cacheHelpers = descriptor.getCacheHelper();
- if (cacheHelpers!=null && cacheHelpers.length>0) {
- CacheHelperNode chn = new CacheHelperNode();
- for (int i=0;i<cacheHelpers.length;i++) {
- chn.writeDescriptor(cache, RuntimeTagNames.CACHE_HELPER, cacheHelpers [i]);
+ // cache-helpers*
+ CacheHelper[] cacheHelpers = descriptor.getCacheHelper();
+ if (cacheHelpers!=null && cacheHelpers.length>0) {
+ CacheHelperNode chn = new CacheHelperNode();
+ for (int i=0;i<cacheHelpers.length;i++) {
+ chn.writeDescriptor(cache, RuntimeTagNames.CACHE_HELPER, cacheHelpers [i]);
+ }
}
- }
- WebPropertyNode wpn = new WebPropertyNode();
+ WebPropertyNode wpn = new WebPropertyNode();
- // default-helper?
- DefaultHelper dh = descriptor.getDefaultHelper();
- if (dh!=null && dh.getWebProperty()!=null) {
- Node dhn = appendChild(cache, RuntimeTagNames.DEFAULT_HELPER);
- wpn.writeDescriptor(dhn, RuntimeTagNames.PROPERTY, dh.getWebProperty());
- }
-
- // property*
- wpn.writeDescriptor(cache, RuntimeTagNames.PROPERTY, descriptor.getWebProperty());
-
- // cache-mapping
- CacheMapping[] mappings = descriptor.getCacheMapping();
- if (mappings!=null && mappings.length>0) {
- CacheMappingNode cmn = new CacheMappingNode();
- for (int i=0;i<mappings.length;i++) {
- cmn.writeDescriptor(cache, RuntimeTagNames.CACHE_MAPPING, mappings[i]);
+ // default-helper?
+ DefaultHelper dh = descriptor.getDefaultHelper();
+ if (dh!=null && dh.getWebProperty()!=null) {
+ Node dhn = appendChild(cache, RuntimeTagNames.DEFAULT_HELPER);
+ wpn.writeDescriptor(dhn, RuntimeTagNames.PROPERTY, dh.getWebProperty());
}
- }
- // max-entries, timeout-in-seconds, enabled
- setAttribute(cache, RuntimeTagNames.MAX_ENTRIES, (String) descriptor.getAttributeValue(Cache.MAX_ENTRIES));
- setAttribute(cache, RuntimeTagNames.TIMEOUT_IN_SECONDS, (String) descriptor.getAttributeValue(Cache.TIMEOUT_IN_SECONDS));
- setAttribute(cache, RuntimeTagNames.ENABLED, (String) descriptor.getAttributeValue(Cache.ENABLED));
+ // property*
+ wpn.writeDescriptor(cache, RuntimeTagNames.PROPERTY, descriptor.getWebProperty());
- return cache;
+ // cache-mapping
+ CacheMapping[] mappings = descriptor.getCacheMapping();
+ if (mappings!=null && mappings.length>0) {
+ CacheMappingNode cmn = new CacheMappingNode();
+ for (int i=0;i<mappings.length;i++) {
+ cmn.writeDescriptor(cache, RuntimeTagNames.CACHE_MAPPING, mappings[i]);
+ }
+ }
+
+ // max-entries, timeout-in-seconds, enabled
+ setAttribute(cache, RuntimeTagNames.MAX_ENTRIES, (String) descriptor.getAttributeValue(Cache.MAX_ENTRIES));
+ setAttribute(cache, RuntimeTagNames.TIMEOUT_IN_SECONDS, (String) descriptor.getAttributeValue(Cache.TIMEOUT_IN_SECONDS));
+ setAttribute(cache, RuntimeTagNames.ENABLED, (String) descriptor.getAttributeValue(Cache.ENABLED));
+
+ return cache;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ClassLoaderNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ClassLoaderNode.java
index 2d854e4..bf13da9 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ClassLoaderNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ClassLoaderNode.java
@@ -59,20 +59,20 @@
@Override
protected boolean setAttributeValue(XMLElement elementName,
XMLElement attributeName, String value) {
- RuntimeDescriptor descriptor = getDescriptor();
- if (attributeName.getQName().equals(RuntimeTagNames.EXTRA_CLASS_PATH)) {
- descriptor.setAttributeValue(ClassLoader.EXTRA_CLASS_PATH, value);
- return true;
- } else if (attributeName.getQName().equals(RuntimeTagNames.DELEGATE)) {
- descriptor.setAttributeValue(ClassLoader.DELEGATE, value);
- return true;
- } else if (attributeName.getQName().equals(
+ RuntimeDescriptor descriptor = getDescriptor();
+ if (attributeName.getQName().equals(RuntimeTagNames.EXTRA_CLASS_PATH)) {
+ descriptor.setAttributeValue(ClassLoader.EXTRA_CLASS_PATH, value);
+ return true;
+ } else if (attributeName.getQName().equals(RuntimeTagNames.DELEGATE)) {
+ descriptor.setAttributeValue(ClassLoader.DELEGATE, value);
+ return true;
+ } else if (attributeName.getQName().equals(
RuntimeTagNames.DYNAMIC_RELOAD_INTERVAL)) {
- descriptor.setAttributeValue(ClassLoader.DYNAMIC_RELOAD_INTERVAL,
+ descriptor.setAttributeValue(ClassLoader.DYNAMIC_RELOAD_INTERVAL,
value);
- return true;
- }
- return false;
+ return true;
+ }
+ return false;
}
/**
@@ -87,7 +87,7 @@
public Node writeDescriptor(Node parent, String nodeName,
ClassLoader descriptor) {
- Element classLoader = (Element) super.writeDescriptor(parent,
+ Element classLoader = (Element) super.writeDescriptor(parent,
nodeName, descriptor);
// property*
@@ -98,11 +98,11 @@
properties);
}
- // extra-class-path, delegate, dynamic-reload-interval
- setAttribute(classLoader, RuntimeTagNames.EXTRA_CLASS_PATH, (String) descriptor.getAttributeValue(ClassLoader.EXTRA_CLASS_PATH));
- setAttribute(classLoader, RuntimeTagNames.DELEGATE, (String) descriptor.getAttributeValue(ClassLoader.DELEGATE));
- setAttribute(classLoader, RuntimeTagNames.DYNAMIC_RELOAD_INTERVAL, (String) descriptor.getAttributeValue(ClassLoader.DYNAMIC_RELOAD_INTERVAL));
+ // extra-class-path, delegate, dynamic-reload-interval
+ setAttribute(classLoader, RuntimeTagNames.EXTRA_CLASS_PATH, descriptor.getAttributeValue(ClassLoader.EXTRA_CLASS_PATH));
+ setAttribute(classLoader, RuntimeTagNames.DELEGATE, descriptor.getAttributeValue(ClassLoader.DELEGATE));
+ setAttribute(classLoader, RuntimeTagNames.DYNAMIC_RELOAD_INTERVAL, descriptor.getAttributeValue(ClassLoader.DYNAMIC_RELOAD_INTERVAL));
- return classLoader;
+ return classLoader;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ConstraintFieldNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ConstraintFieldNode.java
index dcc2213..bbc207a 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ConstraintFieldNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ConstraintFieldNode.java
@@ -19,13 +19,14 @@
import com.sun.enterprise.deployment.node.XMLElement;
import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
+
+import java.util.Map;
+
import org.glassfish.web.deployment.runtime.ConstraintField;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.Attributes;
-import java.util.Map;
-
/**
* node for cache-mapping tag
*
@@ -54,11 +55,11 @@
*/
@Override
protected Map<String, String> getDispatchTable() {
- Map<String, String> dispatchTable = super.getDispatchTable();
+ Map<String, String> dispatchTable = super.getDispatchTable();
// for backward compatibility with S1AS 7 dtd
- dispatchTable.put(RuntimeTagNames.VALUE, "addValue");
+ dispatchTable.put(RuntimeTagNames.VALUE, "addValue");
dispatchTable.put(RuntimeTagNames.CONSTRAINT_FIELD_VALUE, "addValue");
- return dispatchTable;
+ return dispatchTable;
}
@Override
@@ -67,54 +68,37 @@
ConstraintField descriptor = getDescriptor();
for (int i=0; i<attributes.getLength();i++) {
if (RuntimeTagNames.NAME.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(ConstraintField.NAME,
- attributes.getValue(i));
- } else
- if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
- descriptor.setAttributeValue(ConstraintField.SCOPE,
- attributes.getValue(i));
- } else
- if (RuntimeTagNames.CACHE_ON_MATCH.equals(
- attributes.getQName(i))) {
- descriptor.setAttributeValue(
- ConstraintField.CACHE_ON_MATCH,
- attributes.getValue(i));
- } else
- if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
- attributes.getQName(i))) {
- descriptor.setAttributeValue(
- ConstraintField.CACHE_ON_MATCH_FAILURE,
- attributes.getValue(i));
+ descriptor.setAttributeValue(ConstraintField.NAME, attributes.getValue(i));
+ } else if (RuntimeTagNames.SCOPE.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.SCOPE, attributes.getValue(i));
+ } else if (RuntimeTagNames.CACHE_ON_MATCH.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.CACHE_ON_MATCH, attributes.getValue(i));
+ } else if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.CACHE_ON_MATCH_FAILURE, attributes.getValue(i));
}
}
- // From sun-web-app_2_3-0.dtd to sun-web-app_2_4-0.dtd,
- // the element name "value" is changed to "constraint-field-value",
- // need to make sure both will work
- } else if (element.getQName().equals(RuntimeTagNames.VALUE) ||
- element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD_VALUE)) {
+ // From sun-web-app_2_3-0.dtd to sun-web-app_2_4-0.dtd,
+ // the element name "value" is changed to "constraint-field-value",
+ // need to make sure both will work
+ } else if (element.getQName().equals(RuntimeTagNames.VALUE)
+ || element.getQName().equals(RuntimeTagNames.CONSTRAINT_FIELD_VALUE)) {
ConstraintField descriptor = getDescriptor();
int index = descriptor.sizeValue();
- for (int i=0; i<attributes.getLength();i++) {
- if (RuntimeTagNames.MATCH_EXPR.equals(
- attributes.getQName(i))) {
- descriptor.setAttributeValue(ConstraintField.VALUE,
- index, ConstraintField.MATCH_EXPR,
+ for (int i = 0; i < attributes.getLength(); i++) {
+ if (RuntimeTagNames.MATCH_EXPR.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.VALUE, index, ConstraintField.MATCH_EXPR,
attributes.getValue(i));
- } else
- if (RuntimeTagNames.CACHE_ON_MATCH.equals(
- attributes.getQName(i))) {
- descriptor.setAttributeValue(ConstraintField.VALUE,
- index, ConstraintField.CACHE_ON_MATCH,
+ } else if (RuntimeTagNames.CACHE_ON_MATCH.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.VALUE, index, ConstraintField.CACHE_ON_MATCH,
attributes.getValue(i));
- } else
- if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(
- attributes.getQName(i))) {
- descriptor.setAttributeValue(ConstraintField.VALUE,
- index, ConstraintField.CACHE_ON_MATCH_FAILURE,
+ } else if (RuntimeTagNames.CACHE_ON_MATCH_FAILURE.equals(attributes.getQName(i))) {
+ descriptor.setAttributeValue(ConstraintField.VALUE, index, ConstraintField.CACHE_ON_MATCH_FAILURE,
attributes.getValue(i));
}
}
- } else super.startElement(element, attributes);
+ } else {
+ super.startElement(element, attributes);
+ }
}
/**
@@ -126,9 +110,9 @@
* @return the DOM tree top node
*/
public void writeDescriptor(Node parent, String nodeName, ConstraintField[] descriptors) {
- for (int i=0;i<descriptors.length;i++) {
- writeDescriptor(parent, nodeName, descriptors[i]);
- }
+ for (int i=0;i<descriptors.length;i++) {
+ writeDescriptor(parent, nodeName, descriptors[i]);
+ }
}
/**
@@ -142,23 +126,23 @@
@Override
public Node writeDescriptor(Node parent, String nodeName, ConstraintField descriptor) {
- Element constraintField = (Element) super.writeDescriptor(parent, nodeName, descriptor);
+ Element constraintField = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- // value*
- String[] values = descriptor.getValue();
- for (int i=0;i<values.length;i++) {
- Element value = (Element) appendTextChild(constraintField, RuntimeTagNames.CONSTRAINT_FIELD_VALUE, values[i]);
- setAttribute(value, RuntimeTagNames.MATCH_EXPR, (String) descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.MATCH_EXPR));
- setAttribute(value, RuntimeTagNames.CACHE_ON_MATCH, (String) descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.CACHE_ON_MATCH));
- setAttribute(value, RuntimeTagNames.CACHE_ON_MATCH_FAILURE, (String) descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.CACHE_ON_MATCH_FAILURE));
+ // value*
+ String[] values = descriptor.getValue();
+ for (int i=0;i<values.length;i++) {
+ Element value = (Element) appendTextChild(constraintField, RuntimeTagNames.CONSTRAINT_FIELD_VALUE, values[i]);
+ setAttribute(value, RuntimeTagNames.MATCH_EXPR, descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.MATCH_EXPR));
+ setAttribute(value, RuntimeTagNames.CACHE_ON_MATCH, descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.CACHE_ON_MATCH));
+ setAttribute(value, RuntimeTagNames.CACHE_ON_MATCH_FAILURE, descriptor.getAttributeValue(ConstraintField.VALUE, i, ConstraintField.CACHE_ON_MATCH_FAILURE));
- }
- // name, scope, cache-on-match, cache-on-match-failure attributes
- setAttribute(constraintField, RuntimeTagNames.NAME, (String) descriptor.getAttributeValue(ConstraintField.NAME));
- setAttribute(constraintField, RuntimeTagNames.SCOPE, (String) descriptor.getAttributeValue(ConstraintField.SCOPE));
- setAttribute(constraintField, RuntimeTagNames.CACHE_ON_MATCH, (String) descriptor.getAttributeValue(ConstraintField.CACHE_ON_MATCH));
- setAttribute(constraintField, RuntimeTagNames.CACHE_ON_MATCH_FAILURE, (String) descriptor.getAttributeValue(ConstraintField.CACHE_ON_MATCH_FAILURE));
+ }
+ // name, scope, cache-on-match, cache-on-match-failure attributes
+ setAttribute(constraintField, RuntimeTagNames.NAME, descriptor.getAttributeValue(ConstraintField.NAME));
+ setAttribute(constraintField, RuntimeTagNames.SCOPE, descriptor.getAttributeValue(ConstraintField.SCOPE));
+ setAttribute(constraintField, RuntimeTagNames.CACHE_ON_MATCH, descriptor.getAttributeValue(ConstraintField.CACHE_ON_MATCH));
+ setAttribute(constraintField, RuntimeTagNames.CACHE_ON_MATCH_FAILURE, descriptor.getAttributeValue(ConstraintField.CACHE_ON_MATCH_FAILURE));
- return constraintField;
+ return constraintField;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetInfoNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetInfoNode.java
index 9b74e5f..179ecc4 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetInfoNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetInfoNode.java
@@ -35,9 +35,8 @@
* Initialize the child handlers
*/
public LocaleCharsetInfoNode() {
-
registerElementHandler(new XMLElement(RuntimeTagNames.LOCALE_CHARSET_MAP),
- LocaleCharsetMapNode.class, "addLocaleCharsetMap");
+ LocaleCharsetMapNode.class, "addLocaleCharsetMap");
}
protected LocaleCharsetInfo descriptor = null;
@@ -53,38 +52,35 @@
return descriptor;
}
+
@Override
public void startElement(XMLElement element, Attributes attributes) {
- if (element.getQName().equals(RuntimeTagNames.LOCALE_CHARSET_INFO)) {
- LocaleCharsetInfo info = (LocaleCharsetInfo) getDescriptor();
- for (int i=0; i<attributes.getLength();i++) {
- if (RuntimeTagNames.DEFAULT_LOCALE.equals(
- attributes.getQName(i))) {
- info.setAttributeValue(LocaleCharsetInfo.DEFAULT_LOCALE,
- attributes.getValue(i));
+ if (element.getQName().equals(RuntimeTagNames.LOCALE_CHARSET_INFO)) {
+ LocaleCharsetInfo info = getDescriptor();
+ for (int i = 0; i < attributes.getLength(); i++) {
+ if (RuntimeTagNames.DEFAULT_LOCALE.equals(attributes.getQName(i))) {
+ info.setAttributeValue(LocaleCharsetInfo.DEFAULT_LOCALE, attributes.getValue(i));
}
}
- } else if (element.getQName().equals(
- RuntimeTagNames.PARAMETER_ENCODING)) {
- LocaleCharsetInfo info = (LocaleCharsetInfo) getDescriptor();
+ } else if (element.getQName().equals(RuntimeTagNames.PARAMETER_ENCODING)) {
+ LocaleCharsetInfo info = getDescriptor();
info.setParameterEncoding(true);
- for (int i=0; i<attributes.getLength();i++) {
- if (RuntimeTagNames.DEFAULT_CHARSET.equals(
- attributes.getQName(i))) {
- info.setAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING,
- LocaleCharsetInfo.DEFAULT_CHARSET,
+ for (int i = 0; i < attributes.getLength(); i++) {
+ if (RuntimeTagNames.DEFAULT_CHARSET.equals(attributes.getQName(i))) {
+ info.setAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.DEFAULT_CHARSET,
attributes.getValue(i));
}
- if (RuntimeTagNames.FORM_HINT_FIELD.equals(
- attributes.getQName(i))) {
- info.setAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING,
- LocaleCharsetInfo.FORM_HINT_FIELD,
+ if (RuntimeTagNames.FORM_HINT_FIELD.equals(attributes.getQName(i))) {
+ info.setAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.FORM_HINT_FIELD,
attributes.getValue(i));
}
}
- } else super.startElement(element, attributes);
+ } else {
+ super.startElement(element, attributes);
+ }
}
+
/**
* write the descriptor class to a DOM tree and return it
*
@@ -95,41 +91,41 @@
*/
@Override
public Node writeDescriptor(Node parent, String nodeName, LocaleCharsetInfo descriptor) {
+ Element locale = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- Element locale = (Element) super.writeDescriptor(parent, nodeName, descriptor);
-
- // locale-charset-map+
- if (descriptor.sizeLocaleCharsetMap()>0) {
- LocaleCharsetMapNode lcmn = new LocaleCharsetMapNode();
- for (int i=0;i<descriptor.sizeLocaleCharsetMap();i++) {
- lcmn.writeDescriptor(locale, RuntimeTagNames.LOCALE_CHARSET_MAP, descriptor.getLocaleCharsetMap(i));
- }
- }
-
- // <!ELEMENT parameter-encoding EMPTY>
- //<!ATTLIST parameter-encoding form-hint-field CDATA #IMPLIED
- // default-charset CDATA #IMPLIED>
- if (descriptor.isParameterEncoding()) {
- Element parameter = (Element) appendChild(locale, RuntimeTagNames.PARAMETER_ENCODING);
-
- if (descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.FORM_HINT_FIELD)!=null) {
- setAttribute(parameter, RuntimeTagNames.FORM_HINT_FIELD,
- (String) descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.FORM_HINT_FIELD));
+ // locale-charset-map+
+ if (descriptor.sizeLocaleCharsetMap() > 0) {
+ LocaleCharsetMapNode lcmn = new LocaleCharsetMapNode();
+ for (int i = 0; i < descriptor.sizeLocaleCharsetMap(); i++) {
+ lcmn.writeDescriptor(locale, RuntimeTagNames.LOCALE_CHARSET_MAP, descriptor.getLocaleCharsetMap(i));
+ }
}
+ // <!ELEMENT parameter-encoding EMPTY>
+ // <!ATTLIST parameter-encoding form-hint-field CDATA #IMPLIED
+ // default-charset CDATA #IMPLIED>
+ if (descriptor.isParameterEncoding()) {
+ Element parameter = appendChild(locale, RuntimeTagNames.PARAMETER_ENCODING);
- if (descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.DEFAULT_CHARSET)!=null) {
- setAttribute(parameter, RuntimeTagNames.DEFAULT_CHARSET,
- (String) descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.DEFAULT_CHARSET));
+ if (descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING,
+ LocaleCharsetInfo.FORM_HINT_FIELD) != null) {
+ setAttribute(parameter, RuntimeTagNames.FORM_HINT_FIELD,
+ descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.FORM_HINT_FIELD));
+ }
+
+ if (descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING,
+ LocaleCharsetInfo.DEFAULT_CHARSET) != null) {
+ setAttribute(parameter, RuntimeTagNames.DEFAULT_CHARSET,
+ descriptor.getAttributeValue(LocaleCharsetInfo.PARAMETER_ENCODING, LocaleCharsetInfo.DEFAULT_CHARSET));
+ }
}
- }
- // default_locale
+ // default_locale
if (descriptor.getAttributeValue(LocaleCharsetInfo.DEFAULT_LOCALE) != null) {
- setAttribute(locale, RuntimeTagNames.DEFAULT_LOCALE,
- (String) descriptor.getAttributeValue(LocaleCharsetInfo.DEFAULT_LOCALE));
+ setAttribute(locale, RuntimeTagNames.DEFAULT_LOCALE,
+ descriptor.getAttributeValue(LocaleCharsetInfo.DEFAULT_LOCALE));
}
- return locale;
+ return locale;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetMapNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetMapNode.java
index 0164e07..3e52dc6 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetMapNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/LocaleCharsetMapNode.java
@@ -20,6 +20,8 @@
import com.sun.enterprise.deployment.node.XMLElement;
import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
+import com.sun.enterprise.deployment.xml.TagNames;
+
import org.glassfish.web.deployment.runtime.LocaleCharsetMap;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -37,12 +39,13 @@
*/
@Override
public LocaleCharsetMap getDescriptor() {
- if (descriptor==null) {
+ if (descriptor == null) {
descriptor = new LocaleCharsetMap();
}
return descriptor;
}
+
/**
* receives notification of the value for a particular tag
*
@@ -51,17 +54,17 @@
*/
@Override
public void setElementValue(XMLElement element, String value) {
- RuntimeDescriptor descriptor = getDescriptor();
- if (element.getQName().equals(RuntimeTagNames.LOCALE)) {
- descriptor.setAttributeValue(LocaleCharsetMap.LOCALE, value);
- } else
- if (element.getQName().equals(RuntimeTagNames.AGENT)) {
- descriptor.setAttributeValue(LocaleCharsetMap.AGENT, value);
+ RuntimeDescriptor descriptor = getDescriptor();
+ if (element.getQName().equals(RuntimeTagNames.LOCALE)) {
+ descriptor.setAttributeValue(LocaleCharsetMap.LOCALE, value);
+ } else if (element.getQName().equals(RuntimeTagNames.AGENT)) {
+ descriptor.setAttributeValue(LocaleCharsetMap.AGENT, value);
+ }
+ if (element.getQName().equals(RuntimeTagNames.CHARSET)) {
+ descriptor.setAttributeValue(LocaleCharsetMap.CHARSET, value);
+ }
}
- if (element.getQName().equals(RuntimeTagNames.CHARSET)) {
- descriptor.setAttributeValue(LocaleCharsetMap.CHARSET, value);
- }
- }
+
/**
* write the descriptor class to a DOM tree and return it
@@ -73,17 +76,16 @@
*/
@Override
public Node writeDescriptor(Node parent, String nodeName, LocaleCharsetMap descriptor) {
+ Element locale = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- Element locale = (Element) super.writeDescriptor(parent, nodeName, descriptor);
+ // description?
+ appendTextChild(locale, TagNames.DESCRIPTION, descriptor.getDescription());
- // description?
- appendTextChild(locale, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
+ // locale, agent, charset attributes
+ setAttribute(locale, RuntimeTagNames.LOCALE, descriptor.getAttributeValue(LocaleCharsetMap.LOCALE));
+ setAttribute(locale, RuntimeTagNames.AGENT, descriptor.getAttributeValue(LocaleCharsetMap.AGENT));
+ setAttribute(locale, RuntimeTagNames.CHARSET, descriptor.getAttributeValue(LocaleCharsetMap.CHARSET));
- // locale, agent, charset attributes
- setAttribute(locale, RuntimeTagNames.LOCALE, (String) descriptor.getAttributeValue(LocaleCharsetMap.LOCALE));
- setAttribute(locale, RuntimeTagNames.AGENT, (String) descriptor.getAttributeValue(LocaleCharsetMap.AGENT));
- setAttribute(locale, RuntimeTagNames.CHARSET, (String) descriptor.getAttributeValue(LocaleCharsetMap.CHARSET));
-
- return locale;
+ return locale;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionConfigNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionConfigNode.java
index 447960b..1a31f5b 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionConfigNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionConfigNode.java
@@ -63,29 +63,30 @@
* @param the descriptor to write
* @return the DOM tree top node
*/
+ @Override
public Node writeDescriptor(Node parent, String nodeName, SessionConfig descriptor) {
- Node sessionConfig = super.writeDescriptor(parent, nodeName, descriptor);
+ Node sessionConfig = super.writeDescriptor(parent, nodeName, descriptor);
- // session-manager?
- if (descriptor.getSessionManager()!=null) {
- SessionManagerNode smn = new SessionManagerNode();
- smn.writeDescriptor(sessionConfig, RuntimeTagNames.SESSION_MANAGER, descriptor.getSessionManager());
- }
+ // session-manager?
+ if (descriptor.getSessionManager()!=null) {
+ SessionManagerNode smn = new SessionManagerNode();
+ smn.writeDescriptor(sessionConfig, RuntimeTagNames.SESSION_MANAGER, descriptor.getSessionManager());
+ }
- // session-properties?
- if (descriptor.getSessionProperties()!=null) {
- WebPropertyNode wpn = new WebPropertyNode();
- Node sessionProps = appendChild(sessionConfig, RuntimeTagNames.SESSION_PROPERTIES);
- wpn.writeDescriptor(sessionProps, RuntimeTagNames.PROPERTY, descriptor.getSessionProperties().getWebProperty());
- }
+ // session-properties?
+ if (descriptor.getSessionProperties()!=null) {
+ WebPropertyNode wpn = new WebPropertyNode();
+ Node sessionProps = appendChild(sessionConfig, RuntimeTagNames.SESSION_PROPERTIES);
+ wpn.writeDescriptor(sessionProps, RuntimeTagNames.PROPERTY, descriptor.getSessionProperties().getWebProperty());
+ }
- // cookie-properties?
- if (descriptor.getCookieProperties()!=null) {
- WebPropertyNode wpn = new WebPropertyNode();
- Node cookieProps = appendChild(sessionConfig, RuntimeTagNames.COOKIE_PROPERTIES);
- wpn.writeDescriptor(cookieProps, RuntimeTagNames.PROPERTY, descriptor.getCookieProperties().getWebProperty());
- }
+ // cookie-properties?
+ if (descriptor.getCookieProperties()!=null) {
+ WebPropertyNode wpn = new WebPropertyNode();
+ Node cookieProps = appendChild(sessionConfig, RuntimeTagNames.COOKIE_PROPERTIES);
+ wpn.writeDescriptor(cookieProps, RuntimeTagNames.PROPERTY, descriptor.getCookieProperties().getWebProperty());
+ }
- return sessionConfig;
+ return sessionConfig;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionManagerNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionManagerNode.java
index 74205dd..28945c3 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionManagerNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/SessionManagerNode.java
@@ -62,10 +62,10 @@
*/
@Override
public void setElementValue(XMLElement element, String value) {
- RuntimeDescriptor descriptor = getDescriptor();
- if (element.getQName().equals(RuntimeTagNames.PERSISTENCE_TYPE)) {
- descriptor.setAttributeValue(SessionManager.PERSISTENCE_TYPE, value);
- }
+ RuntimeDescriptor descriptor = getDescriptor();
+ if (element.getQName().equals(RuntimeTagNames.PERSISTENCE_TYPE)) {
+ descriptor.setAttributeValue(SessionManager.PERSISTENCE_TYPE, value);
+ }
}
/**
@@ -78,27 +78,27 @@
*/
@Override
public Node writeDescriptor(Node parent, String nodeName, SessionManager descriptor) {
+ Element sessionMgr = (Element) super.writeDescriptor(parent, nodeName, descriptor);
- Element sessionMgr = (Element) super.writeDescriptor(parent, nodeName, descriptor);
+ // manager-properties?
+ if (descriptor.getManagerProperties() != null) {
+ WebPropertyNode wpn = new WebPropertyNode();
+ Node mgrProps = appendChild(sessionMgr, RuntimeTagNames.MANAGER_PROPERTIES);
+ wpn.writeDescriptor(mgrProps, RuntimeTagNames.PROPERTY, descriptor.getManagerProperties().getWebProperty());
+ }
- // manager-properties?
- if (descriptor.getManagerProperties()!=null) {
- WebPropertyNode wpn = new WebPropertyNode();
- Node mgrProps = appendChild(sessionMgr, RuntimeTagNames.MANAGER_PROPERTIES);
- wpn.writeDescriptor(mgrProps, RuntimeTagNames.PROPERTY, descriptor.getManagerProperties().getWebProperty());
- }
+ // store-properties?
+ if (descriptor.getStoreProperties() != null) {
+ WebPropertyNode wpn = new WebPropertyNode();
+ Node storeProps = appendChild(sessionMgr, RuntimeTagNames.STORE_PROPERTIES);
+ wpn.writeDescriptor(storeProps, RuntimeTagNames.PROPERTY, descriptor.getStoreProperties().getWebProperty());
+ }
- // store-properties?
- if (descriptor.getStoreProperties()!=null) {
- WebPropertyNode wpn = new WebPropertyNode();
- Node storeProps = appendChild(sessionMgr, RuntimeTagNames.STORE_PROPERTIES);
- wpn.writeDescriptor(storeProps, RuntimeTagNames.PROPERTY, descriptor.getStoreProperties().getWebProperty());
- }
+ // persistence-type?
+ setAttribute(sessionMgr, RuntimeTagNames.PERSISTENCE_TYPE,
+ descriptor.getAttributeValue(SessionManager.PERSISTENCE_TYPE));
- // persistence-type?
- setAttribute(sessionMgr, RuntimeTagNames.PERSISTENCE_TYPE, (String) descriptor.getAttributeValue(SessionManager.PERSISTENCE_TYPE));
-
- return sessionMgr;
+ return sessionMgr;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ValveNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ValveNode.java
index 7669daa..e9fd4af 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ValveNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/ValveNode.java
@@ -86,10 +86,8 @@
descriptor.getWebProperty());
// attributes classname and name
- setAttribute(valve, RuntimeTagNames.NAME,
- (String) descriptor.getAttributeValue(Valve.NAME));
- setAttribute(valve, RuntimeTagNames.CLASS_NAME,
- (String) descriptor.getAttributeValue(Valve.CLASS_NAME));
+ setAttribute(valve, RuntimeTagNames.NAME, descriptor.getAttributeValue(Valve.NAME));
+ setAttribute(valve, RuntimeTagNames.CLASS_NAME, descriptor.getAttributeValue(Valve.CLASS_NAME));
return valve;
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebBundleRuntimeNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebBundleRuntimeNode.java
index d81e2d5..1249481 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebBundleRuntimeNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebBundleRuntimeNode.java
@@ -16,35 +16,54 @@
package org.glassfish.web.deployment.node.runtime.gf;
-import com.sun.enterprise.deployment.*;
+import com.sun.enterprise.deployment.Application;
+import com.sun.enterprise.deployment.ResourceEnvReferenceDescriptor;
+import com.sun.enterprise.deployment.ResourceReferenceDescriptor;
+import com.sun.enterprise.deployment.ServiceReferenceDescriptor;
+import com.sun.enterprise.deployment.WebComponentDescriptor;
import com.sun.enterprise.deployment.node.XMLElement;
-import com.sun.enterprise.deployment.node.runtime.*;
import com.sun.enterprise.deployment.node.runtime.EjbRefNode;
+import com.sun.enterprise.deployment.node.runtime.MessageDestinationRefNode;
+import com.sun.enterprise.deployment.node.runtime.MessageDestinationRuntimeNode;
import com.sun.enterprise.deployment.node.runtime.ResourceEnvRefNode;
import com.sun.enterprise.deployment.node.runtime.ResourceRefNode;
+import com.sun.enterprise.deployment.node.runtime.RuntimeBundleNode;
+import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode;
+import com.sun.enterprise.deployment.node.runtime.ServiceRefNode;
+import com.sun.enterprise.deployment.node.runtime.WebServiceRuntimeNode;
import com.sun.enterprise.deployment.node.runtime.common.SecurityRoleMappingNode;
-import com.sun.enterprise.deployment.runtime.common.*;
-import com.sun.enterprise.deployment.runtime.web.*;
+import com.sun.enterprise.deployment.runtime.common.PrincipalNameDescriptor;
+import com.sun.enterprise.deployment.runtime.common.SecurityRoleMapping;
+import com.sun.enterprise.deployment.runtime.web.IdempotentUrlPattern;
+import com.sun.enterprise.deployment.runtime.web.SunWebApp;
import com.sun.enterprise.deployment.types.EjbReference;
import com.sun.enterprise.deployment.xml.DTDRegistry;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
import com.sun.enterprise.deployment.xml.WebServicesTagNames;
-import org.glassfish.deployment.common.SecurityRoleMapper;
-import org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl;
-import org.glassfish.web.deployment.node.WebBundleNode;
-import org.glassfish.web.deployment.runtime.ClassLoader;
-import org.glassfish.web.deployment.runtime.*;
-import org.glassfish.security.common.Group;
-import org.glassfish.security.common.Role;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.Attributes;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.glassfish.deployment.common.SecurityRoleMapper;
+import org.glassfish.security.common.Group;
+import org.glassfish.security.common.Role;
+import org.glassfish.web.deployment.descriptor.WebBundleDescriptorImpl;
+import org.glassfish.web.deployment.node.WebBundleNode;
+import org.glassfish.web.deployment.runtime.Cache;
+import org.glassfish.web.deployment.runtime.ClassLoader;
+import org.glassfish.web.deployment.runtime.JspConfig;
+import org.glassfish.web.deployment.runtime.LocaleCharsetInfo;
+import org.glassfish.web.deployment.runtime.Servlet;
+import org.glassfish.web.deployment.runtime.SessionConfig;
+import org.glassfish.web.deployment.runtime.SunWebAppImpl;
+import org.glassfish.web.deployment.runtime.Valve;
+import org.glassfish.web.deployment.runtime.WebProperty;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+
/**
* This node is responsible for handling all runtime information for
@@ -77,49 +96,35 @@
// we do not care about our standard DDS handles
handlers = null;
- registerElementHandler(new XMLElement(RuntimeTagNames.SECURITY_ROLE_MAPPING),
- SecurityRoleMappingNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.SERVLET),
- org.glassfish.web.deployment.node.runtime.gf.ServletNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.IDEMPOTENT_URL_PATTERN), IdempotentUrlPatternNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_CONFIG),
- SessionConfigNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_ENV_REFERENCE),
- ResourceEnvRefNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE),
- MessageDestinationRefNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.SECURITY_ROLE_MAPPING), SecurityRoleMappingNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.SERVLET),
+ org.glassfish.web.deployment.node.runtime.gf.ServletNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.IDEMPOTENT_URL_PATTERN), IdempotentUrlPatternNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.SESSION_CONFIG), SessionConfigNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_ENV_REFERENCE), ResourceEnvRefNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION_REFERENCE), MessageDestinationRefNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_REFERENCE),
- ResourceRefNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.EJB_REFERENCE),
- EjbRefNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.RESOURCE_REFERENCE), ResourceRefNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.EJB_REFERENCE), EjbRefNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.CACHE),
- CacheNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.CACHE), CacheNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.CLASS_LOADER),
- ClassLoaderNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.CLASS_LOADER), ClassLoaderNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.JSP_CONFIG),
- JspConfigRuntimeNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.JSP_CONFIG), JspConfigRuntimeNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.LOCALE_CHARSET_INFO),
- LocaleCharsetInfoNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.LOCALE_CHARSET_INFO), LocaleCharsetInfoNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY),
- WebPropertyNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.PROPERTY), WebPropertyNode.class);
- registerElementHandler(new XMLElement(WebServicesTagNames.SERVICE_REF),
- ServiceRefNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION),
- MessageDestinationRuntimeNode.class);
- registerElementHandler(new XMLElement(WebServicesTagNames.WEB_SERVICE),
- WebServiceRuntimeNode.class);
- registerElementHandler(new XMLElement(RuntimeTagNames.VALVE),
- ValveNode.class);
+ registerElementHandler(new XMLElement(WebServicesTagNames.SERVICE_REF), ServiceRefNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.MESSAGE_DESTINATION), MessageDestinationRuntimeNode.class);
+ registerElementHandler(new XMLElement(WebServicesTagNames.WEB_SERVICE), WebServiceRuntimeNode.class);
+ registerElementHandler(new XMLElement(RuntimeTagNames.VALVE), ValveNode.class);
}
+
/**
* @return the XML tag associated with this XMLNode
*/
@@ -157,8 +162,7 @@
* to the latest schema
* @return the doctype tag name
*/
- public static String registerBundle(Map<String, String> publicIDToDTD,
- Map<String, List<Class>> versionUpgrades) {
+ public static String registerBundle(Map<String, String> publicIDToDTD, Map<String, List<Class>> versionUpgrades) {
publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_230_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_230_DTD_SYSTEM_ID);
publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_231_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_231_DTD_SYSTEM_ID);
publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_240_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_240_DTD_SYSTEM_ID);
@@ -166,7 +170,7 @@
publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_250_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_250_DTD_SYSTEM_ID);
publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_300_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_300_DTD_SYSTEM_ID);
if (!restrictDTDDeclarations()) {
- publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_240beta_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_240beta_DTD_SYSTEM_ID);
+ publicIDToDTD.put(DTDRegistry.SUN_WEBAPP_240beta_DTD_PUBLIC_ID, DTDRegistry.SUN_WEBAPP_240beta_DTD_SYSTEM_ID);
}
return RuntimeTagNames.S1AS_WEB_RUNTIME_TAG;
@@ -187,67 +191,55 @@
*/
@Override
public void addDescriptor(Object newDescriptor) {
-
SunWebAppImpl sunWebApp = (SunWebAppImpl) descriptor.getSunDescriptor();
- if (newDescriptor instanceof WebComponentDescriptor) {
- WebComponentDescriptor servlet = (WebComponentDescriptor) newDescriptor;
+ if (newDescriptor instanceof WebComponentDescriptor) {
+ WebComponentDescriptor servlet = (WebComponentDescriptor) newDescriptor;
// for backward compatibility with s1as schema2beans generated desc
Servlet s1descriptor = new Servlet();
s1descriptor.setServletName(servlet.getCanonicalName());
- if (servlet.getRunAsIdentity()!=null) {
+ if (servlet.getRunAsIdentity() != null) {
s1descriptor.setPrincipalName(servlet.getRunAsIdentity().getPrincipal());
}
- sunWebApp.addServlet(s1descriptor);
+ sunWebApp.addServlet(s1descriptor);
} else
if (newDescriptor instanceof ServiceReferenceDescriptor) {
descriptor.addServiceReferenceDescriptor((ServiceReferenceDescriptor) newDescriptor);
- } else
- if (newDescriptor instanceof SecurityRoleMapping) {
+ } else if (newDescriptor instanceof SecurityRoleMapping) {
SecurityRoleMapping srm = (SecurityRoleMapping) newDescriptor;
sunWebApp.addSecurityRoleMapping(srm);
// store it in the application using pure DOL descriptors...
Application app = descriptor.getApplication();
- if (app!=null) {
+ if (app != null) {
Role role = new Role(srm.getRoleName());
SecurityRoleMapper rm = app.getRoleMapper();
if (rm != null) {
List<PrincipalNameDescriptor> principals = srm.getPrincipalNames();
for (int i = 0; i < principals.size(); i++) {
- rm.assignRole(principals.get(i).getPrincipal(),
- role, descriptor);
+ rm.assignRole(principals.get(i).getPrincipal(), role, descriptor);
}
List<String> groups = srm.getGroupNames();
for (int i = 0; i < groups.size(); i++) {
- rm.assignRole(new Group(groups.get(i)),
- role, descriptor);
+ rm.assignRole(new Group(groups.get(i)), role, descriptor);
}
}
}
} else if (newDescriptor instanceof IdempotentUrlPattern) {
- sunWebApp.addIdempotentUrlPattern(
- (IdempotentUrlPattern) newDescriptor);
+ sunWebApp.addIdempotentUrlPattern((IdempotentUrlPattern) newDescriptor);
} else if (newDescriptor instanceof SessionConfig) {
- sunWebApp.setSessionConfig(
- (SessionConfig) newDescriptor);
+ sunWebApp.setSessionConfig((SessionConfig) newDescriptor);
} else if (newDescriptor instanceof Cache) {
- sunWebApp.setCache(
- (Cache) newDescriptor);
+ sunWebApp.setCache((Cache) newDescriptor);
} else if (newDescriptor instanceof ClassLoader) {
- sunWebApp.setClassLoader(
- (ClassLoader) newDescriptor);
+ sunWebApp.setClassLoader((ClassLoader) newDescriptor);
} else if (newDescriptor instanceof JspConfig) {
- sunWebApp.setJspConfig(
- (JspConfig) newDescriptor);
+ sunWebApp.setJspConfig((JspConfig) newDescriptor);
} else if (newDescriptor instanceof LocaleCharsetInfo) {
- sunWebApp.setLocaleCharsetInfo(
- (LocaleCharsetInfo) newDescriptor);
+ sunWebApp.setLocaleCharsetInfo((LocaleCharsetInfo) newDescriptor);
} else if (newDescriptor instanceof WebProperty) {
- sunWebApp.addWebProperty(
- (WebProperty) newDescriptor);
+ sunWebApp.addWebProperty((WebProperty) newDescriptor);
} else if (newDescriptor instanceof Valve) {
- sunWebApp.addValve(
- (Valve) newDescriptor);
+ sunWebApp.addValve((Valve) newDescriptor);
}
else super.addDescriptor(descriptor);
}
@@ -314,8 +306,9 @@
} else if (element.getQName().equals(RuntimeTagNames.KEEP_STATE)) {
descriptor.setKeepState(value);
} else if (element.getQName().equals(RuntimeTagNames.VERSION_IDENTIFIER)) {
- } else
+ } else {
super.setElementValue(element, value);
+ }
}
/**
@@ -331,22 +324,22 @@
SunWebAppImpl sunWebApp = (SunWebAppImpl) bundleDescriptor.getSunDescriptor();
// context-root?
- appendTextChild(web, RuntimeTagNames.CONTEXT_ROOT, bundleDescriptor.getContextRoot());
- // security-role-mapping
- SecurityRoleMapping[] roleMappings = sunWebApp.getSecurityRoleMapping();
- if (roleMappings!=null && roleMappings.length>0) {
- SecurityRoleMappingNode srmn = new SecurityRoleMappingNode();
- for (int i=0;i<roleMappings.length;i++) {
- srmn.writeDescriptor(web, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings[i]);
+ appendTextChild(web, RuntimeTagNames.CONTEXT_ROOT, bundleDescriptor.getContextRoot());
+ // security-role-mapping
+ SecurityRoleMapping[] roleMappings = sunWebApp.getSecurityRoleMapping();
+ if (roleMappings!=null && roleMappings.length>0) {
+ SecurityRoleMappingNode srmn = new SecurityRoleMappingNode();
+ for (int i=0;i<roleMappings.length;i++) {
+ srmn.writeDescriptor(web, RuntimeTagNames.SECURITY_ROLE_MAPPING, roleMappings[i]);
+ }
}
- }
// servlet
Set servlets = bundleDescriptor.getServletDescriptors();
org.glassfish.web.deployment.node.runtime.gf.ServletNode servletNode =
- new org.glassfish.web.deployment.node.runtime.gf.ServletNode();
+ new org.glassfish.web.deployment.node.runtime.gf.ServletNode();
for (Iterator itr=servlets.iterator();itr.hasNext();) {
- WebComponentDescriptor servlet = (WebComponentDescriptor) itr.next();
+ WebComponentDescriptor servlet = (WebComponentDescriptor) itr.next();
servletNode.writeDescriptor(web, RuntimeTagNames.SERVLET, servlet);
}
@@ -359,81 +352,80 @@
}
}
- // session-config?
- if (sunWebApp.getSessionConfig()!=null) {
- SessionConfigNode scn = new SessionConfigNode();
- scn.writeDescriptor(web, RuntimeTagNames.SESSION_CONFIG, sunWebApp.getSessionConfig());
- }
-
- // ejb-ref*
- Set<EjbReference> ejbRefs = bundleDescriptor.getEjbReferenceDescriptors();
- if (ejbRefs.size()>0) {
- EjbRefNode node = new EjbRefNode();
- for (EjbReference ejbRef : ejbRefs) {
- node.writeDescriptor(web, RuntimeTagNames.EJB_REF, ejbRef);
+ // session-config?
+ if (sunWebApp.getSessionConfig()!=null) {
+ SessionConfigNode scn = new SessionConfigNode();
+ scn.writeDescriptor(web, RuntimeTagNames.SESSION_CONFIG, sunWebApp.getSessionConfig());
}
- }
- // resource-ref*
- Set<ResourceReferenceDescriptor> resourceRefs = bundleDescriptor.getResourceReferenceDescriptors();
- if (resourceRefs.size()>0) {
- ResourceRefNode node = new ResourceRefNode();
- for (ResourceReferenceDescriptor resourceRef : resourceRefs) {
- node.writeDescriptor(web, RuntimeTagNames.RESOURCE_REF, resourceRef);
+ // ejb-ref*
+ Set<EjbReference> ejbRefs = bundleDescriptor.getEjbReferenceDescriptors();
+ if (ejbRefs.size()>0) {
+ EjbRefNode node = new EjbRefNode();
+ for (EjbReference ejbRef : ejbRefs) {
+ node.writeDescriptor(web, RuntimeTagNames.EJB_REF, ejbRef);
+ }
}
- }
- // resource-env-ref*
- Set<ResourceEnvReferenceDescriptor> resourceEnvRefs = bundleDescriptor.getResourceEnvReferenceDescriptors();
- if (resourceEnvRefs.size()>0) {
- ResourceEnvRefNode node = new ResourceEnvRefNode();
- for (ResourceEnvReferenceDescriptor resourceEnvRef : resourceEnvRefs) {
- node.writeDescriptor(web, RuntimeTagNames.RESOURCE_ENV_REF, resourceEnvRef);
+ // resource-ref*
+ Set<ResourceReferenceDescriptor> resourceRefs = bundleDescriptor.getResourceReferenceDescriptors();
+ if (resourceRefs.size()>0) {
+ ResourceRefNode node = new ResourceRefNode();
+ for (ResourceReferenceDescriptor resourceRef : resourceRefs) {
+ node.writeDescriptor(web, RuntimeTagNames.RESOURCE_REF, resourceRef);
+ }
}
- }
- // service-ref*
- if (bundleDescriptor.hasServiceReferenceDescriptors()) {
- ServiceRefNode serviceNode = new ServiceRefNode();
- for (Iterator serviceItr=bundleDescriptor.getServiceReferenceDescriptors().iterator();
+ // resource-env-ref*
+ Set<ResourceEnvReferenceDescriptor> resourceEnvRefs = bundleDescriptor.getResourceEnvReferenceDescriptors();
+ if (resourceEnvRefs.size()>0) {
+ ResourceEnvRefNode node = new ResourceEnvRefNode();
+ for (ResourceEnvReferenceDescriptor resourceEnvRef : resourceEnvRefs) {
+ node.writeDescriptor(web, RuntimeTagNames.RESOURCE_ENV_REF, resourceEnvRef);
+ }
+ }
+
+ // service-ref*
+ if (bundleDescriptor.hasServiceReferenceDescriptors()) {
+ ServiceRefNode serviceNode = new ServiceRefNode();
+ for (Iterator serviceItr=bundleDescriptor.getServiceReferenceDescriptors().iterator();
serviceItr.hasNext();) {
- ServiceReferenceDescriptor next = (ServiceReferenceDescriptor) serviceItr.next();
- serviceNode.writeDescriptor(web, WebServicesTagNames.SERVICE_REF, next);
+ ServiceReferenceDescriptor next = (ServiceReferenceDescriptor) serviceItr.next();
+ serviceNode.writeDescriptor(web, WebServicesTagNames.SERVICE_REF, next);
+ }
}
- }
// message-destination-ref*
MessageDestinationRefNode.writeMessageDestinationReferences(web,
bundleDescriptor);
- // cache?
- Cache cache = sunWebApp.getCache();
- if (cache!=null) {
- CacheNode cn = new CacheNode();
- cn.writeDescriptor(web, RuntimeTagNames.CACHE, cache);
- }
+ // cache?
+ Cache cache = sunWebApp.getCache();
+ if (cache!=null) {
+ CacheNode cn = new CacheNode();
+ cn.writeDescriptor(web, RuntimeTagNames.CACHE, cache);
+ }
- // class-loader?
+ // class-loader?
ClassLoader classLoader = sunWebApp.getClassLoader();
if (classLoader!=null) {
ClassLoaderNode cln = new ClassLoaderNode();
cln.writeDescriptor(web, RuntimeTagNames.CLASS_LOADER, classLoader);
}
- // jsp-config?
- if (sunWebApp.getJspConfig()!=null) {
- WebPropertyNode propertyNode = new WebPropertyNode();
- Node jspConfig = appendChild(web, RuntimeTagNames.JSP_CONFIG);
- propertyNode.writeDescriptor(jspConfig, RuntimeTagNames.PROPERTY, sunWebApp.getJspConfig().getWebProperty());
- }
+ // jsp-config?
+ if (sunWebApp.getJspConfig()!=null) {
+ WebPropertyNode propertyNode = new WebPropertyNode();
+ Node jspConfig = appendChild(web, RuntimeTagNames.JSP_CONFIG);
+ propertyNode.writeDescriptor(jspConfig, RuntimeTagNames.PROPERTY, sunWebApp.getJspConfig().getWebProperty());
+ }
- // locale-charset-info?
- if (sunWebApp.getLocaleCharsetInfo()!=null) {
- LocaleCharsetInfoNode localeNode = new LocaleCharsetInfoNode();
- localeNode.writeDescriptor(web, RuntimeTagNames.LOCALE_CHARSET_INFO,
- sunWebApp.getLocaleCharsetInfo());
- }
+ // locale-charset-info?
+ if (sunWebApp.getLocaleCharsetInfo()!=null) {
+ LocaleCharsetInfoNode localeNode = new LocaleCharsetInfoNode();
+ localeNode.writeDescriptor(web, RuntimeTagNames.LOCALE_CHARSET_INFO, sunWebApp.getLocaleCharsetInfo());
+ }
// parameter-encoding?
if (sunWebApp.isParameterEncoding()) {
@@ -441,12 +433,12 @@
if (sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD)!=null) {
setAttribute(parameter, RuntimeTagNames.FORM_HINT_FIELD,
- sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD));
+ sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.FORM_HINT_FIELD));
}
if (sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET)!=null) {
setAttribute(parameter, RuntimeTagNames.DEFAULT_CHARSET,
- sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET));
+ sunWebApp.getAttributeValue(SunWebApp.PARAMETER_ENCODING, SunWebApp.DEFAULT_CHARSET));
}
}
@@ -457,14 +449,13 @@
// valve*
if (sunWebApp.getValve()!=null) {
ValveNode valve = new ValveNode();
- valve.writeDescriptor(web, RuntimeTagNames.VALVE,
- sunWebApp.getValve());
+ valve.writeDescriptor(web, RuntimeTagNames.VALVE, sunWebApp.getValve());
}
- // message-destination*
+ // message-destination*
RuntimeDescriptorNode.writeMessageDestinationInfo(web, bundleDescriptor);
- // webservice-description*
+ // webservice-description*
WebServiceRuntimeNode webServiceNode = new WebServiceRuntimeNode();
webServiceNode.writeWebServiceRuntimeInfo(web, bundleDescriptor);
@@ -476,7 +467,7 @@
// httpservlet-security-provider
if (sunWebApp.getAttributeValue(SunWebApp.HTTPSERVLET_SECURITY_PROVIDER) != null) {
setAttribute(web, RuntimeTagNames.HTTPSERVLET_SECURITY_PROVIDER,
- sunWebApp.getAttributeValue(SunWebApp.HTTPSERVLET_SECURITY_PROVIDER));
+ sunWebApp.getAttributeValue(SunWebApp.HTTPSERVLET_SECURITY_PROVIDER));
}
// keep-state
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebPropertyNode.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebPropertyNode.java
index 3bf4efe..9aae5f9 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebPropertyNode.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/node/runtime/gf/WebPropertyNode.java
@@ -20,6 +20,8 @@
import com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode;
import com.sun.enterprise.deployment.runtime.RuntimeDescriptor;
import com.sun.enterprise.deployment.xml.RuntimeTagNames;
+import com.sun.enterprise.deployment.xml.TagNames;
+
import org.glassfish.web.deployment.runtime.WebProperty;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -55,8 +57,7 @@
*/
@Override
protected boolean setAttributeValue(XMLElement elementName, XMLElement attributeName, String value) {
- RuntimeDescriptor descriptor =
- (RuntimeDescriptor) getDescriptor();
+ RuntimeDescriptor descriptor = getDescriptor();
if (attributeName.getQName().equals(RuntimeTagNames.NAME)) {
descriptor.setAttributeValue(WebProperty.NAME, value);
return true;
@@ -78,17 +79,17 @@
@Override
public Node writeDescriptor(Node parent, String nodeName,
WebProperty property) {
- Element propertyElement =
- (Element) super.writeDescriptor(parent, nodeName, property);
+ Element propertyElement = (Element) super.writeDescriptor(parent, nodeName, property);
// description?
- appendTextChild(propertyElement, RuntimeTagNames.DESCRIPTION, property.getDescription());
+ appendTextChild(propertyElement, TagNames.DESCRIPTION, property.getDescription());
- setAttribute(propertyElement, RuntimeTagNames.NAME, (String) property.getAttributeValue(WebProperty.NAME));
- setAttribute(propertyElement, RuntimeTagNames.VALUE, (String) property.getAttributeValue(WebProperty.VALUE));
+ setAttribute(propertyElement, RuntimeTagNames.NAME, property.getAttributeValue(WebProperty.NAME));
+ setAttribute(propertyElement, RuntimeTagNames.VALUE, property.getAttributeValue(WebProperty.VALUE));
return propertyElement;
}
+
/**
* write the descriptor class to a DOM tree and return it
*
@@ -97,11 +98,11 @@
* @param the array of descriptors to write
*/
public void writeDescriptor(Node parent, String nodeName, WebProperty[] properties) {
- if (properties==null)
- return;
- for (int i=0;i<properties.length;i++) {
- writeDescriptor(parent, nodeName, properties[i]);
- }
+ if (properties == null) {
+ return;
+ }
+ for (int i = 0; i < properties.length; i++) {
+ writeDescriptor(parent, nodeName, properties[i]);
+ }
}
}
-
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Cache.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Cache.java
index 9a530d4..98d70b5 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Cache.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Cache.java
@@ -17,14 +17,13 @@
package org.glassfish.web.deployment.runtime;
/**
-* this class contains runtime information for the web bundle
-* it was kept to be backward compatible with the schema2beans descriptors
-* generated by iAS 7.0 engineering team.
-*
-* @author Jerome Dochez
-*/
-public class Cache extends WebPropertyContainer
-{
+ * this class contains runtime information for the web bundle
+ * it was kept to be backward compatible with the schema2beans descriptors
+ * generated by iAS 7.0 engineering team.
+ *
+ * @author Jerome Dochez
+ */
+public class Cache extends WebPropertyContainer {
static public final String CACHE_HELPER = "CacheHelper"; // NOI18N
static public final String DEFAULT_HELPER = "DefaultHelper"; // NOI18N
@@ -35,130 +34,130 @@
static public final String ENABLED = "Enabled";
public Cache() {
-
// set default values
- setAttributeValue("MaxEntries", "4096");
- setAttributeValue("TimeoutInSeconds", "30");
+ setAttributeValue("MaxEntries", "4096");
+ setAttributeValue("TimeoutInSeconds", "30");
}
+
// This attribute is an array, possibly empty
- public void setCacheHelper(int index, CacheHelper value)
- {
- setValue(CACHE_HELPER, index, value);
+ public void setCacheHelper(int index, CacheHelper value) {
+ setValue(CACHE_HELPER, index, value);
}
+
//
- public CacheHelper getCacheHelper(int index)
- {
- return (CacheHelper)getValue(CACHE_HELPER, index);
+ public CacheHelper getCacheHelper(int index) {
+ return (CacheHelper) getValue(CACHE_HELPER, index);
}
+
// This attribute is an array, possibly empty
- public void setCacheHelper(CacheHelper[] value)
- {
- setValue(CACHE_HELPER, value);
+ public void setCacheHelper(CacheHelper[] value) {
+ setValue(CACHE_HELPER, value);
}
+
//
- public CacheHelper[] getCacheHelper()
- {
- return (CacheHelper[])getValues(CACHE_HELPER);
+ public CacheHelper[] getCacheHelper() {
+ return (CacheHelper[]) getValues(CACHE_HELPER);
}
+
// Return the number of properties
- public int sizeCacheHelper()
- {
- return size(CACHE_HELPER);
+ public int sizeCacheHelper() {
+ return size(CACHE_HELPER);
}
- // Add a new element returning its index in the list
- public int addCacheHelper(CacheHelper value)
- {
- return addValue(CACHE_HELPER, value);
- }
// Add a new element returning its index in the list
- public void addNewCacheHelper(CacheHelper value)
- {
- addCacheHelper(value);
+ public int addCacheHelper(CacheHelper value) {
+ return addValue(CACHE_HELPER, value);
}
+
+ // Add a new element returning its index in the list
+ public void addNewCacheHelper(CacheHelper value) {
+ addCacheHelper(value);
+ }
+
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeCacheHelper(CacheHelper value)
- {
- return removeValue(CACHE_HELPER, value);
+ public int removeCacheHelper(CacheHelper value) {
+ return removeValue(CACHE_HELPER, value);
}
+
// This attribute is optional
- public void setDefaultHelper(DefaultHelper value)
- {
- setValue(DEFAULT_HELPER, value);
+ public void setDefaultHelper(DefaultHelper value) {
+ setValue(DEFAULT_HELPER, value);
}
+
//
- public DefaultHelper getDefaultHelper()
- {
- return (DefaultHelper)getValue(DEFAULT_HELPER);
+ public DefaultHelper getDefaultHelper() {
+ return (DefaultHelper) getValue(DEFAULT_HELPER);
}
+
// This attribute is an array, possibly empty
- public void setCacheMapping(int index, CacheMapping value)
- {
- setValue(CACHE_MAPPING, index, value);
+ public void setCacheMapping(int index, CacheMapping value) {
+ setValue(CACHE_MAPPING, index, value);
}
+
//
- public CacheMapping getCacheMapping(int index)
- {
- return (CacheMapping)getValue(CACHE_MAPPING, index);
+ public CacheMapping getCacheMapping(int index) {
+ return (CacheMapping) getValue(CACHE_MAPPING, index);
}
+
// This attribute is an array, possibly empty
- public void setCacheMapping(CacheMapping[] value)
- {
- setValue(CACHE_MAPPING, value);
+ public void setCacheMapping(CacheMapping[] value) {
+ setValue(CACHE_MAPPING, value);
}
+
//
- public CacheMapping[] getCacheMapping()
- {
- return (CacheMapping[])getValues(CACHE_MAPPING);
+ public CacheMapping[] getCacheMapping() {
+ return (CacheMapping[]) getValues(CACHE_MAPPING);
}
+
// Return the number of properties
- public int sizeCacheMapping()
- {
- return size(CACHE_MAPPING);
+ public int sizeCacheMapping() {
+ return size(CACHE_MAPPING);
}
- // Add a new element returning its index in the list
- public int addCacheMapping(CacheMapping value)
- {
- return addValue(CACHE_MAPPING, value);
- }
// Add a new element returning its index in the list
- public void addNewCacheMapping(CacheMapping value)
- {
- addCacheMapping(value);
+ public int addCacheMapping(CacheMapping value) {
+ return addValue(CACHE_MAPPING, value);
}
+
+ // Add a new element returning its index in the list
+ public void addNewCacheMapping(CacheMapping value) {
+ addCacheMapping(value);
+ }
+
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeCacheMapping(CacheMapping value)
- {
- return removeValue(CACHE_MAPPING, value);
+ public int removeCacheMapping(CacheMapping value) {
+ return removeValue(CACHE_MAPPING, value);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ @Override
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheHelper.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheHelper.java
index 2669dd7..3009b44 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheHelper.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheHelper.java
@@ -23,20 +23,19 @@
*
* @author Jerome Dochez
*/
-public class CacheHelper extends WebPropertyContainer
-{
+public class CacheHelper extends WebPropertyContainer {
+
static public final String CLASS_NAME = "ClassName";
// copy constructor
- public CacheHelper(CacheHelper other)
- {
- super(other);
+ public CacheHelper(CacheHelper other) {
+ super(other);
}
+
// constructor
- public CacheHelper()
- {
- super();
+ public CacheHelper() {
+ super();
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheMapping.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheMapping.java
index 4d35803..976c0f9 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheMapping.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CacheMapping.java
@@ -41,306 +41,308 @@
static public final String CONSTRAINT_FIELD = "ConstraintField"; // NOI18N
public CacheMapping(CacheMapping other) {
- super(other);
+ super(other);
}
+
public CacheMapping() {
- setAttributeValue(KEY_FIELD, SCOPE, "request.parameter");
- setAttributeValue(REFRESH_FIELD, SCOPE, "request.parameter");
+ setAttributeValue(KEY_FIELD, SCOPE, "request.parameter");
+ setAttributeValue(REFRESH_FIELD, SCOPE, "request.parameter");
}
+
// This attribute is mandatory
- public void setServletName(String value)
- {
- this.setValue(SERVLET_NAME, value);
+ public void setServletName(String value) {
+ this.setValue(SERVLET_NAME, value);
}
+
//
- public String getServletName()
- {
- return (String)this.getValue(SERVLET_NAME);
+ public String getServletName() {
+ return (String) this.getValue(SERVLET_NAME);
}
+
// This attribute is mandatory
- public void setURLPattern(String value)
- {
- this.setValue(URL_PATTERN, value);
+ public void setURLPattern(String value) {
+ this.setValue(URL_PATTERN, value);
}
+
//
- public String getURLPattern()
- {
- return (String)this.getValue(URL_PATTERN);
+ public String getURLPattern() {
+ return (String) this.getValue(URL_PATTERN);
}
+
// This attribute is mandatory
- public void setCacheHelperRef(String value)
- {
- this.setValue(CACHE_HELPER_REF, value);
+ public void setCacheHelperRef(String value) {
+ this.setValue(CACHE_HELPER_REF, value);
}
+
//
- public String getCacheHelperRef()
- {
- return (String)this.getValue(CACHE_HELPER_REF);
+ public String getCacheHelperRef() {
+ return (String) this.getValue(CACHE_HELPER_REF);
}
+
// This attribute is optional
- public void setTimeout(String value)
- {
- this.setValue(TIMEOUT, value);
+ public void setTimeout(String value) {
+ this.setValue(TIMEOUT, value);
}
+
//
- public String getTimeout()
- {
- return (String)this.getValue(TIMEOUT);
+ public String getTimeout() {
+ return (String) this.getValue(TIMEOUT);
}
+
// This attribute is optional
- public void setRefreshField(boolean value)
- {
- this.setValue(REFRESH_FIELD, Boolean.valueOf(value));
+ public void setRefreshField(boolean value) {
+ this.setValue(REFRESH_FIELD, Boolean.valueOf(value));
}
+
//
- public boolean isRefreshField()
- {
- Boolean ret = (Boolean)this.getValue(REFRESH_FIELD);
- if (ret == null)
- return false;
- return ret.booleanValue();
+ public boolean isRefreshField() {
+ Boolean ret = (Boolean) this.getValue(REFRESH_FIELD);
+ if (ret == null) {
+ return false;
+ }
+ return ret.booleanValue();
}
// This attribute is an array, possibly empty
- public void setDispatcher(int index, String value)
- {
- this.setValue(DISPATCHER, index, value);
+ public void setDispatcher(int index, String value) {
+ this.setValue(DISPATCHER, index, value);
}
+
//
- public String getDispatcher(int index)
- {
- return (String)this.getValue(DISPATCHER, index);
+ public String getDispatcher(int index) {
+ return (String) this.getValue(DISPATCHER, index);
}
+
// This attribute is an array, possibly empty
- public void setDispatcher(String[] value)
- {
- this.setValue(DISPATCHER, value);
+ public void setDispatcher(String[] value) {
+ this.setValue(DISPATCHER, value);
}
+
//
- public String[] getDispatcher()
- {
- return (String[])this.getValues(DISPATCHER);
+ public String[] getDispatcher() {
+ return (String[]) this.getValues(DISPATCHER);
}
+
// Return the number of properties
- public int sizeDispatcher()
- {
- return this.size(DISPATCHER);
+ public int sizeDispatcher() {
+ return this.size(DISPATCHER);
}
- // Add a new element returning its index in the list
- public int addDispatcher(String value)
- {
- return this.addValue(DISPATCHER, value);
- }
// Add a new element returning its index in the list
- public void addNewDispatcher(String value)
- {
- addValue(DISPATCHER, value);
+ public int addDispatcher(String value) {
+ return this.addValue(DISPATCHER, value);
}
+
+ // Add a new element returning its index in the list
+ public void addNewDispatcher(String value) {
+ addValue(DISPATCHER, value);
+ }
+
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeDispatcher(String value)
- {
- return this.removeValue(DISPATCHER, value);
+ public int removeDispatcher(String value) {
+ return this.removeValue(DISPATCHER, value);
}
// This attribute is an array, possibly empty
- public void setHttpMethod(int index, String value)
- {
- this.setValue(HTTP_METHOD, index, value);
+ public void setHttpMethod(int index, String value) {
+ this.setValue(HTTP_METHOD, index, value);
}
+
//
- public String getHttpMethod(int index)
- {
- return (String)this.getValue(HTTP_METHOD, index);
+ public String getHttpMethod(int index) {
+ return (String) this.getValue(HTTP_METHOD, index);
}
+
// This attribute is an array, possibly empty
- public void setHttpMethod(String[] value)
- {
- this.setValue(HTTP_METHOD, value);
+ public void setHttpMethod(String[] value) {
+ this.setValue(HTTP_METHOD, value);
}
+
//
- public String[] getHttpMethod()
- {
- return (String[])this.getValues(HTTP_METHOD);
+ public String[] getHttpMethod() {
+ return (String[]) this.getValues(HTTP_METHOD);
}
+
// Return the number of properties
- public int sizeHttpMethod()
- {
- return this.size(HTTP_METHOD);
+ public int sizeHttpMethod() {
+ return this.size(HTTP_METHOD);
}
+
// Add a new element returning its index in the list
- public int addHttpMethod(String value)
- {
- return this.addValue(HTTP_METHOD, value);
+ public int addHttpMethod(String value) {
+ return this.addValue(HTTP_METHOD, value);
}
+
+
// Add a new element returning its index in the list
- public void addNewHttpMethod(String value)
- {
- addValue(HTTP_METHOD, value);
+ public void addNewHttpMethod(String value) {
+ addValue(HTTP_METHOD, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeHttpMethod(String value)
- {
- return this.removeValue(HTTP_METHOD, value);
+ public int removeHttpMethod(String value) {
+ return this.removeValue(HTTP_METHOD, value);
}
+
// This attribute is an array, possibly empty
- public void setKeyField(int index, boolean value)
- {
- this.setValue(KEY_FIELD, index, Boolean.valueOf(value));
+ public void setKeyField(int index, boolean value) {
+ this.setValue(KEY_FIELD, index, Boolean.valueOf(value));
}
+
//
- public boolean isKeyField(int index)
- {
- Boolean ret = (Boolean)this.getValue(KEY_FIELD, index);
- if (ret == null)
- return false;
- return ret.booleanValue();
+ public boolean isKeyField(int index) {
+ Boolean ret = (Boolean) this.getValue(KEY_FIELD, index);
+ if (ret == null) {
+ return false;
+ }
+ return ret.booleanValue();
}
+
// This attribute is an array, possibly empty
- public void setKeyField(boolean[] value)
- {
- Boolean[] values = null;
- if (value != null)
- {
- values = new Boolean[value.length];
- for (int i = 0; i < value.length; i++)
- values[i] = Boolean.valueOf(value[i]);
- }
- this.setValue(KEY_FIELD, values);
+ public void setKeyField(boolean[] value) {
+ Boolean[] values = null;
+ if (value != null) {
+ values = new Boolean[value.length];
+ for (int i = 0; i < value.length; i++) {
+ values[i] = Boolean.valueOf(value[i]);
+ }
+ }
+ this.setValue(KEY_FIELD, values);
}
+
//
- public boolean[] getKeyField()
- {
- boolean[] ret = null;
- Boolean[] values = (Boolean[])this.getValues(KEY_FIELD);
- if (values != null)
- {
- ret = new boolean[values.length];
- for (int i=0; i<values.length; i++)
- ret[i] = values[i].booleanValue();
+ public boolean[] getKeyField() {
+ boolean[] ret = null;
+ Boolean[] values = (Boolean[]) this.getValues(KEY_FIELD);
+ if (values != null) {
+ ret = new boolean[values.length];
+ for (int i = 0; i < values.length; i++) {
+ ret[i] = values[i].booleanValue();
+ }
+ }
+ return ret;
}
- return ret;
- }
+
// Return the number of properties
- public int sizeKeyField()
- {
- return this.size(KEY_FIELD);
+ public int sizeKeyField() {
+ return this.size(KEY_FIELD);
}
+
// Add a new element returning its index in the list
- public int addKeyField(boolean value)
- {
- return this.addValue(KEY_FIELD, Boolean.valueOf(value));
+ public int addKeyField(boolean value) {
+ return this.addValue(KEY_FIELD, Boolean.valueOf(value));
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeKeyField(boolean value)
- {
- return this.removeValue(KEY_FIELD, Boolean.valueOf(value));
+ public int removeKeyField(boolean value) {
+ return this.removeValue(KEY_FIELD, Boolean.valueOf(value));
}
+
//
// Remove an element using its index
//
- public void removeKeyField(int index)
- {
- this.removeValue(KEY_FIELD, index);
+ public void removeKeyField(int index) {
+ this.removeValue(KEY_FIELD, index);
}
+
// This attribute is an array, possibly empty
- public void setConstraintField(int index, ConstraintField value)
- {
- this.setValue(CONSTRAINT_FIELD, index, value);
+ public void setConstraintField(int index, ConstraintField value) {
+ this.setValue(CONSTRAINT_FIELD, index, value);
}
+
//
- public ConstraintField getConstraintField(int index)
- {
- return (ConstraintField)this.getValue(CONSTRAINT_FIELD, index);
+ public ConstraintField getConstraintField(int index) {
+ return (ConstraintField) this.getValue(CONSTRAINT_FIELD, index);
}
+
// This attribute is an array, possibly empty
- public void setConstraintField(ConstraintField[] value)
- {
- this.setValue(CONSTRAINT_FIELD, value);
+ public void setConstraintField(ConstraintField[] value) {
+ this.setValue(CONSTRAINT_FIELD, value);
}
+
//
- public ConstraintField[] getConstraintField()
- {
- return (ConstraintField[])this.getValues(CONSTRAINT_FIELD);
+ public ConstraintField[] getConstraintField() {
+ return (ConstraintField[]) this.getValues(CONSTRAINT_FIELD);
}
+
// Return the number of properties
- public int sizeConstraintField()
- {
- return this.size(CONSTRAINT_FIELD);
+ public int sizeConstraintField() {
+ return this.size(CONSTRAINT_FIELD);
}
- // Add a new element returning its index in the list
- public int addConstraintField(ConstraintField value)
- {
- return this.addValue(CONSTRAINT_FIELD, value);
- }
// Add a new element returning its index in the list
- public void addNewConstraintField(ConstraintField value)
- {
- this.addValue(CONSTRAINT_FIELD, value);
+ public int addConstraintField(ConstraintField value) {
+ return this.addValue(CONSTRAINT_FIELD, value);
}
+
+ // Add a new element returning its index in the list
+ public void addNewConstraintField(ConstraintField value) {
+ this.addValue(CONSTRAINT_FIELD, value);
+ }
+
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeConstraintField(ConstraintField value)
- {
- return this.removeValue(CONSTRAINT_FIELD, value);
+ public int removeConstraintField(ConstraintField value) {
+ return this.removeValue(CONSTRAINT_FIELD, value);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ClassLoader.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ClassLoader.java
index c9cef77..73adb2e 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ClassLoader.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ClassLoader.java
@@ -17,8 +17,8 @@
package org.glassfish.web.deployment.runtime;
public class ClassLoader extends WebPropertyContainer {
+
static public final String EXTRA_CLASS_PATH = "ExtraClassPath";
static public final String DELEGATE = "Delegate";
- static public final String DYNAMIC_RELOAD_INTERVAL =
- "DynamicReloadInterval";
+ static public final String DYNAMIC_RELOAD_INTERVAL = "DynamicReloadInterval";
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ConstraintField.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ConstraintField.java
index aa3a069..9e5be1a 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ConstraintField.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ConstraintField.java
@@ -25,83 +25,84 @@
*
* @author Jerome Dochez
*/
-public class ConstraintField extends RuntimeDescriptor
-{
+public class ConstraintField extends RuntimeDescriptor {
- static public final String VALUE = "Value"; // NOI18N
+ static public final String VALUE = "Value"; // NOI18N
static public final String NAME = "Name";
static public final String SCOPE = "Scope";
static public final String MATCH_EXPR = "MatchExpr";
static public final String CACHE_ON_MATCH = "CacheOnMatch";
static public final String CACHE_ON_MATCH_FAILURE = "CacheOnMatchFailure";
- public ConstraintField(ConstraintField other)
- {
- super(other);
+ public ConstraintField(ConstraintField other) {
+ super(other);
}
- public ConstraintField()
- {
- setAttributeValue(SCOPE, "request.parameter");
- setAttributeValue(CACHE_ON_MATCH, "true");
- setAttributeValue(CACHE_ON_MATCH_FAILURE, "false");
+
+ public ConstraintField() {
+ setAttributeValue(SCOPE, "request.parameter");
+ setAttributeValue(CACHE_ON_MATCH, "true");
+ setAttributeValue(CACHE_ON_MATCH_FAILURE, "false");
}
+
// This attribute is an array, possibly empty
- public void setValue(int index, String value)
- {
- this.setValue(VALUE, index, value);
+ public void setValue(int index, String value) {
+ this.setValue(VALUE, index, value);
}
+
//
- public String getValue(int index)
- {
- return (String)this.getValue(VALUE, index);
+ public String getValue(int index) {
+ return (String) this.getValue(VALUE, index);
}
+
// This attribute is an array, possibly empty
- public void setValue(String[] value)
- {
- this.setValue(VALUE, value);
+ public void setValue(String[] value) {
+ this.setValue(VALUE, value);
}
+
//
- public String[] getValue()
- {
- return (String[])this.getValues(VALUE);
+ public String[] getValue() {
+ return (String[]) this.getValues(VALUE);
}
+
// Return the number of properties
- public int sizeValue()
- {
- return this.size(VALUE);
+ public int sizeValue() {
+ return this.size(VALUE);
}
+
// Add a new element returning its index in the list
- public int addValue(String value)
- {
- int index = this.addValue(VALUE, value);
- if (getAttributeValue(VALUE, index, MATCH_EXPR)==null)
- setAttributeValue(VALUE, index, MATCH_EXPR, "equals");
- if (getAttributeValue(VALUE, index, CACHE_ON_MATCH)==null)
- setAttributeValue(VALUE, index, CACHE_ON_MATCH, "true");
- if (getAttributeValue(VALUE, index, CACHE_ON_MATCH_FAILURE)==null)
- setAttributeValue(VALUE, index, CACHE_ON_MATCH_FAILURE, "false");
- return index;
+ public int addValue(String value) {
+ int index = this.addValue(VALUE, value);
+ if (getAttributeValue(VALUE, index, MATCH_EXPR) == null) {
+ setAttributeValue(VALUE, index, MATCH_EXPR, "equals");
+ }
+ if (getAttributeValue(VALUE, index, CACHE_ON_MATCH) == null) {
+ setAttributeValue(VALUE, index, CACHE_ON_MATCH, "true");
+ }
+ if (getAttributeValue(VALUE, index, CACHE_ON_MATCH_FAILURE) == null) {
+ setAttributeValue(VALUE, index, CACHE_ON_MATCH_FAILURE, "false");
+ }
+ return index;
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeValue(String value)
- {
- return this.removeValue(VALUE, value);
+ public int removeValue(String value) {
+ return this.removeValue(VALUE, value);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CookieProperties.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CookieProperties.java
index d348fb4..acab18a 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CookieProperties.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/CookieProperties.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class CookieProperties extends WebPropertyContainer
-{
+public class CookieProperties extends WebPropertyContainer {
// Tag class
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/DefaultHelper.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/DefaultHelper.java
index fccb354..6052783 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/DefaultHelper.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/DefaultHelper.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class DefaultHelper extends WebPropertyContainer
-{
+public class DefaultHelper extends WebPropertyContainer {
// Tag class...
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/JspConfig.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/JspConfig.java
index 464af0b..c54d734 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/JspConfig.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/JspConfig.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class JspConfig extends WebPropertyContainer
-{
- //tag class
+public class JspConfig extends WebPropertyContainer {
+ // tag class
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetInfo.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetInfo.java
index 84b2cb3..19c6c5d 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetInfo.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetInfo.java
@@ -25,79 +25,77 @@
*
* @author Jerome Dochez
*/
-public class LocaleCharsetInfo extends RuntimeDescriptor
-{
+public class LocaleCharsetInfo extends RuntimeDescriptor {
- static public final String LOCALE_CHARSET_MAP = "LocaleCharsetMap"; // NOI18N
- static public final String PARAMETER_ENCODING = "ParameterEncoding"; // NOI18N
+ static public final String LOCALE_CHARSET_MAP = "LocaleCharsetMap"; // NOI18N
+ static public final String PARAMETER_ENCODING = "ParameterEncoding"; // NOI18N
static public final String FORM_HINT_FIELD = "FormHintField"; // NOI18N
- static public final String DEFAULT_LOCALE = "DefaultLocale"; // NOI18N
+ static public final String DEFAULT_LOCALE = "DefaultLocale"; // NOI18N
static public final String DEFAULT_CHARSET = "DefaultCharset";
// This attribute is an array containing at least one element
- public void setLocaleCharsetMap(int index, LocaleCharsetMap value)
- {
- this.setValue(LOCALE_CHARSET_MAP, index, value);
+ public void setLocaleCharsetMap(int index, LocaleCharsetMap value) {
+ this.setValue(LOCALE_CHARSET_MAP, index, value);
}
+
//
- public LocaleCharsetMap getLocaleCharsetMap(int index)
- {
- return (LocaleCharsetMap)this.getValue(LOCALE_CHARSET_MAP, index);
+ public LocaleCharsetMap getLocaleCharsetMap(int index) {
+ return (LocaleCharsetMap) this.getValue(LOCALE_CHARSET_MAP, index);
}
+
// This attribute is an array containing at least one element
- public void setLocaleCharsetMap(LocaleCharsetMap[] value)
- {
- this.setValue(LOCALE_CHARSET_MAP, value);
+ public void setLocaleCharsetMap(LocaleCharsetMap[] value) {
+ this.setValue(LOCALE_CHARSET_MAP, value);
}
+
//
- public LocaleCharsetMap[] getLocaleCharsetMap()
- {
- return (LocaleCharsetMap[])this.getValues(LOCALE_CHARSET_MAP);
+ public LocaleCharsetMap[] getLocaleCharsetMap() {
+ return (LocaleCharsetMap[]) this.getValues(LOCALE_CHARSET_MAP);
}
+
// Return the number of properties
- public int sizeLocaleCharsetMap()
- {
- return this.size(LOCALE_CHARSET_MAP);
+ public int sizeLocaleCharsetMap() {
+ return this.size(LOCALE_CHARSET_MAP);
}
+
// Add a new element returning its index in the list
- public int addLocaleCharsetMap(LocaleCharsetMap value)
- {
- return this.addValue(LOCALE_CHARSET_MAP, value);
+ public int addLocaleCharsetMap(LocaleCharsetMap value) {
+ return this.addValue(LOCALE_CHARSET_MAP, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeLocaleCharsetMap(LocaleCharsetMap value)
- {
- return this.removeValue(LOCALE_CHARSET_MAP, value);
+ public int removeLocaleCharsetMap(LocaleCharsetMap value) {
+ return this.removeValue(LOCALE_CHARSET_MAP, value);
}
+
// This attribute is optional
- public void setParameterEncoding(boolean value)
- {
- this.setValue(PARAMETER_ENCODING, Boolean.valueOf(value));
+ public void setParameterEncoding(boolean value) {
+ this.setValue(PARAMETER_ENCODING, Boolean.valueOf(value));
}
+
//
- public boolean isParameterEncoding()
- {
- Boolean ret = (Boolean)this.getValue(PARAMETER_ENCODING);
- if (ret == null) {
- return false;
- }
- return ret.booleanValue();
+ public boolean isParameterEncoding() {
+ Boolean ret = (Boolean) this.getValue(PARAMETER_ENCODING);
+ if (ret == null) {
+ return false;
+ }
+ return ret.booleanValue();
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetMap.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetMap.java
index 058f473..a152ced 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetMap.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/LocaleCharsetMap.java
@@ -25,8 +25,8 @@
*
* @author Jerome Dochez
*/
-public class LocaleCharsetMap extends RuntimeDescriptor
-{
+public class LocaleCharsetMap extends RuntimeDescriptor {
+
// attributes names
public final static String LOCALE = "Locale";
public final static String AGENT = "Agent";
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ManagerProperties.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ManagerProperties.java
index 4f33fcb..85e7a15 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ManagerProperties.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/ManagerProperties.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class ManagerProperties extends WebPropertyContainer
-{
+public class ManagerProperties extends WebPropertyContainer {
// tag class...
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Servlet.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Servlet.java
index 0b5197e..78b06aa 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Servlet.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Servlet.java
@@ -25,39 +25,37 @@
*
* @author Jerome Dochez
*/
-public class Servlet extends RuntimeDescriptor
-{
+public class Servlet extends RuntimeDescriptor {
- static public final String SERVLET_NAME = "ServletName"; // NOI18N
- static public final String PRINCIPAL_NAME = "PrincipalName"; // NOI18N
+ static public final String SERVLET_NAME = "ServletName"; // NOI18N
+ static public final String PRINCIPAL_NAME = "PrincipalName"; // NOI18N
// This attribute is mandatory
- public void setServletName(String value)
- {
- this.setValue(SERVLET_NAME, value);
+ public void setServletName(String value) {
+ this.setValue(SERVLET_NAME, value);
}
+
//
- public String getServletName()
- {
- return (String)this.getValue(SERVLET_NAME);
+ public String getServletName() {
+ return (String) this.getValue(SERVLET_NAME);
}
+
// This attribute is mandatory
- public void setPrincipalName(String value)
- {
- this.setValue(PRINCIPAL_NAME, value);
+ public void setPrincipalName(String value) {
+ this.setValue(PRINCIPAL_NAME, value);
}
+
//
- public String getPrincipalName()
- {
- return (String)this.getValue(PRINCIPAL_NAME);
+ public String getPrincipalName() {
+ return (String) this.getValue(PRINCIPAL_NAME);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionConfig.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionConfig.java
index 8206261..16aa16f 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionConfig.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionConfig.java
@@ -25,53 +25,51 @@
*
* @author Jerome Dochez
*/
-public class SessionConfig extends RuntimeDescriptor
-{
+public class SessionConfig extends RuntimeDescriptor {
- static public final String SESSION_MANAGER = "SessionManager"; // NOI18N
- static public final String SESSION_PROPERTIES = "SessionProperties"; // NOI18N
- static public final String COOKIE_PROPERTIES = "CookieProperties"; // NOI18N
+ static public final String SESSION_MANAGER = "SessionManager"; // NOI18N
+ static public final String SESSION_PROPERTIES = "SessionProperties"; // NOI18N
+ static public final String COOKIE_PROPERTIES = "CookieProperties"; // NOI18N
// This attribute is optional
- public void setSessionManager(SessionManager value)
- {
- this.setValue(SESSION_MANAGER, value);
+ public void setSessionManager(SessionManager value) {
+ this.setValue(SESSION_MANAGER, value);
}
+
//
- public SessionManager getSessionManager()
- {
- return (SessionManager)this.getValue(SESSION_MANAGER);
+ public SessionManager getSessionManager() {
+ return (SessionManager) this.getValue(SESSION_MANAGER);
}
+
// This attribute is optional
- public void setSessionProperties(SessionProperties value)
- {
- this.setValue(SESSION_PROPERTIES, value);
+ public void setSessionProperties(SessionProperties value) {
+ this.setValue(SESSION_PROPERTIES, value);
}
+
//
- public SessionProperties getSessionProperties()
- {
- return (SessionProperties)this.getValue(SESSION_PROPERTIES);
+ public SessionProperties getSessionProperties() {
+ return (SessionProperties) this.getValue(SESSION_PROPERTIES);
}
+
// This attribute is optional
- public void setCookieProperties(CookieProperties value)
- {
- this.setValue(COOKIE_PROPERTIES, value);
+ public void setCookieProperties(CookieProperties value) {
+ this.setValue(COOKIE_PROPERTIES, value);
}
+
//
- public CookieProperties getCookieProperties()
- {
- return (CookieProperties)this.getValue(COOKIE_PROPERTIES);
+ public CookieProperties getCookieProperties() {
+ return (CookieProperties) this.getValue(COOKIE_PROPERTIES);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionManager.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionManager.java
index 2c17c1f..278e741 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionManager.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionManager.java
@@ -25,45 +25,43 @@
*
* @author Jerome Dochez
*/
-public class SessionManager extends RuntimeDescriptor
-{
+public class SessionManager extends RuntimeDescriptor {
- static public final String MANAGER_PROPERTIES = "ManagerProperties"; // NOI18N
- static public final String STORE_PROPERTIES = "StoreProperties"; // NOI18N
+ static public final String MANAGER_PROPERTIES = "ManagerProperties"; // NOI18N
+ static public final String STORE_PROPERTIES = "StoreProperties"; // NOI18N
static public final String PERSISTENCE_TYPE = "PersistenceType";
- public SessionManager()
- {
- setAttributeValue(PERSISTENCE_TYPE, "memory");
+ public SessionManager() {
+ setAttributeValue(PERSISTENCE_TYPE, "memory");
}
+
// This attribute is optional
- public void setManagerProperties(ManagerProperties value)
- {
- this.setValue(MANAGER_PROPERTIES, value);
+ public void setManagerProperties(ManagerProperties value) {
+ this.setValue(MANAGER_PROPERTIES, value);
}
+
//
- public ManagerProperties getManagerProperties()
- {
- return (ManagerProperties)this.getValue(MANAGER_PROPERTIES);
+ public ManagerProperties getManagerProperties() {
+ return (ManagerProperties) this.getValue(MANAGER_PROPERTIES);
}
+
// This attribute is optional
- public void setStoreProperties(StoreProperties value)
- {
- this.setValue(STORE_PROPERTIES, value);
+ public void setStoreProperties(StoreProperties value) {
+ this.setValue(STORE_PROPERTIES, value);
}
+
//
- public StoreProperties getStoreProperties()
- {
- return (StoreProperties)this.getValue(STORE_PROPERTIES);
+ public StoreProperties getStoreProperties() {
+ return (StoreProperties) this.getValue(STORE_PROPERTIES);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionProperties.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionProperties.java
index 29b44e1..d458722 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionProperties.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SessionProperties.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class SessionProperties extends WebPropertyContainer
-{
+public class SessionProperties extends WebPropertyContainer {
// Tag class
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/StoreProperties.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/StoreProperties.java
index 4bf5262..8971827 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/StoreProperties.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/StoreProperties.java
@@ -23,7 +23,6 @@
*
* @author Jerome Dochez
*/
-public class StoreProperties extends WebPropertyContainer
-{
+public class StoreProperties extends WebPropertyContainer {
// tag class...
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SunWebAppImpl.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SunWebAppImpl.java
index 22f5146..791efa7 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SunWebAppImpl.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/SunWebAppImpl.java
@@ -23,309 +23,335 @@
// BEGIN_NOI18N
-public class SunWebAppImpl extends WebPropertyContainer implements SunWebApp
-{
+public class SunWebAppImpl extends WebPropertyContainer implements SunWebApp {
- public SunWebAppImpl()
- {
- // set default values
- setAttributeValue(CACHE, "MaxEntries", "4096");
- setAttributeValue(CACHE, "TimeoutInSeconds", "30");
- setAttributeValue(CACHE, "Enabled", "false");
+ public SunWebAppImpl() {
+ // set default values
+ setAttributeValue(CACHE, "MaxEntries", "4096");
+ setAttributeValue(CACHE, "TimeoutInSeconds", "30");
+ setAttributeValue(CACHE, "Enabled", "false");
}
+
// This attribute is an array, possibly empty
- public void setSecurityRoleMapping(int index, SecurityRoleMapping value)
- {
- this.setValue(SECURITY_ROLE_MAPPING, index, value);
+ @Override
+ public void setSecurityRoleMapping(int index, SecurityRoleMapping value) {
+ this.setValue(SECURITY_ROLE_MAPPING, index, value);
}
+
//
- public SecurityRoleMapping getSecurityRoleMapping(int index)
- {
- return (SecurityRoleMapping)this.getValue(SECURITY_ROLE_MAPPING, index);
+ @Override
+ public SecurityRoleMapping getSecurityRoleMapping(int index) {
+ return (SecurityRoleMapping) this.getValue(SECURITY_ROLE_MAPPING, index);
}
+
// This attribute is an array, possibly empty
- public void setSecurityRoleMapping(SecurityRoleMapping[] value)
- {
- this.setValue(SECURITY_ROLE_MAPPING, value);
+ @Override
+ public void setSecurityRoleMapping(SecurityRoleMapping[] value) {
+ this.setValue(SECURITY_ROLE_MAPPING, value);
}
+
//
- public SecurityRoleMapping[] getSecurityRoleMapping()
- {
- return (SecurityRoleMapping[])this.getValues(SECURITY_ROLE_MAPPING);
+ @Override
+ public SecurityRoleMapping[] getSecurityRoleMapping() {
+ return (SecurityRoleMapping[]) this.getValues(SECURITY_ROLE_MAPPING);
}
+
// Return the number of properties
- public int sizeSecurityRoleMapping()
- {
- return this.size(SECURITY_ROLE_MAPPING);
+ @Override
+ public int sizeSecurityRoleMapping() {
+ return this.size(SECURITY_ROLE_MAPPING);
}
+
// Add a new element returning its index in the list
- public int addSecurityRoleMapping(SecurityRoleMapping value)
- {
- return this.addValue(SECURITY_ROLE_MAPPING, value);
+ @Override
+ public int addSecurityRoleMapping(SecurityRoleMapping value) {
+ return this.addValue(SECURITY_ROLE_MAPPING, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeSecurityRoleMapping(SecurityRoleMapping value)
- {
- return this.removeValue(SECURITY_ROLE_MAPPING, value);
+ @Override
+ public int removeSecurityRoleMapping(SecurityRoleMapping value) {
+ return this.removeValue(SECURITY_ROLE_MAPPING, value);
}
+
// This attribute is an array, possibly empty
- public void setSecurityRoleAssignment(int index, SecurityRoleAssignment value)
- {
- this.setValue(SECURITY_ROLE_ASSIGNMENT, index, value);
+ @Override
+ public void setSecurityRoleAssignment(int index, SecurityRoleAssignment value) {
+ this.setValue(SECURITY_ROLE_ASSIGNMENT, index, value);
}
+
//
- public SecurityRoleAssignment getSecurityRoleAssignment(int index)
- {
- return (SecurityRoleAssignment)this.getValue(SECURITY_ROLE_ASSIGNMENT, index);
+ @Override
+ public SecurityRoleAssignment getSecurityRoleAssignment(int index) {
+ return (SecurityRoleAssignment) this.getValue(SECURITY_ROLE_ASSIGNMENT, index);
}
+
// This attribute is an array, possibly empty
- public void setSecurityRoleAssignments(SecurityRoleAssignment[] value)
- {
- this.setValue(SECURITY_ROLE_ASSIGNMENT, value);
+ @Override
+ public void setSecurityRoleAssignments(SecurityRoleAssignment[] value) {
+ this.setValue(SECURITY_ROLE_ASSIGNMENT, value);
}
+
//
- public SecurityRoleAssignment[] getSecurityRoleAssignments()
- {
- return (SecurityRoleAssignment[])this.getValues(SECURITY_ROLE_ASSIGNMENT);
+ @Override
+ public SecurityRoleAssignment[] getSecurityRoleAssignments() {
+ return (SecurityRoleAssignment[]) this.getValues(SECURITY_ROLE_ASSIGNMENT);
}
+
// Return the number of properties
- public int sizeSecurityRoleAssignment()
- {
- return this.size(SECURITY_ROLE_ASSIGNMENT);
+ @Override
+ public int sizeSecurityRoleAssignment() {
+ return this.size(SECURITY_ROLE_ASSIGNMENT);
}
+
// Add a new element returning its index in the list
- public int addSecurityRoleAssignment(SecurityRoleAssignment value)
- {
- return this.addValue(SECURITY_ROLE_ASSIGNMENT, value);
+ @Override
+ public int addSecurityRoleAssignment(SecurityRoleAssignment value) {
+ return this.addValue(SECURITY_ROLE_ASSIGNMENT, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeSecurityRoleAssignment(SecurityRoleAssignment value)
- {
- return this.removeValue(SECURITY_ROLE_ASSIGNMENT, value);
+ @Override
+ public int removeSecurityRoleAssignment(SecurityRoleAssignment value) {
+ return this.removeValue(SECURITY_ROLE_ASSIGNMENT, value);
}
+
// This attribute is an array, possibly empty
- public void setServlet(int index, Servlet value)
- {
- this.setValue(SERVLET, index, value);
+ public void setServlet(int index, Servlet value) {
+ this.setValue(SERVLET, index, value);
}
+
//
- public Servlet getServlet(int index)
- {
- return (Servlet)this.getValue(SERVLET, index);
+ public Servlet getServlet(int index) {
+ return (Servlet) this.getValue(SERVLET, index);
}
+
// This attribute is an array, possibly empty
- public void setServlet(Servlet[] value)
- {
- this.setValue(SERVLET, value);
+ public void setServlet(Servlet[] value) {
+ this.setValue(SERVLET, value);
}
+
//
- public Servlet[] getServlet()
- {
- return (Servlet[])this.getValues(SERVLET);
+ public Servlet[] getServlet() {
+ return (Servlet[]) this.getValues(SERVLET);
}
+
// Return the number of properties
- public int sizeServlet()
- {
- return this.size(SERVLET);
+ public int sizeServlet() {
+ return this.size(SERVLET);
}
+
// Add a new element returning its index in the list
- public int addServlet(Servlet value)
- {
- return this.addValue(SERVLET, value);
+ public int addServlet(Servlet value) {
+ return this.addValue(SERVLET, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeServlet(Servlet value)
- {
- return this.removeValue(SERVLET, value);
+ public int removeServlet(Servlet value) {
+ return this.removeValue(SERVLET, value);
}
+
// This attribute is an array, possibly empty
- public void setIdempotentUrlPattern(int index, IdempotentUrlPattern value)
- {
+ @Override
+ public void setIdempotentUrlPattern(int index, IdempotentUrlPattern value) {
this.setValue(IDEMPOTENT_URL_PATTERN, index, value);
}
+
//
- public IdempotentUrlPattern getIdempotentUrlPattern(int index)
- {
- return (IdempotentUrlPattern)this.getValue(IDEMPOTENT_URL_PATTERN, index);
+ @Override
+ public IdempotentUrlPattern getIdempotentUrlPattern(int index) {
+ return (IdempotentUrlPattern) this.getValue(IDEMPOTENT_URL_PATTERN, index);
}
+
// This attribute is an array, possibly empty
- public void setIdempotentUrlPatterns(IdempotentUrlPattern[] value)
- {
+ @Override
+ public void setIdempotentUrlPatterns(IdempotentUrlPattern[] value) {
this.setValue(IDEMPOTENT_URL_PATTERN, value);
}
+
//
- public IdempotentUrlPattern[] getIdempotentUrlPatterns()
- {
- return (IdempotentUrlPattern[])this.getValues(IDEMPOTENT_URL_PATTERN);
+ @Override
+ public IdempotentUrlPattern[] getIdempotentUrlPatterns() {
+ return (IdempotentUrlPattern[]) this.getValues(IDEMPOTENT_URL_PATTERN);
}
+
// Return the number of properties
- public int sizeIdempotentUrlPattern()
- {
+ @Override
+ public int sizeIdempotentUrlPattern() {
return this.size(IDEMPOTENT_URL_PATTERN);
}
+
// Add a new element returning its index in the list
- public int addIdempotentUrlPattern(IdempotentUrlPattern value)
- {
+ @Override
+ public int addIdempotentUrlPattern(IdempotentUrlPattern value) {
return this.addValue(IDEMPOTENT_URL_PATTERN, value);
}
+
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeIdempotentUrlPattern(IdempotentUrlPattern value)
- {
+ @Override
+ public int removeIdempotentUrlPattern(IdempotentUrlPattern value) {
return this.removeValue(IDEMPOTENT_URL_PATTERN, value);
}
+
// This attribute is optional
- public void setSessionConfig(SessionConfig value)
- {
- this.setValue(SESSION_CONFIG, value);
+ public void setSessionConfig(SessionConfig value) {
+ this.setValue(SESSION_CONFIG, value);
}
+
//
- public SessionConfig getSessionConfig()
- {
- return (SessionConfig)this.getValue(SESSION_CONFIG);
+ public SessionConfig getSessionConfig() {
+ return (SessionConfig) this.getValue(SESSION_CONFIG);
}
+
// This attribute is optional
- public void setCache(Cache value)
- {
- this.setValue(CACHE, value);
+ public void setCache(Cache value) {
+ this.setValue(CACHE, value);
}
+
//
- public Cache getCache()
- {
- return (Cache)this.getValue(CACHE);
+ public Cache getCache() {
+ return (Cache) this.getValue(CACHE);
}
+
// This attribute is optional
- public void setClassLoader(ClassLoader value)
- {
+ public void setClassLoader(ClassLoader value) {
this.setValue(CLASS_LOADER, value);
}
+
//
- public ClassLoader getClassLoader()
- {
- return (ClassLoader)this.getValue(CLASS_LOADER);
+ public ClassLoader getClassLoader() {
+ return (ClassLoader) this.getValue(CLASS_LOADER);
}
// This attribute is optional
- public void setJspConfig(JspConfig value)
- {
- this.setValue(JSP_CONFIG, value);
+ public void setJspConfig(JspConfig value) {
+ this.setValue(JSP_CONFIG, value);
}
+
//
- public JspConfig getJspConfig()
- {
- return (JspConfig)this.getValue(JSP_CONFIG);
+ public JspConfig getJspConfig() {
+ return (JspConfig) this.getValue(JSP_CONFIG);
}
+
// This attribute is optional
- public void setLocaleCharsetInfo(LocaleCharsetInfo value)
- {
- this.setValue(LOCALE_CHARSET_INFO, value);
+ public void setLocaleCharsetInfo(LocaleCharsetInfo value) {
+ this.setValue(LOCALE_CHARSET_INFO, value);
}
+
//
- public LocaleCharsetInfo getLocaleCharsetInfo()
- {
- return (LocaleCharsetInfo)this.getValue(LOCALE_CHARSET_INFO);
+ public LocaleCharsetInfo getLocaleCharsetInfo() {
+ return (LocaleCharsetInfo) this.getValue(LOCALE_CHARSET_INFO);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ @Override
+ public boolean verify() {
+ return true;
}
+
// This attribute is optional
- public void setParameterEncoding(boolean value)
- {
+ public void setParameterEncoding(boolean value) {
this.setValue(PARAMETER_ENCODING, Boolean.valueOf(value));
}
+
//
- public boolean isParameterEncoding()
- {
- Boolean ret = (Boolean)this.getValue(PARAMETER_ENCODING);
+ public boolean isParameterEncoding() {
+ Boolean ret = (Boolean) this.getValue(PARAMETER_ENCODING);
if (ret == null) {
return false;
}
return ret.booleanValue();
}
+
// This attribute is a valve to be added at the specified index
public void setValve(int index, Valve value) {
this.setValue(VALVE, index, value);
}
+
// The return value is the valve at the specified index
public Valve getValve(int index) {
- return (Valve)this.getValue(VALVE, index);
+ return (Valve) this.getValue(VALVE, index);
}
+
// This attribute is an array, possibly empty
public void setValve(Valve[] value) {
this.setValue(VALVE, value);
}
+
// This return value is an array, possibly empty
public Valve[] getValve() {
- return (Valve[])this.getValues(VALVE);
+ return (Valve[]) this.getValues(VALVE);
}
+
// Return the number of valves
public int sizeValve() {
return this.size(VALVE);
}
+
// Add a new element returning its index in the list
public int addValve(Valve value) {
return this.addValue(VALVE, value);
}
+
// Remove an element using its reference
public int removeValve(Valve value) {
return this.removeValue(VALVE, value);
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Valve.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Valve.java
index 9315544..9fe6bf2 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Valve.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/Valve.java
@@ -21,4 +21,3 @@
static public final String CLASS_NAME = "ClassName";
}
-
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebProperty.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebProperty.java
index 9ea8361..3e79d87 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebProperty.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebProperty.java
@@ -19,14 +19,14 @@
import com.sun.enterprise.deployment.runtime.RuntimeDescriptor;
/**
-* Interface for all web property containers
-*
-* @author Jerome Dochez
-*/
-public class WebProperty extends RuntimeDescriptor
-{
- static public final String NAME = "name"; // NOI18N
- static public final String VALUE = "value"; // NOI18N
+ * Interface for all web property containers
+ *
+ * @author Jerome Dochez
+ */
+public class WebProperty extends RuntimeDescriptor {
+
+ static public final String NAME = "name"; // NOI18N
+ static public final String VALUE = "value"; // NOI18N
// description handled at Descriptor
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebPropertyContainer.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebPropertyContainer.java
index 89dc476..dd7fd2f 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebPropertyContainer.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/deployment/runtime/WebPropertyContainer.java
@@ -25,75 +25,74 @@
*/
public class WebPropertyContainer extends RuntimeDescriptor {
- static public final String NAME = "Name"; // NOI18N
- static public final String VALUE = "Value"; // NOI18N
- static public final String PROPERTY = "WebProperty"; // NOI18N
+ static public final String NAME = "Name"; // NOI18N
+ static public final String VALUE = "Value"; // NOI18N
+ static public final String PROPERTY = "WebProperty"; // NOI18N
// copy constructor
- public WebPropertyContainer(WebPropertyContainer other)
- {
- super(other);
+ public WebPropertyContainer(WebPropertyContainer other) {
+ super(other);
}
+
// constructor
- public WebPropertyContainer()
- {
- super();
+ public WebPropertyContainer() {
+ super();
}
+
// This attribute is an array, possibly empty
- public void setWebProperty(int index, WebProperty value)
- {
- this.setValue(PROPERTY, index, value);
+ public void setWebProperty(int index, WebProperty value) {
+ this.setValue(PROPERTY, index, value);
}
+
//
- public WebProperty getWebProperty(int index)
- {
- return (WebProperty)this.getValue(PROPERTY, index);
+ public WebProperty getWebProperty(int index) {
+ return (WebProperty) this.getValue(PROPERTY, index);
}
+
// This attribute is an array, possibly empty
- public void setWebProperty(WebProperty[] value)
- {
- this.setValue(PROPERTY, value);
+ public void setWebProperty(WebProperty[] value) {
+ this.setValue(PROPERTY, value);
}
+
//
- public WebProperty[] getWebProperty()
- {
- WebProperty[] props = (WebProperty[])this.getValues(PROPERTY);
- if (props==null) {
+ public WebProperty[] getWebProperty() {
+ WebProperty[] props = (WebProperty[]) this.getValues(PROPERTY);
+ if (props == null) {
return new WebProperty[0];
} else {
return props;
}
}
+
// Return the number of properties
- public int sizeWebProperty()
- {
- return this.size(PROPERTY);
+ public int sizeWebProperty() {
+ return this.size(PROPERTY);
}
+
// Add a new element returning its index in the list
- public int addWebProperty(WebProperty value)
- {
- return this.addValue(PROPERTY, value);
+ public int addWebProperty(WebProperty value) {
+ return this.addValue(PROPERTY, value);
}
+
//
// Remove an element using its reference
// Returns the index the element had in the list
//
- public int removeWebProperty(WebProperty value)
- {
- return this.removeValue(PROPERTY, value);
+ public int removeWebProperty(WebProperty value) {
+ return this.removeValue(PROPERTY, value);
}
+
// This method verifies that the mandatory properties are set
- public boolean verify()
- {
- return true;
+ public boolean verify() {
+ return true;
}
}
diff --git a/appserver/web/web-glue/src/main/java/org/glassfish/web/jsp/JSPCompiler.java b/appserver/web/web-glue/src/main/java/org/glassfish/web/jsp/JSPCompiler.java
index 4da293e..ee5ebe9 100644
--- a/appserver/web/web-glue/src/main/java/org/glassfish/web/jsp/JSPCompiler.java
+++ b/appserver/web/web-glue/src/main/java/org/glassfish/web/jsp/JSPCompiler.java
@@ -35,16 +35,7 @@
import com.sun.enterprise.deployment.WebBundleDescriptor;
import com.sun.enterprise.deployment.WebComponentDescriptor;
import com.sun.enterprise.deployment.web.InitializationParameter;
-import com.sun.enterprise.util.LocalStringManagerImpl;
import com.sun.enterprise.util.io.FileUtils;
-import org.apache.jasper.JspC;
-import org.glassfish.deployment.common.DeploymentException;
-import org.glassfish.internal.api.ServerContext;
-import org.glassfish.loader.util.ASClassLoaderUtil;
-import org.glassfish.web.LogFacade;
-import org.glassfish.web.deployment.runtime.JspConfig;
-import org.glassfish.web.deployment.runtime.SunWebAppImpl;
-import org.glassfish.web.deployment.runtime.WebProperty;
import java.io.File;
import java.util.Enumeration;
@@ -54,11 +45,19 @@
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.apache.jasper.JspC;
+import org.glassfish.deployment.common.DeploymentException;
+import org.glassfish.internal.api.ServerContext;
+import org.glassfish.loader.util.ASClassLoaderUtil;
+import org.glassfish.web.LogFacade;
+import org.glassfish.web.deployment.runtime.JspConfig;
+import org.glassfish.web.deployment.runtime.SunWebAppImpl;
+import org.glassfish.web.deployment.runtime.WebProperty;
+
public final class JSPCompiler {
- public static void compile(File inWebDir, File outWebDir,
- WebBundleDescriptor wbd, ServerContext serverContext)
- throws DeploymentException {
+ public static void compile(File inWebDir, File outWebDir, WebBundleDescriptor wbd, ServerContext serverContext)
+ throws DeploymentException {
//to resolve ambiguity
final String amb = null;
compile(inWebDir, outWebDir, wbd, amb, serverContext);
@@ -108,11 +107,9 @@
try {
jspc.execute();
- }
- catch (Exception je) {
+ } catch (Exception je) {
throw new DeploymentException("JSP Compilation Error: " + je, je);
- }
- finally {
+ } finally {
// bnevins 9-9-03 -- There may be no jsp files in this web-module
// in such a case the code above will create a useless, and possibly
// problematic empty directory. If the directory is empty -- delete
@@ -153,8 +150,9 @@
////////////////////////////////////////////////////////////////////////////
private static String getClasspath(List paths) {
- if(paths == null)
+ if (paths == null) {
return null;
+ }
String classpath = null;
@@ -163,24 +161,25 @@
for (Iterator it = paths.iterator(); it.hasNext(); ) {
String path = (String)it.next();
-
- if (first)
+ if (first) {
first = false;
- else
+ } else {
sb.append(File.pathSeparatorChar);
+ }
sb.append(path);
}
- if (sb.length() > 0)
+ if (sb.length() > 0) {
classpath = sb.toString();
+ }
return classpath;
}
////////////////////////////////////////////////////////////////////////////
- /*
+ /**
* Configures the given JspC instance with the jsp-config properties
* specified in the sun-web.xml of the web module represented by the
* given WebBundleDescriptor.
@@ -189,115 +188,105 @@
* @param wbd WebBundleDescriptor of the web module whose sun-web.xml
* is used to configure the given JspC instance
*/
- private static void configureJspc(JspC jspc, WebBundleDescriptor wbd) {
+ private static void configureJspc(JspC jspc, WebBundleDescriptor wbd) {
- SunWebAppImpl sunWebApp = (SunWebAppImpl) wbd.getSunDescriptor();
- if (sunWebApp == null) {
- return;
- }
-
- // START SJSAS 6384538
- if (sunWebApp.sizeWebProperty() > 0) {
- WebProperty[] props = sunWebApp.getWebProperty();
- for (int i = 0; i < props.length; i++) {
- String pName = props[i].getAttributeValue("name");
- String pValue = props[i].getAttributeValue("value");
- if (pName == null || pValue == null) {
- throw new IllegalArgumentException(
- "Missing sun-web-app property name or value");
- }
- if ("enableTldValidation".equals(pName)) {
- jspc.setIsValidationEnabled(
- Boolean.valueOf(pValue).booleanValue());
- }
- }
- }
- // END SJSAS 6384538
-
- // START SJSAS 6170435
- /*
- * Configure JspC with the init params of the JspServlet
- */
- Set<WebComponentDescriptor> set = wbd.getWebComponentDescriptors();
- if (!set.isEmpty()) {
- Iterator<WebComponentDescriptor> iterator = set.iterator();
- while (iterator.hasNext()) {
- WebComponentDescriptor webComponentDesc = iterator.next();
- if ("jsp".equals(webComponentDesc.getCanonicalName())) {
- Enumeration<InitializationParameter> en
- = webComponentDesc.getInitializationParameters();
- if (en != null) {
- while (en.hasMoreElements()) {
- InitializationParameter initP = en.nextElement();
- configureJspc(jspc,
- initP.getName(),
- initP.getValue());
- }
- }
- break;
- }
- }
- }
- // END SJSAS 6170435
-
- /*
- * Configure JspC with jsp-config properties from sun-web.xml,
- * which override JspServlet init params of the same name.
- */
- JspConfig jspConfig = sunWebApp.getJspConfig();
- if (jspConfig == null) {
- return;
- }
- WebProperty[] props = jspConfig.getWebProperty();
- for (int i=0; props!=null && i<props.length; i++) {
- configureJspc(jspc,
- props[i].getAttributeValue("name"),
- props[i].getAttributeValue("value"));
- }
+ SunWebAppImpl sunWebApp = (SunWebAppImpl) wbd.getSunDescriptor();
+ if (sunWebApp == null) {
+ return;
}
+ // START SJSAS 6384538
+ if (sunWebApp.sizeWebProperty() > 0) {
+ WebProperty[] props = sunWebApp.getWebProperty();
+ for (int i = 0; i < props.length; i++) {
+ String pName = props[i].getAttributeValue("name");
+ String pValue = props[i].getAttributeValue("value");
+ if (pName == null || pValue == null) {
+ throw new IllegalArgumentException(
+ "Missing sun-web-app property name or value");
+ }
+ if ("enableTldValidation".equals(pName)) {
+ jspc.setIsValidationEnabled(
+ Boolean.valueOf(pValue).booleanValue());
+ }
+ }
+ }
+ // END SJSAS 6384538
+
+ // START SJSAS 6170435
+ /*
+ * Configure JspC with the init params of the JspServlet
+ */
+ Set<WebComponentDescriptor> set = wbd.getWebComponentDescriptors();
+ if (!set.isEmpty()) {
+ Iterator<WebComponentDescriptor> iterator = set.iterator();
+ while (iterator.hasNext()) {
+ WebComponentDescriptor webComponentDesc = iterator.next();
+ if ("jsp".equals(webComponentDesc.getCanonicalName())) {
+ Enumeration<InitializationParameter> en
+ = webComponentDesc.getInitializationParameters();
+ if (en != null) {
+ while (en.hasMoreElements()) {
+ InitializationParameter initP = en.nextElement();
+ configureJspc(jspc, initP.getName(), initP.getValue());
+ }
+ }
+ break;
+ }
+ }
+ }
+ // END SJSAS 6170435
/*
- * Configures the given JspC instance with the given property name
- * and value.
- *
- * @jspc The JspC instance to configure
- * @pName The property name
- * @pValue The property value
+ * Configure JspC with jsp-config properties from sun-web.xml,
+ * which override JspServlet init params of the same name.
*/
- private static void configureJspc(JspC jspc, String pName,
- String pValue) {
-
- if (pName == null || pValue == null) {
- throw new IllegalArgumentException(
- "Null property name or value");
- }
-
- if ("xpoweredBy".equals(pName)) {
- jspc.setXpoweredBy(Boolean.valueOf(pValue).booleanValue());
- } else if ("classdebuginfo".equals(pName)) {
- jspc.setClassDebugInfo(Boolean.valueOf(pValue).booleanValue());
- } else if ("enablePooling".equals(pName)) {
- jspc.setPoolingEnabled(Boolean.valueOf(pValue).booleanValue());
- } else if ("ieClassId".equals(pName)) {
- jspc.setIeClassId(pValue);
- } else if ("trimSpaces".equals(pName)) {
- jspc.setTrimSpaces(Boolean.valueOf(pValue).booleanValue());
- } else if ("genStrAsCharArray".equals(pName)) {
- jspc.setGenStringAsCharArray(
- Boolean.valueOf(pValue).booleanValue());
- } else if ("errorOnUseBeanInvalidClassAttribute".equals(pName)) {
- jspc.setErrorOnUseBeanInvalidClassAttribute(
- Boolean.valueOf(pValue).booleanValue());
- } else if ("ignoreJspFragmentErrors".equals(pName)) {
- jspc.setIgnoreJspFragmentErrors(
- Boolean.valueOf(pValue).booleanValue());
- } else if ("compilerSourceVM".equals(pName)) {
- jspc.setCompilerSourceVM(pValue);
- } else if ("compilerTargetVM".equals(pName)) {
- jspc.setCompilerTargetVM(pValue);
- }
+ JspConfig jspConfig = sunWebApp.getJspConfig();
+ if (jspConfig == null) {
+ return;
}
+ WebProperty[] props = jspConfig.getWebProperty();
+ for (int i=0; props!=null && i<props.length; i++) {
+ configureJspc(jspc, props[i].getAttributeValue("name"), props[i].getAttributeValue("value"));
+ }
+ }
+
+
+ /**
+ * Configures the given JspC instance with the given property name
+ * and value.
+ *
+ * @jspc The JspC instance to configure
+ * @pName The property name
+ * @pValue The property value
+ */
+ private static void configureJspc(JspC jspc, String pName, String pValue) {
+ if (pName == null || pValue == null) {
+ throw new IllegalArgumentException("Null property name or value");
+ }
+
+ if ("xpoweredBy".equals(pName)) {
+ jspc.setXpoweredBy(Boolean.valueOf(pValue).booleanValue());
+ } else if ("classdebuginfo".equals(pName)) {
+ jspc.setClassDebugInfo(Boolean.valueOf(pValue).booleanValue());
+ } else if ("enablePooling".equals(pName)) {
+ jspc.setPoolingEnabled(Boolean.valueOf(pValue).booleanValue());
+ } else if ("ieClassId".equals(pName)) {
+ jspc.setIeClassId(pValue);
+ } else if ("trimSpaces".equals(pName)) {
+ jspc.setTrimSpaces(Boolean.valueOf(pValue).booleanValue());
+ } else if ("genStrAsCharArray".equals(pName)) {
+ jspc.setGenStringAsCharArray(Boolean.valueOf(pValue).booleanValue());
+ } else if ("errorOnUseBeanInvalidClassAttribute".equals(pName)) {
+ jspc.setErrorOnUseBeanInvalidClassAttribute(Boolean.valueOf(pValue).booleanValue());
+ } else if ("ignoreJspFragmentErrors".equals(pName)) {
+ jspc.setIgnoreJspFragmentErrors(Boolean.valueOf(pValue).booleanValue());
+ } else if ("compilerSourceVM".equals(pName)) {
+ jspc.setCompilerSourceVM(pValue);
+ } else if ("compilerTargetVM".equals(pName)) {
+ jspc.setCompilerTargetVM(pValue);
+ }
+ }
////////////////////////////////////////////////////////////////////////////
diff --git a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/ReplicationManager.java b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/ReplicationManager.java
index 6eb0e96..570fc74 100644
--- a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/ReplicationManager.java
+++ b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/ReplicationManager.java
@@ -27,8 +27,6 @@
import org.glassfish.ha.store.api.BackingStore;
import org.glassfish.ha.store.api.BackingStoreException;
-import java.util.concurrent.CountDownLatch;
-
/**
*
* @author Larry White
@@ -36,27 +34,26 @@
*/
public interface ReplicationManager {
- public String getApplicationId();
+ String getApplicationId();
- public Object getReplicationSessionMonitor(String id);
+ Object getReplicationSessionMonitor(String id);
// public void processMessage(ReplicationState message);
//
// public void processQueryMessage(ReplicationState message, String returnInstance);
- public void repair(long repairStartTime);
+ void repair(long repairStartTime);
- public void repair(long repairStartTime, boolean checkForStopping);
+ void repair(long repairStartTime, boolean checkForStopping);
- public void respondToFailure(String instanceName, boolean checkForStopping);
+ void respondToFailure(String instanceName, boolean checkForStopping);
// public <V> V __load(String id, String version, JxtaBackingStoreImpl jxtaBackingStore)
// throws BackingStoreException;
- public <V> V __load(String id, String version, BackingStore backingStore)
- throws BackingStoreException;
+<V> V __load(String id, String version, BackingStore backingStore) throws BackingStoreException;
- public int processExpiredSessions();
+ int processExpiredSessions();
}
diff --git a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SessionFactory.java b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SessionFactory.java
index f59a166..3dc08f7 100644
--- a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SessionFactory.java
+++ b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SessionFactory.java
@@ -31,6 +31,6 @@
*/
public interface SessionFactory {
- public Session createSession(Manager mgr);
+ Session createSession(Manager mgr);
}
diff --git a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SimpleMetadataFactory.java b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SimpleMetadataFactory.java
index bf680b0..79dc6dc 100644
--- a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SimpleMetadataFactory.java
+++ b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/SimpleMetadataFactory.java
@@ -21,22 +21,19 @@
/**
* @author Mahesh Kannan
* @author Rajiv Mordani
- *
*/
-public class
- SimpleMetadataFactory {
+public class SimpleMetadataFactory {
- //Full save
- public static SimpleMetadata createSimpleMetadata(long version, long lastAccessTime,
- long maxInactiveInterval, byte[] state) {
+ // Full save
+ public static SimpleMetadata createSimpleMetadata(long version, long lastAccessTime, long maxInactiveInterval, byte[] state) {
return new SimpleMetadata(version, lastAccessTime, maxInactiveInterval, state);
}
- //Full save
- //updateTimeStamp
+
+ // Full save
+ // updateTimeStamp
public static SimpleMetadata createSimpleMetadata(long version, long lastAccessTime) {
return new SimpleMetadata(version, lastAccessTime, 0, null);
}
-
}
diff --git a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/WebEventPersistentManager.java b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/WebEventPersistentManager.java
index 4ae4503..3225dd0 100644
--- a/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/WebEventPersistentManager.java
+++ b/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/session/management/WebEventPersistentManager.java
@@ -31,6 +31,6 @@
*/
public interface WebEventPersistentManager {
- public void doValveSave(Session session);
+ void doValveSave(Session session);
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/NamingContext.java b/appserver/web/web-naming/src/main/java/org/apache/naming/NamingContext.java
index 979caeb..885e2d2 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/NamingContext.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/NamingContext.java
@@ -237,11 +237,12 @@
throws NamingException {
checkWritable();
- while ((!name.isEmpty()) && (name.get(0).length() == 0))
- name = name.getSuffix(1);
- if (name.isEmpty())
- throw new NamingException(
- rb.getString(LogFacade.INVALID_NAME));
+ while ((!name.isEmpty()) && (name.get(0).length() == 0)) {
+ name = name.getSuffix(1);
+ }
+ if (name.isEmpty()) {
+ throw new NamingException(rb.getString(LogFacade.INVALID_NAME));
+ }
NamingEntry entry = bindings.get(name.get(0));
@@ -443,36 +444,33 @@
*/
public void destroySubcontext(Name name)
throws NamingException {
-
checkWritable();
- while ((!name.isEmpty()) && (name.get(0).length() == 0))
- name = name.getSuffix(1);
- if (name.isEmpty())
- throw new NamingException(
- rb.getString(LogFacade.INVALID_NAME));
+ while ((!name.isEmpty()) && (name.get(0).length() == 0)) {
+ name = name.getSuffix(1);
+ }
+ if (name.isEmpty()) {
+ throw new NamingException(rb.getString(LogFacade.INVALID_NAME));
+ }
NamingEntry entry = bindings.get(name.get(0));
if (entry == null) {
- throw new NameNotFoundException(
- MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
+ throw new NameNotFoundException(MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
}
if (name.size() > 1) {
if (entry.type == NamingEntry.CONTEXT) {
((Context) entry.value).destroySubcontext(name.getSuffix(1));
} else {
- throw new NamingException(
- rb.getString(LogFacade.CONTEXT_EXPECTED));
+ throw new NamingException(rb.getString(LogFacade.CONTEXT_EXPECTED));
}
} else {
if (entry.type == NamingEntry.CONTEXT) {
((Context) entry.value).close();
bindings.remove(name.get(0));
} else {
- throw new NotContextException(
- rb.getString(LogFacade.CONTEXT_EXPECTED));
+ throw new NotContextException(rb.getString(LogFacade.CONTEXT_EXPECTED));
}
}
@@ -582,18 +580,19 @@
public NameParser getNameParser(Name name)
throws NamingException {
- while ((!name.isEmpty()) && (name.get(0).length() == 0))
- name = name.getSuffix(1);
- if (name.isEmpty())
+ while ((!name.isEmpty()) && (name.get(0).length() == 0)) {
+ name = name.getSuffix(1);
+ }
+ if (name.isEmpty()) {
return nameParser;
+ }
if (name.size() > 1) {
Object obj = bindings.get(name.get(0));
if (obj instanceof Context) {
return ((Context) obj).getNameParser(name.getSuffix(1));
} else {
- throw new NotContextException(
- rb.getString(LogFacade.CONTEXT_EXPECTED));
+ throw new NotContextException(rb.getString(LogFacade.CONTEXT_EXPECTED));
}
}
@@ -633,8 +632,8 @@
*/
public Name composeName(Name name, Name prefix)
throws NamingException {
- prefix = (Name) prefix.clone();
- return prefix.addAll(name);
+ prefix = (Name) prefix.clone();
+ return prefix.addAll(name);
}
@@ -752,57 +751,52 @@
throws NamingException {
// Removing empty parts
- while ((!name.isEmpty()) && (name.get(0).length() == 0))
+ while ((!name.isEmpty()) && (name.get(0).length() == 0)) {
name = name.getSuffix(1);
+ }
if (name.isEmpty()) {
// If name is empty, a newly allocated naming context is returned
return new NamingContext(env, this.name, bindings);
}
- NamingEntry entry = (NamingEntry) bindings.get(name.get(0));
+ NamingEntry entry = bindings.get(name.get(0));
if (entry == null) {
- throw new NameNotFoundException(
- MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
+ throw new NameNotFoundException(MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
}
if (name.size() > 1) {
// If the size of the name is greater that 1, then we go through a
// number of subcontexts.
if (entry.type != NamingEntry.CONTEXT) {
- throw new NamingException(
- rb.getString(LogFacade.CONTEXT_EXPECTED));
+ throw new NamingException(rb.getString(LogFacade.CONTEXT_EXPECTED));
}
return ((Context) entry.value).lookup(name.getSuffix(1));
- } else {
- if ((resolveLinks) && (entry.type == NamingEntry.LINK_REF)) {
- String link = ((LinkRef) entry.value).getLinkName();
- if (link.startsWith(".")) {
- // Link relative to this context
- return lookup(link.substring(1));
- } else {
- return (new InitialContext(env)).lookup(link);
- }
- } else if (entry.type == NamingEntry.REFERENCE) {
- try {
- Object obj = NamingManager.getObjectInstance
- (entry.value, name, this, env);
- if (obj != null) {
- entry.value = obj;
- entry.type = NamingEntry.ENTRY;
- }
- return obj;
- } catch (NamingException e) {
- throw e;
- } catch (Exception e) {
- logger.log(Level.WARNING,
- LogFacade.FAIL_RESOLVING_REFERENCE,
- e);
- throw new NamingException(e.getMessage());
- }
- } else {
- return entry.value;
+ }
+ if ((resolveLinks) && (entry.type == NamingEntry.LINK_REF)) {
+ String link = ((LinkRef) entry.value).getLinkName();
+ if (link.startsWith(".")) {
+ // Link relative to this context
+ return lookup(link.substring(1));
}
+ return new InitialContext(env).lookup(link);
+ } else if (entry.type == NamingEntry.REFERENCE) {
+ try {
+ Object obj = NamingManager.getObjectInstance
+ (entry.value, name, this, env);
+ if (obj != null) {
+ entry.value = obj;
+ entry.type = NamingEntry.ENTRY;
+ }
+ return obj;
+ } catch (NamingException e) {
+ throw e;
+ } catch (Exception e) {
+ logger.log(Level.WARNING, LogFacade.FAIL_RESOLVING_REFERENCE, e);
+ throw new NamingException(e.getMessage());
+ }
+ } else {
+ return entry.value;
}
}
@@ -826,18 +820,18 @@
checkWritable();
- while ((!name.isEmpty()) && (name.get(0).length() == 0))
- name = name.getSuffix(1);
- if (name.isEmpty())
- throw new NamingException(
- rb.getString(LogFacade.INVALID_NAME));
+ while ((!name.isEmpty()) && (name.get(0).length() == 0)) {
+ name = name.getSuffix(1);
+ }
+ if (name.isEmpty()) {
+ throw new NamingException(rb.getString(LogFacade.INVALID_NAME));
+ }
- NamingEntry entry = (NamingEntry) bindings.get(name.get(0));
+ NamingEntry entry = bindings.get(name.get(0));
if (name.size() > 1) {
if (entry == null) {
- throw new NameNotFoundException(
- MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
+ throw new NameNotFoundException(MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));
}
if (entry.type == NamingEntry.CONTEXT) {
if (rebind) {
@@ -846,37 +840,28 @@
((Context) entry.value).bind(name.getSuffix(1), obj);
}
} else {
- throw new NamingException(
- rb.getString(LogFacade.CONTEXT_EXPECTED));
+ throw new NamingException(rb.getString(LogFacade.CONTEXT_EXPECTED));
}
} else {
if ((!rebind) && (entry != null)) {
- throw new NamingException(
- MessageFormat.format(rb.getString(LogFacade.ALREADY_BOUND), name.get(0)));
- } else {
- // Getting the type of the object and wrapping it within a new
- // NamingEntry
- Object toBind =
- NamingManager.getStateToBind(obj, name, this, env);
- if (toBind instanceof Context) {
- entry = new NamingEntry(name.get(0), toBind,
- NamingEntry.CONTEXT);
- } else if (toBind instanceof LinkRef) {
- entry = new NamingEntry(name.get(0), toBind,
- NamingEntry.LINK_REF);
- } else if (toBind instanceof Reference) {
- entry = new NamingEntry(name.get(0), toBind,
- NamingEntry.REFERENCE);
- } else if (toBind instanceof Referenceable) {
- toBind = ((Referenceable) toBind).getReference();
- entry = new NamingEntry(name.get(0), toBind,
- NamingEntry.REFERENCE);
- } else {
- entry = new NamingEntry(name.get(0), toBind,
- NamingEntry.ENTRY);
- }
- bindings.put(name.get(0), entry);
+ throw new NamingException(MessageFormat.format(rb.getString(LogFacade.ALREADY_BOUND), name.get(0)));
}
+ // Getting the type of the object and wrapping it within a new
+ // NamingEntry
+ Object toBind = NamingManager.getStateToBind(obj, name, this, env);
+ if (toBind instanceof Context) {
+ entry = new NamingEntry(name.get(0), toBind, NamingEntry.CONTEXT);
+ } else if (toBind instanceof LinkRef) {
+ entry = new NamingEntry(name.get(0), toBind, NamingEntry.LINK_REF);
+ } else if (toBind instanceof Reference) {
+ entry = new NamingEntry(name.get(0), toBind, NamingEntry.REFERENCE);
+ } else if (toBind instanceof Referenceable) {
+ toBind = ((Referenceable) toBind).getReference();
+ entry = new NamingEntry(name.get(0), toBind, NamingEntry.REFERENCE);
+ } else {
+ entry = new NamingEntry(name.get(0), toBind, NamingEntry.ENTRY);
+ }
+ bindings.put(name.get(0), entry);
}
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/NamingServiceMBean.java b/appserver/web/web-naming/src/main/java/org/apache/naming/NamingServiceMBean.java
index 8664f32..17a6fda 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/NamingServiceMBean.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/NamingServiceMBean.java
@@ -30,19 +30,19 @@
// -------------------------------------------------------------- Constants
- public static enum State { STOPPED, STOPPING, STARTING, STARTED }
+ public enum State { STOPPED, STOPPING, STARTING, STARTED }
/**
* Component name.
*/
- public static final String NAME = "Apache JNDI Naming Service";
+ String NAME = "Apache JNDI Naming Service";
/**
* Object name.
*/
- public static final String OBJECT_NAME = ":service=Naming";
+ String OBJECT_NAME = ":service=Naming";
// ------------------------------------------------------ Interface Methods
@@ -51,32 +51,31 @@
/**
* Retruns the JNDI component name.
*/
- public String getName();
+ String getName();
/**
* Returns the state.
*/
- public State getState();
+ State getState();
/**
* Start the servlet container.
*/
- public void start()
- throws Exception;
+ void start() throws Exception;
/**
* Stop the servlet container.
*/
- public void stop();
+ void stop();
/**
* Destroy servlet container (if any is running).
*/
- public void destroy();
+ void destroy();
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/SelectorContext.java b/appserver/web/web-naming/src/main/java/org/apache/naming/SelectorContext.java
index dc38c14..b8b5d5d 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/SelectorContext.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/SelectorContext.java
@@ -611,9 +611,7 @@
/**
* Get the bound context.
*/
- protected Context getBoundContext()
- throws NamingException {
-
+ protected Context getBoundContext() throws NamingException {
if (initialContext) {
String ICName = IC_PREFIX;
if (ContextBindings.isThreadBound()) {
@@ -647,20 +645,16 @@
* @exception NamingException if there is no "java:" header or if no
* naming context has been bound to this thread
*/
- protected String parseName(String name)
- throws NamingException {
-
- if ((!initialContext) && (name.startsWith(prefix))) {
+ protected String parseName(String name) throws NamingException {
+ if ((!initialContext) && (name.startsWith(prefix))) {
return (name.substring(prefixLength));
} else {
if (initialContext) {
return (name);
} else {
- throw new NamingException
- (rb.getString(LogFacade.NO_JAVA_URL));
+ throw new NamingException(rb.getString(LogFacade.NO_JAVA_URL));
}
}
-
}
@@ -671,23 +665,17 @@
* @exception NamingException if there is no "java:" header or if no
* naming context has been bound to this thread
*/
- protected Name parseName(Name name)
- throws NamingException {
-
- if ((!initialContext) && (!name.isEmpty())
- && (name.get(0).equals(prefix))) {
+ protected Name parseName(Name name) throws NamingException {
+ if ((!initialContext) && (!name.isEmpty()) && (name.get(0).equals(prefix))) {
return (name.getSuffix(1));
} else {
if (initialContext) {
return (name);
} else {
- throw new NamingException
- (rb.getString(LogFacade.NO_JAVA_URL));
+ throw new NamingException(rb.getString(LogFacade.NO_JAVA_URL));
}
}
}
-
-
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/StringManager.java b/appserver/web/web-naming/src/main/java/org/apache/naming/StringManager.java
index 694cf15..ee71c0d 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/StringManager.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/StringManager.java
@@ -51,7 +51,6 @@
/**
* The ResourceBundle for this StringManager.
*/
-
private ResourceBundle bundle;
/**
@@ -62,11 +61,10 @@
*
* @param packageName Name of package to create StringManager for.
*/
-
private StringManager(String packageName) {
- String bundleName = packageName + ".LocalStrings";
+ String bundleName = packageName + ".LocalStrings";
ClassLoader cl = this.getClass().getClassLoader();
- bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault(), cl);
+ bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault(), cl);
}
/**
@@ -74,18 +72,16 @@
*
* @param key
*/
-
public String getString(String key) {
if (key == null) {
String msg = "key is null";
-
throw new NullPointerException(msg);
}
String str = null;
try {
- str = bundle.getString(key);
+ str = bundle.getString(key);
} catch (MissingResourceException mre) {
str = "Cannot find message associated with key '" + key + "'";
}
@@ -100,36 +96,38 @@
* @param key
* @param args
*/
-
public String getString(String key, Object[] args) {
- String iString = null;
+ String iString = null;
String value = getString(key);
- // this check for the runtime exception is some pre 1.1.6
- // VM's don't do an automatic toString() on the passed in
- // objects and barf out
+ // this check for the runtime exception is some pre 1.1.6
+ // VM's don't do an automatic toString() on the passed in
+ // objects and barf out
- try {
+ try {
// ensure the arguments are not null so pre 1.2 VM's don't barf
Object nonNullArgs[] = args;
for (int i=0; i<args.length; i++) {
- if (args[i] == null) {
- if (nonNullArgs==args) nonNullArgs = args.clone();
- nonNullArgs[i] = "null";
- }
- }
+ if (args[i] == null) {
+ if (nonNullArgs==args) {
+ nonNullArgs = args.clone();
+ }
+ nonNullArgs[i] = "null";
+ }
+ }
iString = MessageFormat.format(value, nonNullArgs);
- } catch (IllegalArgumentException iae) {
- StringBuilder buf = new StringBuilder();
- buf.append(value);
- for (int i = 0; i < args.length; i++) {
- buf.append(" arg[" + i + "]=" + args[i]);
+ } catch (IllegalArgumentException iae) {
+ StringBuilder buf = new StringBuilder();
+ buf.append(value);
+ for (int i = 0; i < args.length; i++) {
+ buf.append(" arg[" + i + "]=" + args[i]);
+ }
+ iString = buf.toString();
}
- iString = buf.toString();
+ return iString;
}
- return iString;
- }
+
/**
* Get a string from the underlying resource bundle and format it
@@ -141,10 +139,11 @@
*/
public String getString(String key, Object arg) {
- Object[] args = new Object[] {arg};
- return getString(key, args);
+ Object[] args = new Object[] {arg};
+ return getString(key, args);
}
+
/**
* Get a string from the underlying resource bundle and format it
* with the given object arguments. These arguments can of course
@@ -156,10 +155,11 @@
*/
public String getString(String key, Object arg1, Object arg2) {
- Object[] args = new Object[] {arg1, arg2};
- return getString(key, args);
+ Object[] args = new Object[] {arg1, arg2};
+ return getString(key, args);
}
+
/**
* Get a string from the underlying resource bundle and format it
* with the given object arguments. These arguments can of course
@@ -171,12 +171,12 @@
* @param arg3
*/
- public String getString(String key, Object arg1, Object arg2,
- Object arg3) {
- Object[] args = new Object[] {arg1, arg2, arg3};
- return getString(key, args);
+ public String getString(String key, Object arg1, Object arg2, Object arg3) {
+ Object[] args = new Object[] {arg1, arg2, arg3};
+ return getString(key, args);
}
+
/**
* Get a string from the underlying resource bundle and format it
* with the given object arguments. These arguments can of course
@@ -189,17 +189,15 @@
* @param arg4
*/
- public String getString(String key, Object arg1, Object arg2,
- Object arg3, Object arg4) {
- Object[] args = new Object[] {arg1, arg2, arg3, arg4};
- return getString(key, args);
+ public String getString(String key, Object arg1, Object arg2, Object arg3, Object arg4) {
+ Object[] args = new Object[] {arg1, arg2, arg3, arg4};
+ return getString(key, args);
}
// --------------------------------------------------------------
// STATIC SUPPORT METHODS
// --------------------------------------------------------------
- private static Hashtable<String, StringManager> managers =
- new Hashtable<String, StringManager>();
+ private static Hashtable<String, StringManager> managers = new Hashtable<>();
/**
* Get the StringManager for a particular package. If a manager for
@@ -208,13 +206,12 @@
*
* @param packageName
*/
-
public synchronized static StringManager getManager(String packageName) {
- StringManager mgr = managers.get(packageName);
- if (mgr == null) {
- mgr = new StringManager(packageName);
- managers.put(packageName, mgr);
- }
- return mgr;
+ StringManager mgr = managers.get(packageName);
+ if (mgr == null) {
+ mgr = new StringManager(packageName);
+ managers.put(packageName, mgr);
+ }
+ return mgr;
}
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/TransactionRef.java b/appserver/web/web-naming/src/main/java/org/apache/naming/TransactionRef.java
index 9ad84e5..55782bf 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/TransactionRef.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/TransactionRef.java
@@ -17,10 +17,8 @@
package org.apache.naming;
-import java.util.Hashtable;
-import javax.naming.Reference;
import javax.naming.Context;
-import javax.naming.StringRefAddr;
+import javax.naming.Reference;
/**
* Represents a reference address to a transaction.
@@ -29,9 +27,7 @@
* @version $Revision: 1.2 $ $Date: 2005/12/08 01:29:05 $
*/
-public class TransactionRef
- extends Reference {
-
+public class TransactionRef extends Reference {
// -------------------------------------------------------------- Constants
@@ -75,6 +71,7 @@
* Retrieves the class name of the factory of the object to which this
* reference refers.
*/
+ @Override
public String getFactoryClassName() {
String factory = super.getFactoryClassName();
if (factory != null) {
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/factory/MailSessionFactory.java b/appserver/web/web-naming/src/main/java/org/apache/naming/factory/MailSessionFactory.java
index 60eea8d..11e3ac0 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/factory/MailSessionFactory.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/factory/MailSessionFactory.java
@@ -86,41 +86,40 @@
*
* @exception Exception if an error occurs during object creation
*/
- public Object getObjectInstance(Object refObj, Name name, Context context,
- Hashtable<?,?> env) throws Exception
- {
+ @Override
+ public Object getObjectInstance(Object refObj, Name name, Context context, Hashtable<?, ?> env) throws Exception {
// Return null if we cannot create an object of the requested type
- final Reference ref = (Reference) refObj;
- if (!ref.getClassName().equals(factoryType))
+ final Reference ref = (Reference) refObj;
+ if (!ref.getClassName().equals(factoryType)) {
return (null);
+ }
// Create a new Session inside a doPrivileged block, so that Jakarta
// Mail can read its default properties without throwing Security
// exceptions
- return AccessController.doPrivileged( new PrivilegedAction<Session>() {
- public Session run() {
+ return AccessController.doPrivileged(new PrivilegedAction<Session>() {
- // Create the Jakarta Mail properties we will use
- Properties props = new Properties();
- props.put("mail.transport.protocol", "smtp");
- props.put("mail.smtp.host", "localhost");
- Enumeration<RefAddr> attrs = ref.getAll();
- while (attrs.hasMoreElements()) {
- RefAddr attr = attrs.nextElement();
- if ("factory".equals(attr.getType()))
- continue;
- props.put(attr.getType(), attr.getContent());
+ @Override
+ public Session run() {
+ // Create the Jakarta Mail properties we will use
+ Properties props = new Properties();
+ props.put("mail.transport.protocol", "smtp");
+ props.put("mail.smtp.host", "localhost");
+ Enumeration<RefAddr> attrs = ref.getAll();
+ while (attrs.hasMoreElements()) {
+ RefAddr attr = attrs.nextElement();
+ if ("factory".equals(attr.getType())) {
+ continue;
}
+ props.put(attr.getType(), attr.getContent());
+ }
- // Create and return the new Session object
- Session session = Session.getInstance(props, null);
- return (session);
+ // Create and return the new Session object
+ Session session = Session.getInstance(props, null);
+ return (session);
- }
- } );
-
+ }
+ });
}
-
-
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/factory/SendMailFactory.java b/appserver/web/web-naming/src/main/java/org/apache/naming/factory/SendMailFactory.java
index 3577872..cfacc02 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/factory/SendMailFactory.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/factory/SendMailFactory.java
@@ -73,57 +73,52 @@
* @author Glenn Nielsen Rich Catlett
*/
-public class SendMailFactory implements ObjectFactory
-{
+public class SendMailFactory implements ObjectFactory {
+
// The class name for the javamail MimeMessageDataSource
- protected static final String DataSourceClassName =
- "jakarta.mail.internet.MimePartDataSource";
+ protected static final String DataSourceClassName = "jakarta.mail.internet.MimePartDataSource";
- public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx,
- Hashtable<?,?> Env) throws Exception
- {
- final Reference Ref = (Reference)RefObj;
+ @Override
+ public Object getObjectInstance(Object RefObj, Name Nm, Context Ctx, Hashtable<?, ?> Env) throws Exception {
+ final Reference Ref = (Reference) RefObj;
- // Creation of the DataSource is wrapped inside a doPrivileged
- // so that Jakarta Mail can read its default properties without
- // throwing Security Exceptions
- if (Ref.getClassName().equals(DataSourceClassName)) {
- return AccessController.doPrivileged(
- new PrivilegedAction<MimePartDataSource>()
- {
- public MimePartDataSource run() {
- // set up the smtp session that will send the message
- Properties props = new Properties();
- // enumeration of all refaddr
- Enumeration<RefAddr> list = Ref.getAll();
- // current refaddr to be set
- RefAddr refaddr;
- // set transport to smtp
- props.put("mail.transport.protocol", "smtp");
+ // Creation of the DataSource is wrapped inside a doPrivileged
+ // so that Jakarta Mail can read its default properties without
+ // throwing Security Exceptions
+ if (Ref.getClassName().equals(DataSourceClassName)) {
+ return AccessController.doPrivileged(new PrivilegedAction<MimePartDataSource>() {
- while (list.hasMoreElements()) {
- refaddr = list.nextElement();
+ @Override
+ public MimePartDataSource run() {
+ // set up the smtp session that will send the message
+ Properties props = new Properties();
+ // enumeration of all refaddr
+ Enumeration<RefAddr> list = Ref.getAll();
+ // current refaddr to be set
+ RefAddr refaddr;
+ // set transport to smtp
+ props.put("mail.transport.protocol", "smtp");
- // set property
- props.put(refaddr.getType(), refaddr.getContent());
- }
- try {
- MimeMessage message = new MimeMessage(
- Session.getInstance(props));
- String from = (String)Ref.get("mail.from").getContent();
- message.setFrom(new InternetAddress(from));
- message.setSubject("");
- MimePartDataSource mds = new MimePartDataSource(
- (MimePart)message);
+ while (list.hasMoreElements()) {
+ refaddr = list.nextElement();
+
+ // set property
+ props.put(refaddr.getType(), refaddr.getContent());
+ }
+ try {
+ MimeMessage message = new MimeMessage(Session.getInstance(props));
+ String from = (String) Ref.get("mail.from").getContent();
+ message.setFrom(new InternetAddress(from));
+ message.setSubject("");
+ MimePartDataSource mds = new MimePartDataSource(message);
return mds;
- } catch (Exception e) {
+ } catch (Exception e) {
return null;
}
+ }
+ });
+ } else { // We can't create an instance of the DataSource
+ return null;
}
- } );
- }
- else { // We can't create an instance of the DataSource
- return null;
- }
}
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/resources/BaseDirContext.java b/appserver/web/web-naming/src/main/java/org/apache/naming/resources/BaseDirContext.java
index 102fc77..3883504 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/resources/BaseDirContext.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/resources/BaseDirContext.java
@@ -109,12 +109,11 @@
// ------------------------------------------------------------- Properties
-
/**
* Return the debugging detail level for this component.
*/
public int getDebug() {
- return (this.debug);
+ return (this.debug);
}
@@ -124,7 +123,7 @@
* @param debug The new debugging detail level
*/
public void setDebug(int debug) {
- this.debug = debug;
+ this.debug = debug;
}
@@ -132,7 +131,7 @@
* Return the document root for this component.
*/
public String getDocBase() {
- return (this.docBase);
+ return (this.docBase);
}
@@ -140,22 +139,19 @@
* Set the document root for this component.
*
* @param docBase The new document root
- *
* @exception IllegalArgumentException if the specified value is not
- * supported by this implementation
+ * supported by this implementation
* @exception IllegalArgumentException if this would create a
- * malformed URL
+ * malformed URL
*/
public void setDocBase(String docBase) {
+ // Validate the format of the proposed document root
+ if (docBase == null) {
+ throw new IllegalArgumentException(rb.getString(LogFacade.RESOURCES_NULL));
+ }
- // Validate the format of the proposed document root
- if (docBase == null)
- throw new IllegalArgumentException
- (rb.getString(LogFacade.RESOURCES_NULL));
-
- // Change the document root property
- this.docBase = docBase;
-
+ // Change the document root property
+ this.docBase = docBase;
}
@@ -617,8 +613,8 @@
*/
public Name composeName(Name name, Name prefix)
throws NamingException {
- prefix = (Name) prefix.clone();
- return prefix.addAll(name);
+ prefix = (Name) prefix.clone();
+ return prefix.addAll(name);
}
@@ -1232,7 +1228,5 @@
// ------------------------------------------------------ Protected Methods
-
-
}
diff --git a/appserver/web/web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java b/appserver/web/web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
index 8deb3b0..c75480d 100644
--- a/appserver/web/web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
+++ b/appserver/web/web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
@@ -117,27 +117,25 @@
* malformed URL
*/
public void setDocBase(String docBase) {
+ // Validate the format of the proposed document root
+ if (docBase == null) {
+ throw new IllegalArgumentException(rb.getString(LogFacade.RESOURCES_NULL));
+ }
+ if (!(docBase.endsWith(".war"))) {
+ throw new IllegalArgumentException(rb.getString(LogFacade.NOT_WAR));
+ }
- // Validate the format of the proposed document root
- if (docBase == null)
- throw new IllegalArgumentException
- (rb.getString(LogFacade.RESOURCES_NULL));
- if (!(docBase.endsWith(".war")))
- throw new IllegalArgumentException
- (rb.getString(LogFacade.NOT_WAR));
+ // Calculate a File object referencing this document base directory
+ File base = new File(docBase);
- // Calculate a File object referencing this document base directory
- File base = new File(docBase);
-
- // Validate that the document base is an existing directory
- if (!base.exists() || !base.canRead() || base.isDirectory())
- throw new IllegalArgumentException
- (rb.getString(LogFacade.NOT_WAR));
+ // Validate that the document base is an existing directory
+ if (!base.exists() || !base.canRead() || base.isDirectory())
+ throw new IllegalArgumentException(rb.getString(LogFacade.NOT_WAR));
try {
this.base = new ZipFile(base);
} catch (Exception e) {
- throw new IllegalArgumentException
- (MessageFormat.format(rb.getString(LogFacade.INVALID_WAR), e.getMessage()));
+ throw new IllegalArgumentException(
+ MessageFormat.format(rb.getString(LogFacade.INVALID_WAR), e.getMessage()));
}
super.setDocBase(docBase);
@@ -145,7 +143,6 @@
}
-
// --------------------------------------------------------- Public Methods
@@ -195,19 +192,20 @@
* @return the object bound to name
* @exception NamingException if a naming exception is encountered
*/
- public Object lookup(Name name)
- throws NamingException {
- if (name.isEmpty())
+ public Object lookup(Name name) throws NamingException {
+ if (name.isEmpty()) {
return this;
+ }
Entry entry = treeLookup(name);
- if (entry == null)
- throw new NamingException
- (MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ if (entry == null) {
+ throw new NamingException(MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ }
ZipEntry zipEntry = entry.getEntry();
- if (zipEntry.isDirectory())
+ if (zipEntry.isDirectory()) {
return new WARDirContext(base, entry);
- else
+ } else {
return new WARResource(entry.getEntry());
+ }
}
@@ -282,12 +280,13 @@
*/
public NamingEnumeration<NameClassPair> list(Name name)
throws NamingException {
- if (name.isEmpty())
+ if (name.isEmpty()) {
return new NamingContextEnumeration(list(entries).iterator());
+ }
Entry entry = treeLookup(name);
- if (entry == null)
- throw new NamingException
- (MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ if (entry == null) {
+ throw new NamingException(MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ }
return new NamingContextEnumeration(list(entry).iterator());
}
@@ -326,12 +325,13 @@
*/
public NamingEnumeration<Binding> listBindings(Name name)
throws NamingException {
- if (name.isEmpty())
+ if (name.isEmpty()) {
return new NamingContextBindingsEnumeration(list(entries).iterator(), this);
+ }
Entry entry = treeLookup(name);
- if (entry == null)
- throw new NamingException
- (MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ if (entry == null) {
+ throw new NamingException(MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ }
return new NamingContextBindingsEnumeration(list(entry).iterator(), this);
}
@@ -440,21 +440,23 @@
throws NamingException {
Entry entry = null;
- if (name.isEmpty())
+ if (name.isEmpty()) {
entry = entries;
- else
+ } else {
entry = treeLookup(name);
- if (entry == null)
- throw new NamingException
- (MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ }
+ if (entry == null) {
+ throw new NamingException(MessageFormat.format(rb.getString(LogFacade.RESOURCES_NOT_FOUND), name));
+ }
ZipEntry zipEntry = entry.getEntry();
ResourceAttributes attrs = new ResourceAttributes();
attrs.setCreationDate(new Date(zipEntry.getTime()));
attrs.setName(entry.getName());
- if (!zipEntry.isDirectory())
+ if (!zipEntry.isDirectory()) {
attrs.setResourceType("");
+ }
attrs.setContentLength(zipEntry.getSize());
attrs.setLastModified(new Date(zipEntry.getTime()));
@@ -786,15 +788,18 @@
* Entry tree lookup.
*/
protected Entry treeLookup(Name name) {
- if (name.isEmpty() || entries == null)
+ if (name.isEmpty() || entries == null) {
return entries;
+ }
Entry currentEntry = entries;
for (int i = 0; i < name.size(); i++) {
- if (name.get(i).length() == 0)
+ if (name.get(i).length() == 0) {
continue;
+ }
currentEntry = currentEntry.getChild(name.get(i));
- if (currentEntry == null)
+ if (currentEntry == null) {
return null;
+ }
}
return currentEntry;
}
@@ -818,8 +823,7 @@
} else {
object = new WARResource(current);
}
- namingEntry = new NamingEntry
- (children[i].getName(), object, NamingEntry.ENTRY);
+ namingEntry = new NamingEntry(children[i].getName(), object, NamingEntry.ENTRY);
entries.add(namingEntry);
}
@@ -862,8 +866,9 @@
@Override
public int compareTo(Object o) {
- if (!(o instanceof Entry))
+ if (!(o instanceof Entry)) {
return (+1);
+ }
return (name.compareTo(((Entry) o).getName()));
}
@@ -892,8 +897,9 @@
public void addChild(Entry entry) {
Entry[] newChildren = new Entry[children.length + 1];
- for (int i = 0; i < children.length; i++)
+ for (int i = 0; i < children.length; i++) {
newChildren[i] = children[i];
+ }
newChildren[children.length] = entry;
children = newChildren;
}
@@ -962,10 +968,6 @@
}
return super.streamContent();
}
-
-
}
-
-
}
diff --git a/appserver/web/weld-integration-test-fragment/pom.xml b/appserver/web/weld-integration-test-fragment/pom.xml
index 1f6144e..acb924e 100644
--- a/appserver/web/weld-integration-test-fragment/pom.xml
+++ b/appserver/web/weld-integration-test-fragment/pom.xml
@@ -20,7 +20,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.glassfish.main.web</groupId>
+ <groupId>org.glassfish.main.web</groupId>
<artifactId>web</artifactId>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
diff --git a/appserver/web/weld-integration/pom.xml b/appserver/web/weld-integration/pom.xml
index 5e5e491..eb138e8 100644
--- a/appserver/web/weld-integration/pom.xml
+++ b/appserver/web/weld-integration/pom.xml
@@ -20,7 +20,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.glassfish.main.web</groupId>
+ <groupId>org.glassfish.main.web</groupId>
<artifactId>web</artifactId>
<version>6.1.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>