Author: remy.maucherat(a)jboss.com
Date: 2012-09-27 10:22:46 -0400 (Thu, 27 Sep 2012)
New Revision: 2090
Added:
branches/7.2.x/src/main/java/org/jboss/web/NamingLogger.java
branches/7.2.x/src/main/java/org/jboss/web/NamingMessages.java
Removed:
branches/7.2.x/src/main/java/org/apache/naming/LocalStrings.properties
branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_es.properties
branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_fr.properties
branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_ja.properties
branches/7.2.x/src/main/java/org/apache/naming/StringManager.java
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings.properties
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_es.properties
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_fr.properties
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_ja.properties
Modified:
branches/7.2.x/src/main/java/org/apache/jasper/servlet/JasperLoader.java
branches/7.2.x/src/main/java/org/apache/naming/resources/AliasDirContext.java
branches/7.2.x/src/main/java/org/apache/naming/resources/BaseDirContext.java
branches/7.2.x/src/main/java/org/apache/naming/resources/FileDirContext.java
branches/7.2.x/src/main/java/org/apache/naming/resources/JARDirContext.java
branches/7.2.x/src/main/java/org/apache/naming/resources/ProxyDirContext.java
branches/7.2.x/src/main/java/org/apache/naming/resources/WARDirContext.java
branches/7.2.x/src/main/java/org/jboss/web/ELLogger.java
branches/7.2.x/src/main/java/org/jboss/web/ELMessages.java
branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java
Log:
Add some missing strings, will review for more
Modified: branches/7.2.x/src/main/java/org/apache/jasper/servlet/JasperLoader.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/jasper/servlet/JasperLoader.java 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/jasper/servlet/JasperLoader.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -17,6 +17,8 @@
package org.apache.jasper.servlet;
+import static org.jboss.web.JasperMessages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -118,9 +120,7 @@
dot));
}
} catch (SecurityException se) {
- String error = "Security Violation, attempt to use "
- + "Restricted Class: " + name;
- throw new ClassNotFoundException(error, se);
+ throw new
ClassNotFoundException(MESSAGES.securityExceptionLoadingClass(name), se);
}
}
}
Deleted: branches/7.2.x/src/main/java/org/apache/naming/LocalStrings.properties
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/LocalStrings.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/LocalStrings.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,11 +0,0 @@
-contextBindings.unknownContext=Unknown context name : {0}
-contextBindings.noContextBoundToThread=No naming context bound to this thread
-contextBindings.noContextBoundToCL=No naming context bound to this class loader
-selectorContext.noJavaUrl=This context must be accessed throught a java: URL
-namingContext.contextExpected=Name is not bound to a Context
-namingContext.failResolvingReference=Unexpected exception resolving reference
-namingContext.nameNotBound=Name {0} is not bound in this Context
-namingContext.readOnly=Context is read only
-namingContext.invalidName=Name is not valid
-namingContext.alreadyBound=Name {0} is already bound in this Context
-namingContext.noAbsoluteName=Can''t generate an absolute name for this namespace
\ No newline at end of file
Deleted: branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_es.properties
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_es.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_es.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# $Id: LocalStrings_es.properties 789 2008-09-22 16:52:37Z remy.maucherat(a)jboss.com $
-# language es
-# package org.apache.naming
-contextBindings.unknownContext = Contexto {0} desconocido
-contextBindings.noContextBoundToThread = No hay contexto de nombres asociado a este hilo
-contextBindings.noContextBoundToCL = No hay contexto de nombres asociado a este cargador
de clase
-selectorContext.noJavaUrl = Este contexto debe de ser accedido a traves de una URL de
tipo java\:
-namingContext.contextExpected = El nombre no esta asociado a ningun Contexto
-namingContext.failResolvingReference = Excepci\u00F3n inesperada resolviendo referencia
-namingContext.nameNotBound = El nombre {0} no este asociado a este contexto
-namingContext.readOnly = El contexto es de solo lectura
-namingContext.invalidName = Nombre no valido
-namingContext.alreadyBound = El nombre {0} este ya asociado en este Contexto
-namingContext.noAbsoluteName = No se puede generar un nombre absoluto para este espacio
de nombres
Deleted: branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_fr.properties
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_fr.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_fr.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,11 +0,0 @@
-contextBindings.unknownContext=Nom de Contexte inconnu : {0}
-contextBindings.noContextBoundToThread=Aucun Contexte de nommage li� � ce thread
-contextBindings.noContextBoundToCL=Aucun Contexte de nommage li� � ce chargeur de
classes
-selectorContext.noJavaUrl=Ce Contexte doit �tre acc�d� par une java: URL
-namingContext.contextExpected=Le Nom n''est pas li� � un Contexte
-namingContext.failResolvingReference=Une erreur s est produite durant la r�solution de la
r�f�rence
-namingContext.nameNotBound=Le Nom {0} n''est pas li� � ce Contexte
-namingContext.readOnly=Le Contexte est en lecture seule
-namingContext.invalidName=Le Nom est invalide
-namingContext.alreadyBound=Le Nom {0} est d�j� li� � ce Contexte
-namingContext.noAbsoluteName=Impossible de g�n�rer un nom absolu pour cet espace de
nommage (namespace)
\ No newline at end of file
Deleted: branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_ja.properties
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_ja.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/LocalStrings_ja.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,11 +0,0 @@
-contextBindings.unknownContext=\u672a\u77e5\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u540d\u3067\u3059:
{0}
-contextBindings.noContextBoundToThread=\u540d\u524d\u4ed8\u3051\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u3053\u306e\u30b9\u30ec\u30c3\u30c9\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-contextBindings.noContextBoundToCL=\u540d\u524d\u4ed8\u3051\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u3053\u306e\u30af\u30e9\u30b9\u30ed\u30fc\u30c0\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-selectorContext.noJavaUrl=\u3053\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u306fjava:
URL\u3092\u7528\u3044\u3066\u30a2\u30af\u30bb\u30b9\u3055\u308c\u306d\u3070\u3044\u3051\u307e\u305b\u3093
-namingContext.contextExpected=\u540d\u524d\u304c\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-namingContext.failResolvingReference=\u53c2\u7167\u306e\u89e3\u6c7a\u4e2d\u306b\u4e88\u6e2c\u3057\u306a\u3044\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f
-namingContext.nameNotBound=\u540d\u524d {0}
\u306f\u3053\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-namingContext.readOnly=\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306f\u30ea\u30fc\u30c9\u30aa\u30f3\u30ea\u30fc\u3067\u3059
-namingContext.invalidName=\u540d\u524d\u306f\u7121\u52b9\u3067\u3059
-namingContext.alreadyBound=\u540d\u524d {0}
\u306f\u65e2\u306b\u3053\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u3059
-namingContext.noAbsoluteName=\u3053\u306e\u540d\u524d\u7a7a\u9593\u306b\u7d76\u5bfe\u540d\u3092\u751f\u6210\u3067\u304d\u307e\u305b\u3093
Deleted: branches/7.2.x/src/main/java/org/apache/naming/StringManager.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/StringManager.java 2012-09-26 17:13:02
UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/StringManager.java 2012-09-27 14:22:46
UTC (rev 2090)
@@ -1,225 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.naming;
-
-import java.text.MessageFormat;
-import java.util.Hashtable;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * An internationalization / localization helper class which reduces
- * the bother of handling ResourceBundles and takes care of the
- * common cases of message formating which otherwise require the
- * creation of Object arrays and such.
- *
- * <p>The StringManager operates on a package basis. One StringManager
- * per package can be created and accessed via the getManager method
- * call.
- *
- * <p>The StringManager will look for a ResourceBundle named by
- * the package name given plus the suffix of "LocalStrings". In
- * practice, this means that the localized information will be contained
- * in a LocalStrings.properties file located in the package
- * directory of the classpath.
- *
- * <p>Please see the documentation for java.util.ResourceBundle for
- * more information.
- *
- * @author James Duncan Davidson [duncan(a)eng.sun.com]
- * @author James Todd [gonzo(a)eng.sun.com]
- */
-
-public class StringManager {
-
- /**
- * The ResourceBundle for this StringManager.
- */
-
- private ResourceBundle bundle;
-
- /**
- * Creates a new StringManager for a given package. This is a
- * private method and all access to it is arbitrated by the
- * static getManager method call so that only one StringManager
- * per package will be created.
- *
- * @param packageName Name of package to create StringManager for.
- */
-
- private StringManager(String packageName) {
- String bundleName = packageName + ".LocalStrings";
- try {
- bundle = ResourceBundle.getBundle(bundleName);
- } catch (MissingResourceException mre) {
- // Ignore
- }
- }
-
- /**
- * Get a string from the underlying resource bundle.
- *
- * @param key
- */
-
- public String getString(String key) {
- if (key == null) {
- String msg = "key is null";
-
- throw new NullPointerException(msg);
- }
- if (bundle == null) {
- return key;
- }
-
- String str = null;
-
- try {
- str = bundle.getString(key);
- } catch (MissingResourceException mre) {
- str = "Cannot find message associated with key '" + key +
"'";
- }
-
- return str;
- }
-
- /**
- * Get a string from the underlying resource bundle and format
- * it with the given set of arguments.
- *
- * @param key
- * @param args
- */
-
- public String getString(String key, Object[] args) {
- 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
-
- 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=(Object[])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]);
- }
- iString = buf.toString();
- }
- return iString;
- }
-
- /**
- * Get a string from the underlying resource bundle and format it
- * with the given object argument. This argument can of course be
- * a String object.
- *
- * @param key
- * @param arg
- */
-
- public String getString(String key, Object arg) {
- 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
- * be String objects.
- *
- * @param key
- * @param arg1
- * @param arg2
- */
-
- public String getString(String key, Object arg1, Object arg2) {
- 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
- * be String objects.
- *
- * @param key
- * @param arg1
- * @param arg2
- * @param arg3
- */
-
- 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
- * be String objects.
- *
- * @param key
- * @param arg1
- * @param arg2
- * @param arg3
- * @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);
- }
- // --------------------------------------------------------------
- // STATIC SUPPORT METHODS
- // --------------------------------------------------------------
-
- private static Hashtable managers = new Hashtable();
-
- /**
- * Get the StringManager for a particular package. If a manager for
- * a package already exists, it will be reused, else a new
- * StringManager will be created and returned.
- *
- * @param packageName
- */
-
- public synchronized static StringManager getManager(String packageName) {
- StringManager mgr = (StringManager)managers.get(packageName);
- if (mgr == null) {
- mgr = new StringManager(packageName);
- managers.put(packageName, mgr);
- }
- return mgr;
- }
-}
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/AliasDirContext.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/AliasDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/AliasDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -18,6 +18,8 @@
package org.apache.naming.resources;
+import static org.jboss.web.NamingMessages.MESSAGES;
+
import java.io.File;
import java.util.Hashtable;
import java.util.Iterator;
@@ -58,8 +60,7 @@
*/
public void addAlias(String path, BaseDirContext dirContext) {
if (!path.startsWith("/")) {
- throw new IllegalArgumentException(
- sm.getString("resources.invalidAliasPath", path));
+ throw MESSAGES.invalidAliasPath(path);
}
aliases.put(path, dirContext);
}
@@ -70,8 +71,7 @@
*/
public void removeAlias(String path) {
if (!path.startsWith("/")) {
- throw new IllegalArgumentException(
- sm.getString("resources.invalidAliasPath", path));
+ throw MESSAGES.invalidAliasPath(path);
}
aliases.remove(path);
}
@@ -121,10 +121,10 @@
for (String kvp : kvps) {
String[] kv = kvp.split("=");
if (kv.length != 2 || kv[0].length() == 0 || kv[1].length() == 0)
- throw new
IllegalArgumentException(sm.getString("resources.invalidAliasMapping", kvp));
+ throw MESSAGES.invalidAliasMapping(kvp);
File aliasLoc = new File(kv[1]);
if (!aliasLoc.exists()) {
- throw new
IllegalArgumentException(sm.getString("resources.invalidAliasNotExist",
kv[1]));
+ throw MESSAGES.aliasNotFound(kv[1]);
}
BaseDirContext context;
if (kv[1].endsWith(".war") && !(aliasLoc.isDirectory())) {
@@ -132,7 +132,7 @@
} else if (aliasLoc.isDirectory()) {
context = new FileDirContext();
} else {
- throw new
IllegalArgumentException(sm.getString("resources.invalidAliasFile", kv[1]));
+ throw MESSAGES.aliasNotFolder(kv[1]);
}
context.setDocBase(kv[1]);
addAlias(kv[0], context);
@@ -175,7 +175,7 @@
if (result.dirContext != null) {
return result.dirContext.lookup(result.aliasName);
}
- throw new NameNotFoundException(sm.getString("resources.notFound",
name));
+ throw new NameNotFoundException(MESSAGES.resourceNotFound(name));
}
public Object lookup(Name name) throws NamingException {
@@ -195,7 +195,7 @@
if (result.dirContext != null) {
return result.dirContext.list(result.aliasName);
}
- throw new NameNotFoundException(sm.getString("resources.notFound",
name));
+ throw new NameNotFoundException(MESSAGES.resourceNotFound(name));
}
public NamingEnumeration list(Name name) throws NamingException {
@@ -207,7 +207,7 @@
if (result.dirContext != null) {
return result.dirContext.listBindings(result.aliasName);
}
- throw new NameNotFoundException(sm.getString("resources.notFound",
name));
+ throw new NameNotFoundException(MESSAGES.resourceNotFound(name));
}
public NamingEnumeration listBindings(Name name) throws NamingException {
@@ -232,7 +232,7 @@
if (result.dirContext != null) {
return result.dirContext.getAttributes(result.aliasName, attrIds);
}
- throw new NameNotFoundException(sm.getString("resources.notFound",
name));
+ throw new NameNotFoundException(MESSAGES.resourceNotFound(name));
}
public Attributes getAttributes(Name name, String[] attrIds) throws NamingException
{
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/BaseDirContext.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/BaseDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/BaseDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -18,6 +18,8 @@
package org.apache.naming.resources;
+import static org.jboss.web.NamingMessages.MESSAGES;
+
import java.util.Hashtable;
import javax.naming.Context;
@@ -31,7 +33,6 @@
import javax.naming.directory.SearchControls;
import org.apache.naming.NameParserImpl;
-import org.apache.naming.StringManager;
/**
* Directory Context implementation helper class.
@@ -81,12 +82,6 @@
/**
- * The string manager for this package.
- */
- protected StringManager sm = StringManager.getManager(Constants.Package);
-
-
- /**
* Name parser for this context.
*/
protected final NameParser nameParser = new NameParserImpl();
@@ -141,8 +136,7 @@
// Validate the format of the proposed document root
if (docBase == null)
- throw new IllegalArgumentException
- (sm.getString("resources.null"));
+ throw MESSAGES.invalidNullDocumentBase();
// Change the document root property
this.docBase = docBase;
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/FileDirContext.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/FileDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/FileDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -18,6 +18,8 @@
package org.apache.naming.resources;
+import static org.jboss.web.NamingMessages.MESSAGES;
+
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
@@ -47,6 +49,7 @@
import org.apache.naming.NamingContextBindingsEnumeration;
import org.apache.naming.NamingContextEnumeration;
import org.apache.naming.NamingEntry;
+import org.jboss.web.NamingLogger;
/**
* Filesystem Directory Context implementation helper class.
@@ -57,9 +60,6 @@
public class FileDirContext extends BaseDirContext {
- private static org.jboss.logging.Logger log=
- org.jboss.logging.Logger.getLogger( FileDirContext.class );
-
// -------------------------------------------------------------- Constants
@@ -132,8 +132,7 @@
// Validate the format of the proposed document root
if (docBase == null)
- throw new IllegalArgumentException
- (sm.getString("resources.null"));
+ throw MESSAGES.invalidNullDocumentBase();
// Calculate a File object referencing this document base directory
base = new File(docBase);
@@ -145,8 +144,7 @@
// Validate that the document base is an existing directory
if (!base.exists() || !base.isDirectory() || !base.canRead())
- throw new IllegalArgumentException
- (sm.getString("fileResources.base", docBase));
+ throw MESSAGES.invalidBaseFolder(docBase);
this.absoluteBase = base.getAbsolutePath();
super.setDocBase(docBase);
@@ -213,7 +211,7 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name));
if (file.isDirectory()) {
FileDirContext tempContext = new FileDirContext(env);
@@ -251,11 +249,11 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name));
if (!file.delete())
throw new NamingException
- (sm.getString("resources.unbindFailed", name));
+ (MESSAGES.resourceUnbindFailed(name));
}
@@ -278,7 +276,7 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", oldName));
+ (MESSAGES.resourceNotFound(oldName));
File newFile = new File(base, newName);
@@ -307,7 +305,7 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name));
return new NamingContextEnumeration(list(file).iterator());
@@ -334,7 +332,7 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name));
return new NamingContextBindingsEnumeration(list(file).iterator(),
this);
@@ -436,7 +434,7 @@
if (file == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name));
return new FileResourceAttributes(file);
@@ -506,7 +504,7 @@
File file = new File(base, name);
if (file.exists())
throw new NameAlreadyBoundException
- (sm.getString("resources.alreadyBound", name));
+ (MESSAGES.resourceAlreadyBound(name));
rebind(name, obj, attrs);
@@ -551,15 +549,15 @@
if (file.exists()) {
if (!file.delete())
throw new NamingException
- (sm.getString("resources.bindFailed", name));
+ (MESSAGES.resourceBindFailed(name));
}
if (!file.mkdir())
throw new NamingException
- (sm.getString("resources.bindFailed", name));
+ (MESSAGES.resourceBindFailed(name));
}
if (is == null)
throw new NamingException
- (sm.getString("resources.bindFailed", name));
+ (MESSAGES.resourceBindFailed(name));
// Open os
@@ -582,7 +580,7 @@
}
} catch (IOException e) {
NamingException ne = new NamingException
- (sm.getString("resources.bindFailed", e));
+ (MESSAGES.resourceBindFailed(name));
ne.initCause(e);
throw ne;
}
@@ -613,10 +611,10 @@
File file = new File(base, name);
if (file.exists())
throw new NameAlreadyBoundException
- (sm.getString("resources.alreadyBound", name));
+ (MESSAGES.resourceAlreadyBound(name));
if (!file.mkdir())
throw new NamingException
- (sm.getString("resources.bindFailed", name));
+ (MESSAGES.resourceBindFailed(name));
return (DirContext) lookup(name);
}
@@ -843,8 +841,7 @@
if (names==null) {
/* Some IO error occurred such as bad file permissions.
Prevent a NPE with Arrays.sort(names) */
- log.warn(sm.getString("fileResources.listingNull",
- file.getAbsolutePath()));
+ NamingLogger.ROOT_LOGGER.failedListingFolder(file.getAbsolutePath());
return entries;
}
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/JARDirContext.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/resources/JARDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/resources/JARDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -18,6 +18,8 @@
package org.apache.naming.resources;
+import static org.jboss.web.NamingMessages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
@@ -61,9 +63,6 @@
public class JARDirContext extends BaseDirContext {
- private static org.jboss.logging.Logger log =
- org.jboss.logging.Logger.getLogger(JARDirContext.class);
-
// ----------------------------------------------------------- Constructors
@@ -125,8 +124,7 @@
// Validate the format of the proposed document root
if (jarFile == null)
- throw new IllegalArgumentException
- (sm.getString("resources.null"));
+ throw MESSAGES.invalidNullDocumentBase();
this.prefix = prefix;
if (prefix.startsWith("/")) {
@@ -189,7 +187,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
ZipEntry zipEntry = entry.getEntry();
if (zipEntry.isDirectory())
return new JARDirContext(base, entry);
@@ -274,7 +272,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
return new NamingContextEnumeration(list(entry).iterator());
}
@@ -319,7 +317,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
return new NamingContextBindingsEnumeration(list(entry).iterator(),
this);
}
@@ -435,7 +433,7 @@
entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
ZipEntry zipEntry = entry.getEntry();
Deleted: branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings.properties
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,25 +0,0 @@
-fileResources.base=Document base {0} does not exist or is not a readable directory
-fileResources.listingNull=Could not get dir listing for {0}
-warResources.notWar=Doc base must point to a WAR file
-warResources.invalidWar=Invalid or unreadable WAR file : {0}
-jarResources.syntax=Document base {0} must start with ''jar:'' and end
with ''!/''
-resources.alreadyStarted=Resources has already been started
-resources.connect=Cannot connect to document base {0}
-resources.input=Cannot create input stream for resource {0}
-resources.notStarted=Resources has not yet been started
-resources.null=Document base cannot be null
-resources.notFound=Resource {0} not found
-resources.path=Context relative path {0} must start with ''/''
-resources.alreadyBound=Name {0} is already bound in this Context
-resources.bindFailed=Bind failed: {0}
-resources.unbindFailed=Unbind failed: {0}
-resources.invalidAliasPath=Alias path {0} is invalid
-resources.invalidAliasMapping=Invalid alias mapping {0}
-resources.invalidAliasNotExist=Aliased path {0} does not exist
-resources.invalidAliasFile=Aliased path {0} is not a folder
-standardResources.alreadyStarted=Resources has already been started
-standardResources.directory=File base {0} is not a directory
-standardResources.exists=File base {0} does not exist
-standardResources.notStarted=Resources has not yet been started
-standardResources.null=Document base cannot be null
-standardResources.slash=Document base {0} must not end with a slash
Deleted:
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_es.properties
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_es.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_es.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,35 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-#
http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-fileResources.base = El Documento base {0} no existe o no es un directorio legible
-fileResources.listingNull = No pude obtener lista de directorio para {0}
-warResources.notWar = Doc base debe de apuntar a un archivo WAR
-warResources.invalidWar = Archivo WAR inv\u00E1lido o ilegible\: {0}
-jarResources.syntax = Documento base {0} debe de empezar con ''jar\:'' y
acabar con ''\!/''
-resources.alreadyStarted = Ya han sido arrancados los Recursos
-resources.connect = No puedo conectar a documento base {0}
-resources.input = No puedo crear flujo (stream) de entrada para recurso {0}
-resources.notStarted = A\u00FAn no han sido arrancados los Recursos
-resources.null = El Documento base no puede ser nulo
-resources.notFound = Recurso {0} no hallado
-resources.path = Trayectoria relativa a contexto {0} debe de comenzar con
''/''
-resources.alreadyBound = El Nombre {0} ya ha sido cambiado (bound) en este Contexto
-resources.bindFailed = Fall\u00F3 el Cambio (Bind)\: {0}
-resources.unbindFailed = Fall\u00F3 el Descambio (Unbind)\: {0}
-standardResources.alreadyStarted = Ya han sido arrancados los Recursos
-standardResources.directory = El archivo base {0} no es un directorio
-standardResources.exists = El archivo base {0} no existe
-standardResources.notStarted = A\u00FAn no han sido arrancados los Recursos
-standardResources.null = El Documento base no puede ser nulo
-standardResources.slash = El Documento base {0} no debe de terminar con una barra
Deleted:
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_fr.properties
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_fr.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_fr.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,20 +0,0 @@
-fileResources.base=Le document base {0} n''existe pas ou n''est pas un
r�pertoire lisible
-warResources.notWar=Doc base doit point� vers un fichier WAR
-warResources.invalidWar=Fichier WAR invalide ou illisible : {0}
-jarResources.syntax=Le document base {0} doit commenc� par ''jar:'' et
finir avec ''!/''
-resources.alreadyStarted=Les Ressources ont d�j� �t� d�marr�es
-resources.connect=Impossible de se connecter au document base {0}
-resources.input=Impossible de cr�er l''input stream pour la ressource {0}
-resources.notStarted=Les ressources n''ont pas encore �t� d�marr�es
-resources.null=Le document base ne peut �tre nul
-resources.notFound=La ressource {0} est introuvable
-resources.path=Le chemin relatif de context {0} doit commenc� par ''/''
-resources.alreadyBound=Le nom {0} est d�j� r�f�renc� par ce contexte
-resources.bindFailed=Le liage a �chou�: {0}
-resources.unbindFailed=Le d�liage a �chou�: {0}
-standardResources.alreadyStarted=Les ressources ont d�ja �t� d�marr�es
-standardResources.directory=Le file base {0} n''est pas un r�pertoire
-standardResources.exists=Le file base {0} n''existe pas
-standardResources.notStarted=Les ressources n''ont pas encore �t� d�marr�es
-standardResources.null=Le document base ne peut �tre nul
-standardResources.slash=Le document base {0} ne doit pas se terminer par un
''/''
Deleted:
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_ja.properties
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_ja.properties 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/LocalStrings_ja.properties 2012-09-27
14:22:46 UTC (rev 2090)
@@ -1,21 +0,0 @@
-fileResources.base=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9 {0}
\u304c\u5b58\u5728\u3057\u306a\u3044\u3001\u53c8\u306f\u8aad\u3081\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3059
-fileResources.listingNull={0}
\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30ea\u30b9\u30c8\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093
-warResources.notWar=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9\u306fWAR\u30d5\u30a1\u30a4\u30eb\u3092\u793a\u3055\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093
-warResources.invalidWar=\u7121\u52b9\u53c8\u306f\u8aad\u3081\u306a\u3044WAR\u30d5\u30a1\u30a4\u30eb\u3067\u3059
: {0}
-jarResources.syntax=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9 {0}
\u306f''jar:''\u3067\u59cb\u307e\u308a\u3001''!/''\u3067\u7d42\u3089\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093
-resources.alreadyStarted=\u30ea\u30bd\u30fc\u30b9\u306f\u65e2\u306b\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u3059
-resources.connect=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9 {0}
\u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093
-resources.input=\u30ea\u30bd\u30fc\u30b9 {0}
\u306b\u5165\u529b\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093
-resources.notStarted=\u30ea\u30bd\u30fc\u30b9\u306f\u307e\u3060\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-resources.null=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9\u306fnull\u3067\u3042\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093
-resources.notFound=\u30ea\u30bd\u30fc\u30b9 {0}
\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093
-resources.path=\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u76f8\u5bfe\u30d1\u30b9 {0}
\u306f''/''\u3067\u59cb\u307e\u3089\u306a\u3051\u308c\u3070\u3044\u3051\u307e\u305b\u3093
-resources.alreadyBound=\u540d\u524d {0}
\u306f\u65e2\u306b\u3053\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u306b\u30d0\u30a4\u30f3\u30c9\u3055\u308c\u3066\u3044\u307e\u3059
-resources.bindFailed=\u30d0\u30a4\u30f3\u30c9\u304c\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-resources.unbindFailed=\u30a2\u30f3\u30d0\u30a4\u30f3\u30c9\u304c\u5931\u6557\u3057\u307e\u3057\u305f:
{0}
-standardResources.alreadyStarted=\u30ea\u30bd\u30fc\u30b9\u306f\u65e2\u306b\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u3059
-standardResources.directory=\u30d5\u30a1\u30a4\u30eb\u30d9\u30fc\u30b9 {0}
\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u306f\u3042\u308a\u307e\u305b\u3093
-standardResources.exists=\u30d5\u30a1\u30a4\u30eb\u30d9\u30fc\u30b9 {0}
\u306f\u5b58\u5728\u3057\u307e\u305b\u3093
-standardResources.notStarted=\u30ea\u30bd\u30fc\u30b9\u304c\u307e\u3060\u8d77\u52d5\u3055\u308c\u3066\u3044\u307e\u305b\u3093
-standardResources.null=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9\u306fnull\u3067\u3042\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093
-standardResources.slash=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u30d9\u30fc\u30b9 {0}
\u306f\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u7d42\u3063\u3066\u306f\u3044\u3051\u307e\u305b\u3093
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/ProxyDirContext.java
===================================================================
---
branches/7.2.x/src/main/java/org/apache/naming/resources/ProxyDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++
branches/7.2.x/src/main/java/org/apache/naming/resources/ProxyDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -46,7 +46,6 @@
import javax.naming.directory.SearchResult;
import org.apache.naming.NamingEnumerationImpl;
-import org.apache.naming.StringManager;
/**
* Proxy Directory Context implementation. This implementation looks up the
@@ -117,12 +116,6 @@
/**
- * The string manager for this package.
- */
- protected StringManager sm = StringManager.getManager(Constants.Package);
-
-
- /**
* Associated DirContext.
*/
protected DirContext dirContext;
Modified: branches/7.2.x/src/main/java/org/apache/naming/resources/WARDirContext.java
===================================================================
--- branches/7.2.x/src/main/java/org/apache/naming/resources/WARDirContext.java 2012-09-26
17:13:02 UTC (rev 2089)
+++ branches/7.2.x/src/main/java/org/apache/naming/resources/WARDirContext.java 2012-09-27
14:22:46 UTC (rev 2090)
@@ -18,6 +18,8 @@
package org.apache.naming.resources;
+import static org.jboss.web.NamingMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -43,6 +45,7 @@
import org.apache.naming.NamingContextBindingsEnumeration;
import org.apache.naming.NamingContextEnumeration;
import org.apache.naming.NamingEntry;
+import org.jboss.web.NamingLogger;
/**
* WAR Directory Context implementation.
@@ -53,9 +56,6 @@
public class WARDirContext extends BaseDirContext {
- private static org.jboss.logging.Logger log=
- org.jboss.logging.Logger.getLogger( WARDirContext.class );
-
// ----------------------------------------------------------- Constructors
@@ -114,26 +114,22 @@
*/
public void setDocBase(String docBase) {
- // Validate the format of the proposed document root
- if (docBase == null)
- throw new IllegalArgumentException
- (sm.getString("resources.null"));
- if (!(docBase.endsWith(".war")))
- throw new IllegalArgumentException
- (sm.getString("warResources.notWar"));
+ // Validate the format of the proposed document root
+ if (docBase == null)
+ throw MESSAGES.invalidNullDocumentBase();
+ if (!(docBase.endsWith(".war")))
+ throw MESSAGES.docBaseNotWar(docBase);
- // 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
- (sm.getString("warResources.invalidWar", docBase));
+ // Validate that the document base is an existing directory
+ if (!base.exists() || !base.canRead() || base.isDirectory())
+ throw MESSAGES.docBaseNotWar(docBase);
try {
this.base = new ZipFile(base);
} catch (Exception e) {
- throw new IllegalArgumentException
- (sm.getString("warResources.invalidWar", e.getMessage()));
+ throw MESSAGES.failedOpeningWar(e.getMessage());
}
super.setDocBase(docBase);
@@ -155,8 +151,7 @@
try {
base.close();
} catch (IOException e) {
- log.warn
- ("Exception closing WAR File " + base.getName(), e);
+ NamingLogger.ROOT_LOGGER.failedClosingWar(base.getName(), e);
}
}
base = null;
@@ -198,7 +193,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
ZipEntry zipEntry = entry.getEntry();
if (zipEntry.isDirectory())
return new WARDirContext(base, entry);
@@ -283,7 +278,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
return new NamingContextEnumeration(list(entry).iterator());
}
@@ -328,7 +323,7 @@
Entry entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
return new NamingContextBindingsEnumeration(list(entry).iterator(),
this);
}
@@ -444,7 +439,7 @@
entry = treeLookup(name);
if (entry == null)
throw new NamingException
- (sm.getString("resources.notFound", name));
+ (MESSAGES.resourceNotFound(name.toString()));
ZipEntry zipEntry = entry.getEntry();
Modified: branches/7.2.x/src/main/java/org/jboss/web/ELLogger.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/ELLogger.java 2012-09-26 17:13:02 UTC (rev
2089)
+++ branches/7.2.x/src/main/java/org/jboss/web/ELLogger.java 2012-09-27 14:22:46 UTC (rev
2090)
@@ -30,7 +30,7 @@
import org.jboss.logging.MessageLogger;
/**
- * Logging IDs 6500-7000
+ * Logging IDs 6300-6500
* @author Remy Maucherat
*/
@MessageLogger(projectCode = "JBWEB")
Modified: branches/7.2.x/src/main/java/org/jboss/web/ELMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/ELMessages.java 2012-09-26 17:13:02 UTC
(rev 2089)
+++ branches/7.2.x/src/main/java/org/jboss/web/ELMessages.java 2012-09-27 14:22:46 UTC
(rev 2090)
@@ -24,7 +24,7 @@
import org.jboss.logging.Messages;
/**
- * Logging IDs 6000-6500
+ * Logging IDs 6000-6300
* @author Remy Maucherat
*/
@MessageBundle(projectCode = "JBWEB")
Modified: branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java 2012-09-26 17:13:02 UTC
(rev 2089)
+++ branches/7.2.x/src/main/java/org/jboss/web/JasperMessages.java 2012-09-27 14:22:46 UTC
(rev 2090)
@@ -667,4 +667,7 @@
@Message(id = 4209, value = "An exception occurred processing JSP page %s at
line %s")
String jspException(String jsp, int line);
+ @Message(id = 4210, value = "Security exception for class %s")
+ String securityExceptionLoadingClass(String className);
+
}
Added: branches/7.2.x/src/main/java/org/jboss/web/NamingLogger.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/NamingLogger.java
(rev 0)
+++ branches/7.2.x/src/main/java/org/jboss/web/NamingLogger.java 2012-09-27 14:22:46 UTC
(rev 2090)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012 Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.web;
+
+import static org.jboss.logging.Logger.Level.ERROR;
+import static org.jboss.logging.Logger.Level.INFO;
+import static org.jboss.logging.Logger.Level.WARN;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Cause;
+import org.jboss.logging.LogMessage;
+import org.jboss.logging.Logger;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageLogger;
+
+/**
+ * Logging IDs 6500-6700
+ * @author Remy Maucherat
+ */
+@MessageLogger(projectCode = "JBWEB")
+public interface NamingLogger extends BasicLogger {
+
+ /**
+ * A logger with the category of the package name.
+ */
+ NamingLogger ROOT_LOGGER = Logger.getMessageLogger(NamingLogger.class,
"org.apache.naming");
+
+ @LogMessage(level = WARN)
+ @Message(id = 6500, value = "Could not get directory listing for %s")
+ void failedListingFolder(String path);
+
+ @LogMessage(level = WARN)
+ @Message(id = 6501, value = "Error closing WAR %s")
+ void failedClosingWar(String path, @Cause Throwable t);
+
+}
Added: branches/7.2.x/src/main/java/org/jboss/web/NamingMessages.java
===================================================================
--- branches/7.2.x/src/main/java/org/jboss/web/NamingMessages.java
(rev 0)
+++ branches/7.2.x/src/main/java/org/jboss/web/NamingMessages.java 2012-09-27 14:22:46 UTC
(rev 2090)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012 Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.web;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+import org.jboss.logging.Messages;
+
+/**
+ * Logging IDs 6700-7000
+ * @author Remy Maucherat
+ */
+@MessageBundle(projectCode = "JBWEB")
+public interface NamingMessages {
+
+ /**
+ * The messages
+ */
+ NamingMessages MESSAGES = Messages.getBundle(NamingMessages.class);
+
+ @Message(id = 6700, value = "Alias path %s is invalid")
+ IllegalArgumentException invalidAliasPath(String path);
+
+ @Message(id = 6701, value = "Invalid alias mapping %s")
+ IllegalArgumentException invalidAliasMapping(String mapping);
+
+ @Message(id = 6702, value = "Aliased path %s does not exist")
+ IllegalArgumentException aliasNotFound(String path);
+
+ @Message(id = 6703, value = "Aliased path %s is not a folder")
+ IllegalArgumentException aliasNotFolder(String path);
+
+ @Message(id = 6704, value = "Resource %s not found")
+ String resourceNotFound(String path);
+
+ @Message(id = 6705, value = "Document base cannot be null")
+ IllegalArgumentException invalidNullDocumentBase();
+
+ @Message(id = 6706, value = "Document base %s does not exist or is not a
readable directory")
+ IllegalArgumentException invalidBaseFolder(String docBase);
+
+ @Message(id = 6707, value = "Unbind failed: %s")
+ String resourceUnbindFailed(String path);
+
+ @Message(id = 6708, value = "Name %s is already bound in this Context")
+ String resourceAlreadyBound(String path);
+
+ @Message(id = 6709, value = "Bind failed: %s")
+ String resourceBindFailed(String path);
+
+ @Message(id = 6710, value = "Could not get directory listing for %s")
+ String failedListingFolder(String path);
+
+ @Message(id = 6711, value = "Doc base %s must point to a WAR file")
+ IllegalArgumentException docBaseNotWar(String docBase);
+
+ @Message(id = 6712, value = "Invalid or unreadable WAR file : %s")
+ IllegalArgumentException failedOpeningWar(String docBase);
+
+}