Author: alessio.soldano(a)jboss.com
Date: 2012-09-21 11:48:32 -0400 (Fri, 21 Sep 2012)
New Revision: 16752
Added:
common/trunk/src/main/java/org/jboss/ws/common/Loggers.java
common/trunk/src/main/java/org/jboss/ws/common/Messages.java
Removed:
common/trunk/src/main/java/org/jboss/ws/common/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/configuration/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties
common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties
Modified:
common/trunk/pom.xml
common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java
common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java
common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java
common/trunk/src/main/java/org/jboss/ws/common/ObjectNameFactory.java
common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java
common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java
common/trunk/src/main/java/org/jboss/ws/common/integration/AbstractDeploymentAspect.java
common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandler.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java
common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java
common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
Log:
[JBWS-3509] Converting JBossWS-Common to latest JBoss Logging...
Modified: common/trunk/pom.xml
===================================================================
--- common/trunk/pom.xml 2012-09-21 12:47:11 UTC (rev 16751)
+++ common/trunk/pom.xml 2012-09-21 15:48:32 UTC (rev 16752)
@@ -30,7 +30,8 @@
<jbossws.spi.version>2.1.0-SNAPSHOT</jbossws.spi.version>
<jboss.jaxbintros.version>1.0.2.GA</jboss.jaxbintros.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
- <jboss-logging-spi.version>2.1.0.GA</jboss-logging-spi.version>
+ <jboss-logging.version>3.1.2.GA</jboss-logging.version>
+
<jboss-logging-processor.version>1.0.3.Final</jboss-logging-processor.version>
<wsdl4j.version>1.6.2</wsdl4j.version>
<ejb.api.version>1.0.0.CR2</ejb.api.version>
<jms.api.version>1.0.0.Final</jms.api.version>
@@ -80,14 +81,26 @@
<artifactId>jboss-common-core</artifactId>
<version>${jboss.common.core.version}</version>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>${jboss-logging-spi.version}</version>
+ <artifactId>jboss-logging</artifactId>
+ <version>${jboss-logging.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <version>${jboss-logging-processor.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
<version>${servlet.api.version}</version>
@@ -122,6 +135,7 @@
<showDeprecation>false</showDeprecation>
<compilerArguments>
<endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+
<AgeneratedTranslationFilesPath>${project.basedir}/target/generated-translation-files</AgeneratedTranslationFilesPath>
</compilerArguments>
</configuration>
</plugin>
Modified: common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java 2012-09-21 12:47:11 UTC
(rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/DOMUtils.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -28,7 +31,6 @@
import java.io.PrintWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
-import java.util.ResourceBundle;
import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
@@ -45,8 +47,6 @@
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -66,9 +66,6 @@
*/
public final class DOMUtils extends org.jboss.ws.api.util.DOMUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(DOMUtils.class);
- private static Logger log = Logger.getLogger(DOMUtils.class);
-
private static final String DISABLE_DEFERRED_NODE_EXPANSION =
"org.jboss.ws.disable_deferred_node_expansion";
private static final String DEFER_NODE_EXPANSION_FEATURE =
"http://apache.org/xml/features/dom/defer-node-expansion";
private static final String ENABLE_DOCTYPE_DECL =
"org.jboss.ws.enable_doctype_decl";
@@ -138,7 +135,7 @@
}
catch (Exception e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"UNABLE_TO_CREATE_DOCUMENT_BUILDER"), e);
+ throw MESSAGES.unableToCreateInstanceOf(e, DocumentBuilder.class.getName());
}
}
@@ -154,9 +151,9 @@
}
catch (Throwable t)
{
- boolean debugEnabled = log.isDebugEnabled();
+ boolean debugEnabled = ROOT_LOGGER.isDebugEnabled();
if (debugEnabled)
- log.debug("Cannot load JBossWSEntityResolver");
+ ROOT_LOGGER.couldNotLoad("JBossWSEntityResolver");
String[] resolvers = new String[] {
"org.jboss.util.xml.JBossEntityResolver" };
ClassLoader loader = SecurityActions.getContextClassLoader();
for (String resolver : resolvers)
@@ -170,7 +167,7 @@
catch (Exception ex)
{
if (debugEnabled)
- log.debug("Cannot load: " + resolver);
+ ROOT_LOGGER.couldNotLoad(resolver);
}
}
}
@@ -198,7 +195,7 @@
}
catch (ParserConfigurationException pce)
{
- log.error(pce);
+ ROOT_LOGGER.error(pce);
}
}
@@ -229,7 +226,7 @@
}
catch (Exception e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"UNABLE_TO_CREATE_DOCUMENT_BUILDER"), e);
+ throw MESSAGES.unableToCreateInstanceOf(e, DocumentBuilder.class.getName());
}
}
@@ -253,7 +250,7 @@
}
catch (IOException e)
{
- log.error(BundleUtils.getMessage(bundle, "CANNOT_PARSE",
xmlString));
+ ROOT_LOGGER.cannotParse(xmlString);
throw e;
}
}
@@ -334,7 +331,7 @@
public static Element createElement(String localPart)
{
Document doc = getOwnerDocument();
- if (log.isTraceEnabled()) log.trace("createElement {}" + localPart);
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {}" +
localPart);
return doc.createElement(localPart);
}
@@ -345,7 +342,7 @@
public static Element createElement(String localPart, String prefix)
{
Document doc = getOwnerDocument();
- if (log.isTraceEnabled()) log.trace("createElement {}" + prefix +
":" + localPart);
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {}" +
prefix + ":" + localPart);
return doc.createElement(prefix + ":" + localPart);
}
@@ -358,12 +355,12 @@
Document doc = getOwnerDocument();
if (prefix == null || prefix.length() == 0)
{
- if (log.isTraceEnabled()) log.trace("createElement {" + uri +
"}" + localPart);
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {"
+ uri + "}" + localPart);
return doc.createElementNS(uri, localPart);
}
else
{
- if (log.isTraceEnabled()) log.trace("createElement {" + uri +
"}" + prefix + ":" + localPart);
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace("createElement {"
+ uri + "}" + prefix + ":" + localPart);
return doc.createElementNS(uri, prefix + ":" + localPart);
}
}
@@ -479,7 +476,7 @@
}
else
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"SOURCE_TYPE_NOT_IMPLEMENTED", source.getClass()));
+ throw MESSAGES.sourceTypeNotImplemented(source.getClass());
}
return retElement;
Modified: common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java 2012-09-21 12:47:11 UTC
(rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/DOMWriter.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -55,6 +55,8 @@
*/
package org.jboss.ws.common;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
@@ -64,9 +66,7 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -79,10 +79,8 @@
* @author Andy Clark, IBM
* @author Thomas.Diesler(a)jboss.org
*/
-@SuppressWarnings("unchecked")
public class DOMWriter
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(DOMWriter.class);
// Print writer
private PrintWriter out;
// True, if canonical output
@@ -140,7 +138,7 @@
}
catch (UnsupportedEncodingException e)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_ENCODING", charsetName));
+ throw new IllegalArgumentException(e);
}
}
@@ -230,7 +228,7 @@
public void print(Node node)
{
if (prettyprint && ignoreWhitespace)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_PRETTY_PRINT_AND_IGNORE_WHITESPACE"));
+ throw MESSAGES.cannotPrettyPrintAndIgnoreWhiteSpaces();
rootNode = node;
printInternal(node, false);
@@ -295,7 +293,7 @@
out.print('<');
out.print(nodeName);
- Map nsMap = new HashMap();
+ Map<String, String> nsMap = new HashMap<String, String>();
String elPrefix = node.getPrefix();
String elNamespaceURI = node.getNamespaceURI();
if (elPrefix != null)
@@ -342,11 +340,11 @@
// that are defined further up the tree
if (completeNamespaces)
{
- Iterator itPrefix = nsMap.keySet().iterator();
+ Iterator<String> itPrefix = nsMap.keySet().iterator();
while (itPrefix.hasNext())
{
- String prefix = (String)itPrefix.next();
- String nsURI = (String)nsMap.get(prefix);
+ String prefix = itPrefix.next();
+ String nsURI = nsMap.get(prefix);
if (nsURI == null)
{
nsURI = getNamespaceURI(prefix, element, null);
Modified: common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2012-09-21 12:47:11 UTC
(rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/IOUtils.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -31,12 +31,9 @@
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
-import java.util.ResourceBundle;
import javax.activation.DataHandler;
-import javax.xml.ws.WebServiceException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.management.ServerConfig;
@@ -49,7 +46,6 @@
*/
public final class IOUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(IOUtils.class);
// Hide the constructor
private IOUtils()
{
@@ -117,7 +113,7 @@
}
catch (IOException e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"UNABLE_TO_CONVERT_DATAHANDLER", e.getMessage()));
+ throw Messages.MESSAGES.unableToConvertDataHandler(e, dh != null ? dh.getName()
: null);
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java 2012-09-21 12:47:11 UTC
(rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/JavaUtils.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.lang.reflect.Array;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Method;
@@ -30,11 +33,7 @@
import java.lang.reflect.WildcardType;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.ResourceBundle;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
-
/** Java utilities
*
* @author Thomas.Diesler(a)jboss.org
@@ -42,14 +41,10 @@
*/
public class JavaUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JavaUtils.class);
- // provide logging
- private static final Logger log = Logger.getLogger(JavaUtils.class);
+ private static HashMap<String, Class<?>> primitiveNames = new
HashMap<String, Class<?>>();
+ private static HashMap<String, String> primitiveNameDescriptors = new
HashMap<String, String>();
+ private static HashSet<String> reservedKeywords = new
HashSet<String>(64,0.8f);
- private static HashMap<String, Class<?>> primitiveNames = new
HashMap<String, Class<?>>(8);
- private static HashMap<String, String> primitiveNameDescriptors = new
HashMap<String, String>(8);
- private static HashSet<String> reservedKeywords = new
HashSet<String>(50);
-
static
{
primitiveNames.put("int", int.class);
@@ -219,7 +214,7 @@
componentType = loader.loadClass(name);
break;
default:
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_BINARY_COMPONENT_FOR_ARRAY", javaType.charAt(componentStart)));
+ throw MESSAGES.invalidBinaryComponentForArray(javaType);
}
// componentStart doubles as the number of '['s which is the number of
dimensions
@@ -438,17 +433,15 @@
*/
public static boolean isAssignableFrom(Class<?> dest, Class<?> src)
{
- if (dest == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"DESTINATION_CLASS_CANNOT_BE_NULL"));
- if (src == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SOURCE_CLASS_CANNOT_BE_NULL"));
+ if (dest == null || src == null)
+ throw MESSAGES.cannotCheckClassIsAssignableFrom(dest, src);
boolean isAssignable = dest.isAssignableFrom(src);
if (isAssignable == false && dest.getName().equals(src.getName()))
{
ClassLoader destLoader = dest.getClassLoader();
ClassLoader srcLoader = src.getClassLoader();
- if(log.isTraceEnabled()) log.trace("Not assignable because of conflicting
class loaders:\ndstLoader=" + destLoader + "\nsrcLoader=" + srcLoader);
+ if (ROOT_LOGGER.isTraceEnabled())
ROOT_LOGGER.notAssignableDueToConflictingClassLoaders(dest, src, destLoader, srcLoader);
}
if (isAssignable == false && isPrimitive(dest))
@@ -683,7 +676,7 @@
}
catch (Exception e)
{
- if(log.isTraceEnabled()) log.trace("Could not clear blacklists on " +
loader);
+ if (ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.couldNotClearBlacklist(loader,
e);
}
}
}
Added: common/trunk/src/main/java/org/jboss/ws/common/Loggers.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Loggers.java
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/Loggers.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -0,0 +1,217 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+import static org.jboss.logging.Logger.Level.DEBUG;
+import static org.jboss.logging.Logger.Level.ERROR;
+import static org.jboss.logging.Logger.Level.INFO;
+import static org.jboss.logging.Logger.Level.TRACE;
+import static org.jboss.logging.Logger.Level.WARN;
+
+import java.net.URL;
+
+import javax.management.ObjectName;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Cause;
+import org.jboss.logging.LogMessage;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageLogger;
+import org.jboss.wsf.spi.deployment.EndpointState;
+
+/**
+ * JBossWS Common log messages
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+@MessageLogger(projectCode = "JBWS")
+public interface Loggers extends BasicLogger
+{
+ Loggers ROOT_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class,
"org.jboss.ws.common");
+ Loggers MONITORING_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class,
"org.jboss.ws.common.monitoring");
+ Loggers MANAGEMENT_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class,
"org.jboss.ws.common.management");
+ Loggers DEPLOYMENT_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class,
"org.jboss.ws.common.deployment");
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22001, value = "Cannot get children for resource %s")
+ void cannotGetChildrenForResource(@Cause Throwable cause, URL url);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22002, value = "Cannot get name for resource %s")
+ void cannotGetNameForResource(@Cause Throwable cause, URL url);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 22010, value = "Class %s is not assignable from %s due to
conflicting classloaders: %s and %s")
+ void notAssignableDueToConflictingClassLoaders(Class<?> dest, Class<?>
src, ClassLoader destClassLoader, ClassLoader srcClassLoader);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 22011, value = "Could not clear blacklist for classloader
%s")
+ void couldNotClearBlacklist(ClassLoader cl, @Cause Throwable cause);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22012, value = "Could not load %s")
+ void couldNotLoad(String className);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22013, value = "Cannot parse: %s")
+ void cannotParse(String s);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22021, value = "Cannot read resource: %s")
+ void cannotReadResource(String s, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22022, value = "Cannot load ID '%s' as URL (protocol =
%s)")
+ void cannotLoadIDAsURL(String id, String protocol);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22025, value = "WSDL import published to %s")
+ void wsdlImportPublishedTo(URL url);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22026, value = "XMLSchema import published to %s")
+ void xmlSchemaImportPublishedTo(URL url);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22027, value = "Cannot delete published wsdl document: %s")
+ void cannotDeletePublishedWsdlDoc(URL url);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22038, value = "Cannot register endpoint %s with JMX
server")
+ void cannotRegisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable
cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22039, value = "Cannot unregister endpoint %s with JMX
server")
+ void cannotUnregisterEndpointWithJmxServer(ObjectName endpointName, @Cause Throwable
cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22040, value = "MBeanServer not available, cannot unregister
endpoint with JMX server")
+ void cannotUnregisterDueToMBeanServerUnavailable();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22041, value = "Destroying service endpoint manager")
+ void destroyingServiceEndpointManager();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22042, value = "Cannot register processor %s with JMX server, will
be trying using the default managed implementation. ")
+ void cannotRegisterProvidedProcessor(ObjectName processorName, @Cause Throwable
cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22043, value = "Cannot register processor %s with JMX
server")
+ void cannotRegisterProcessorWithJmxServer(ObjectName processorName, @Cause Throwable
cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22044, value = "Cannot unregister processor %s with JMX
server")
+ void cannotUnregisterProcessorWithJmxServer(ObjectName processorName, @Cause
Throwable cause);
+
+ @LogMessage(level = INFO)
+ @Message(id = 22050, value = "Endpoint registered: %s")
+ void endpointRegistered(ObjectName epName);
+
+ @LogMessage(level = INFO)
+ @Message(id = 22051, value = "Endpoint unregistered: %s")
+ void endpointUnregistered(ObjectName epName);
+
+ @LogMessage(level = INFO)
+ @Message(id = 22052, value = "Starting %s %s")
+ void startingWSServerConfig(String implTitle, String implVersion);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22053, value = "Unable to calculate webservices port, using
default %s")
+ void unableToCalculateWebServicesPort(String def);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22054, value = "Unable to calculate webservices secure port, using
default %s")
+ void unableToCalculateWebServicesSecurePort(String def);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22055, value = "Using undefined webservices host: %s")
+ void usingUndefinedWebServicesHost(String host);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22056, value = "Setting webservices host to localhost: %s")
+ void usingLocalHostWebServicesHost(String host);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22057, value = "Could not get address for host: %s")
+ void couldNotGetAddressForHost(String host, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22058, value = "Could not get port for webservices configuration
from configured HTTP connector")
+ void couldNotGetPortFromConfiguredHTTPConnector();
+
+ @LogMessage(level = WARN)
+ @Message(id = 22059, value = "Unable to read from the http servlet
request")
+ void unableToReadFromHttpServletRequest(@Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22060, value = "Cannot trace SOAP message")
+ void cannotTraceSoapMessage(@Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22061, value = "Method invocation failed with exception")
+ void methodInvocationFailed(@Cause Throwable cause);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 22090, value = "Cannot get %s from root file, trying with
additional metadata files")
+ void cannotGetRootFileTryingWithAdditionalMetaData(String resourcePath);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 22098, value = "Cannot get %s from %s")
+ void cannotGetRootResourceFrom(String resourcePath, Object uvf, @Cause Throwable
cause);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 22099, value = "Error during deployment: %s")
+ void errorDuringDeployment(String dep, @Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22100, value = "Error while destroying deployment %s due to
previous exception")
+ void errorDestroyingDeployment(String dep, @Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22102, value = "Cannot stop endpoint in state %s: %s")
+ void cannotStopEndpoint(EndpointState state, ObjectName epName);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22103, value = "Cannot start endpoint in state %s: %s")
+ void cannotStartEndpoint(EndpointState state, ObjectName epName);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22110, value = "Could not add handler %s as part of client or
endpoint configuration")
+ void cannotAddHandler(String className, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 22111, value = "PortNamePattern and ServiceNamePattern filters not
supported; adding handlers anyway")
+ void filtersNotSupported();
+
+ @LogMessage(level = WARN)
+ @Message(id = 22112, value = "Init params not supported; adding handler
anyway")
+ void initParamsNotSupported();
+
+ @LogMessage(level = ERROR)
+ @Message(id = 22113, value = "Error closing JAXBIntro configuration stream:
%s")
+ void errorClosingJAXBIntroConf(URL url, @Cause Throwable cause);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 22114, value = "%s doesn't work on %s")
+ void aspectDoesNotWorkOnDeployment(Class<?> aspect, Class<?>
deployment);
+}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Message.properties 2012-09-21 12:47:11
UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/Message.properties 2012-09-21 15:48:32
UTC (rev 16752)
@@ -1,15 +0,0 @@
-INVALID_BINARY_COMPONENT_FOR_ARRAY=Invalid binary component for array: {0}
-DESTINATION_CLASS_CANNOT_BE_NULL=Destination class cannot be null
-SOURCE_CLASS_CANNOT_BE_NULL=Source class cannot be null
-UNABLE_TO_CREATE_DOCUMENT_BUILDER=Unable to create document builder
-CANNOT_PARSE=Cannot parse: {0}
-SOURCE_TYPE_NOT_IMPLEMENTED=Source type not implemented: {0}
-UNSUPPORTED_ENCODING=Unsupported encoding: {0}
-CANNOT_PRETTY_PRINT_AND_IGNORE_WHITESPACE=Cannot pretty print and ignore whitespace
-UNABLE_TO_CONVERT_DATAHANDLER=Unable to convert DataHandler to byte[]: {0}
-CANNOT_GET_URL_FOR=Cannot get URL for: {0}
-UNIFIEDVIRTUALFILE_NOT_INITIALIZED=UnifiedVirtualFile not initialized
-CANNOT_GET_CHILDREN_FOR_RESOURCE=Cannot get children for resource: {0}
-UNIFIEDVIRTUALFILE_NOT_INITIALIZED=UnifiedVirtualFile not initialized
-CANNOT_GET_NAME_FOR_RESOURCE=Cannot get name for resource: {0}
-CANNOT_GET_URL_FOR=Cannot get URL for: {0}
\ No newline at end of file
Added: common/trunk/src/main/java/org/jboss/ws/common/Messages.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/Messages.java
(rev 0)
+++ common/trunk/src/main/java/org/jboss/ws/common/Messages.java 2012-09-21 15:48:32 UTC
(rev 16752)
@@ -0,0 +1,271 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat, Inc., and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.ws.common;
+
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.util.Collection;
+
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+import org.jboss.ws.common.injection.InjectionException;
+import org.jboss.wsf.spi.WSFException;
+import org.jboss.wsf.spi.deployment.EndpointState;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
+
+/**
+ * JBossWS Common exception messages
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+@MessageBundle(projectCode = "JBWS")
+public interface Messages {
+
+ Messages MESSAGES = org.jboss.logging.Messages.getBundle(Messages.class);
+
+ @Message(id = 22000, value = "Cannot get URL for %s")
+ IOException cannotGetURLFor(String path);
+
+ @Message(id = 22003, value = "UnifiedVirtualFile not initialized; could not load
resources from classloader: %s")
+ IllegalStateException unifiedVirtualFileNotInitialized(ClassLoader cl);
+
+ @Message(id = 22004, value = "Invalid ObjectName: %s")
+ Error invalidObjectName(@Cause Throwable cause, String message);
+
+ @Message(id = 22005, value = "Could not get component type from array; invalid
binary component for array: %s")
+ IllegalArgumentException invalidBinaryComponentForArray(String arrayType);
+
+ @Message(id = 22006, value = "Could not check whether class '%s' is
assignable from class '%s'; both classes must not be null.")
+ IllegalArgumentException cannotCheckClassIsAssignableFrom(Class<?> dest,
Class<?> src);
+
+ @Message(id = 22007, value = "Unable to convert DataHandler to byte[]:
%s")
+ WebServiceException unableToConvertDataHandler(@Cause Throwable cause, String
dhName);
+
+ @Message(id = 22008, value = "Cannot pretty print document and ignore white
spaces at the same time")
+ IllegalStateException cannotPrettyPrintAndIgnoreWhiteSpaces();
+
+ @Message(id = 22009, value = "Unable to create instance of %s")
+ RuntimeException unableToCreateInstanceOf(@Cause Throwable cause, String className);
+
+ @Message(id = 22014, value = "Source type not implemented: %s")
+ RuntimeException sourceTypeNotImplemented(Class<?> clazz);
+
+ @Message(id = 22015, value = "Entity resolution: invalid character reference in
%s")
+ IllegalArgumentException entityResolutionInvalidCharacterReference(String string);
+
+ @Message(id = 22016, value = "Entity resolution: invalid entity reference in
%s")
+ IllegalArgumentException entityResolutionInvalidEntityReference(String string);
+
+ @Message(id = 22017, value = "Entity resolution: invalid entity %s")
+ IllegalArgumentException entityResolutionInvalidEntity(String entity);
+
+ @Message(id = 22018, value = "A UUID must be 16 bytes!")
+ IllegalArgumentException uuidMustBeOf16Bytes();
+
+ @Message(id = 22019, value = "Entity resolution: no entities mapping defined in
resource file: %s")
+ IllegalArgumentException entityResolutionNoEntityMapppingDefined(String file);
+
+ @Message(id = 22020, value = "Entity resolution: resource not found: %s")
+ IllegalArgumentException entityResolutionResourceNotFound(String res);
+
+ @Message(id = 22023, value = "Error building an URLConnection capable of
handling multiply-nested jars; '!' missing or in unexpected position in provided
url: %s")
+ MalformedURLException jarUrlConnectionBuildError(String url);
+
+ @Message(id = 22024, value = "JAR URLConnection unable to locate segment %s for
url %s")
+ IOException jarUrlConnectionUnableToLocateSegment(String segment, String url);
+
+ @Message(id = 22028, value = "Cannot find schema import '%s' in
deployment '%s'")
+ IllegalArgumentException cannotFindSchemaImportInDeployment(String xsdImport, String
deploymentName);
+
+ @Message(id = 22029, value = "Failed to provide spi: %s")
+ WSFException failedToProvideSPI(Class<?> spiType);
+
+ @Message(id = 22030, value = "No deployment aspect found with attribute
last='true'")
+ IllegalStateException noDeploymentAspectFoundWithAttributeLast();
+
+ @Message(id = 22031, value = "Cycle detected in sub-graph: %s")
+ IllegalStateException cycleDetectedInSubGraph(Collection<?> c);
+
+ @Message(id = 22032, value = "Cannot marshall service ref meta data")
+ NamingException cannotMarshallServiceRefMetaData(@Cause Throwable cause);
+
+ @Message(id = 22033, value = "Cannot unmarshall service ref meta data")
+ NamingException cannotUnMarshallServiceRefMetaData(@Cause Throwable cause);
+
+ @Message(id = 22034, value = "Missing VFS root for service-ref: %s")
+ IllegalStateException missingVFSRootInServiceRef(String serviceRefName);
+
+ @Message(id = 22035, value = "Missing service reference type for service-ref:
%s")
+ IllegalStateException missingServiceRefTypeInServiceRef(String serviceRefName);
+
+ @Message(id = 22036, value = "Cannot create generic javax.xml.ws.Service without
wsdlLocation; service-ref metadata = '%s'")
+ IllegalArgumentException
cannotCreateServiceWithoutWsdlLocation(UnifiedServiceRefMetaData serviceRefMD);
+
+ @Message(id = 22037, value = "Annotation class cannot be null")
+ IllegalArgumentException annotationClassCannotBeNull();
+
+ @Message(id = 22045, value = "Cannot register / unregister null endpoint")
+ IllegalArgumentException cannotRegisterUnregisterNullEndpoint();
+
+ @Message(id = 22046, value = "Looking for endpoints with null name in the
endpoint registry is not supported")
+ IllegalArgumentException endpointNameCannotBeNull();
+
+ @Message(id = 22047, value = "Cannot register endpoint with null name:
%s")
+ IllegalArgumentException cannotRegisterEndpointWithNullName(ObjectName epName);
+
+ @Message(id = 22048, value = "Endpoint already registered: %s")
+ IllegalStateException endpointAlreadyRegistered(ObjectName endpointName);
+
+ @Message(id = 22049, value = "Endpoint not registered: %s")
+ IllegalStateException endpointNotRegistered(ObjectName endpointName);
+
+ @Message(id = 22062, value = "Cannot find attachment %s in webservice deployment
%s")
+ IllegalStateException cannotFindAttachmentInDeployment(Class<?>
attachmentClass, String dep);
+
+ @Message(id = 22063, value = "Reference resolution: cannot resolve %s")
+ IllegalArgumentException cannotResolve(Object obj);
+
+ @Message(id = 22064, value = "Reference resolution: accessible object class
cannot be null")
+ IllegalArgumentException accessibleObjectClassCannotBeNull();
+
+ @Message(id = 22065, value = "Method %s annotated with @%s can't declare
primitive parameters")
+ InjectionException methodCannotDeclarePrimitiveParameters2(Method m, Class<?
extends Annotation> ann);
+
+ @Message(id = 22066, value = "Field %s can't be of primitive or void
type")
+ InjectionException fieldCannotBeOfPrimitiveOrVoidType(Field f);
+
+ @Message(id = 22067, value = "Method %s annotated with @%s can't be of
primitive or void type")
+ InjectionException fieldCannotBeOfPrimitiveOrVoidType2(Field f, Class<? extends
Annotation> ann);
+
+ @Message(id = 22068, value = "Method %s has to have no parameters")
+ InjectionException methodHasToHaveNoParameters(Method m);
+
+ @Message(id = 22069, value = "Method %s annotated with @%s has to have no
parameters")
+ InjectionException methodHasToHaveNoParameters2(Method m, Class<? extends
Annotation> ann);
+
+ @Message(id = 22070, value = "Method %s has to return void")
+ InjectionException methodHasToReturnVoid(Method m);
+
+ @Message(id = 22071, value = "Method %s annotated with @%s has to return
void")
+ InjectionException methodHasToReturnVoid2(Method m, Class<? extends Annotation>
ann);
+
+ @Message(id = 22072, value = "Method %s cannot throw checked exceptions")
+ InjectionException methodCannotThrowCheckedException(Method m);
+
+ @Message(id = 22073, value = "Method %s annotated with @%s cannot throw checked
exception")
+ InjectionException methodCannotThrowCheckedException2(Method m, Class<? extends
Annotation> ann);
+
+ @Message(id = 22074, value = "Method %s cannot be static")
+ InjectionException methodCannotBeStatic(Method m);
+
+ @Message(id = 22075, value = "Method %s annotated with @%s cannot be
static")
+ InjectionException methodCannotBeStatic2(Method m, Class<? extends Annotation>
ann);
+
+ @Message(id = 22076, value = "Field %s cannot be static or final")
+ InjectionException fieldCannotBeStaticOrFinal(Field f);
+
+ @Message(id = 22077, value = "Field %s annotated with @%s cannot be
static")
+ InjectionException fieldCannotBeStaticOrFinal2(Field f, Class<? extends
Annotation> ann);
+
+ @Message(id = 22078, value = "Method %s has to declare exactly one
parameter")
+ InjectionException methodHasToDeclareExactlyOneParameter(Method m);
+
+ @Message(id = 22079, value = "Method %s annotated with @%s has to declare
exactly one parameter")
+ InjectionException methodHasToDeclareExactlyOneParameter2(Method m, Class<?
extends Annotation> ann);
+
+ @Message(id = 22080, value = "Method %s doesn't respect Java Beans setter
method name")
+ InjectionException methodDoesNotRespectJavaBeanSetterMethodName(Method m);
+
+ @Message(id = 22081, value = "Method %s annotated with @%s doesn't respect
Java Beans setter method name")
+ InjectionException methodDoesNotRespectJavaBeanSetterMethodName2(Method m, Class<?
extends Annotation> ann);
+
+ @Message(id = 22082, value = "Only one method can exist")
+ InjectionException onlyOneMethodCanExist();
+
+ @Message(id = 22083, value = "Only one method annotated with @%s can
exist")
+ InjectionException onlyOneMethodCanExist2(Class<? extends Annotation> ann);
+
+ @Message(id = 22084, value = "Method %s can't declare primitive
parameters")
+ InjectionException methodCannotDeclarePrimitiveParameters(Method m);
+
+ @Message(id = 22085, value = "Virtual host must be the same for all endpoints of
the deployment %s")
+ IllegalStateException virtualHostMustBeTheSameForAllEndpoints(String dep);
+
+ @Message(id = 22086, value = "Cannot obtain servlet mapping for %s")
+ IllegalStateException cannotObtainServletMapping(String name);
+
+ @Message(id = 22087, value = "Failed to read %s: %s")
+ WebServiceException failedToRead(String descriptor, String mex, @Cause Throwable
cause);
+
+ @Message(id = 22088, value = "Unexpected element parsing %s: %s")
+ IllegalStateException unexpectedElement(String descriptor, String elem);
+
+ @Message(id = 22089, value = "Unexpectedly reached end of XML document:
%s")
+ IllegalStateException reachedEndOfXMLDocUnexpectedly(String descriptor);
+
+ @Message(id = 22092, value = "Could not find %s in the additional
metadatafiles")
+ IOException cannotFindInAdditionalMetaData(String resourcePath);
+
+ @Message(id = 22093, value = "Context root expected to start with leading slash:
%s")
+ IllegalStateException contextRootExpectedToStartWithLeadingSlash(String
contextRoot);
+
+ @Message(id = 22094, value = "Lifecycle handler not initialized for endpoint
%s")
+ IllegalStateException lifecycleHandlerNotInitialized(ObjectName epName);
+
+ @Message(id = 22095, value = "Cannot obtain context root for deployment
%s")
+ IllegalStateException cannotObtainContextRoot(String dep);
+
+ @Message(id = 22096, value = "Cannot obtain url pattern for endpoint %s")
+ IllegalStateException cannotObtainUrlPattern(ObjectName epName);
+
+ @Message(id = 22097, value = "Cannot find <url-pattern> for servlet-name
%s")
+ RuntimeException cannotFindUrlPatternForServletName(String s);
+
+ @Message(id = 22101, value = "Invocation handler not available for endpoint
%s")
+ IllegalStateException invocationHandlerNotAvailable(ObjectName epName);
+
+ @Message(id = 22104, value = "All endpoints must share the same context root;
deployment = %s")
+ IllegalStateException allEndpointsMustShareSameContextRoot(String dep);
+
+ @Message(id = 22105, value = "Cannot modify endpoint in state %s: %s")
+ IllegalStateException cannotModifyEndpointInState(EndpointState state, ObjectName
epName);
+
+ @Message(id = 22106, value = "Operation %s not supported by %s")
+ RuntimeException operationNotSupportedBy(String op, Class<?> clazz);
+
+ @Message(id = 22107, value = "Could not read configuration from %s")
+ RuntimeException couldNotReadConfiguration(String path, @Cause Throwable cause);
+
+ @Message(id = 22108, value = "Configuration %s not found")
+ RuntimeException configurationNotFound(String conf);
+
+ @Message(id = 22109, value = "%s is not a JAX-WS Handler")
+ RuntimeException notJAXWSHandler(String className);
+}
Modified: common/trunk/src/main/java/org/jboss/ws/common/ObjectNameFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/ObjectNameFactory.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/ObjectNameFactory.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -42,7 +42,7 @@
}
catch (MalformedObjectNameException e)
{
- throw new Error("Invalid ObjectName: " + name + "; " + e);
+ throw Messages.MESSAGES.invalidObjectName(e, name);
}
}
@@ -54,7 +54,7 @@
}
catch (MalformedObjectNameException e)
{
- throw new Error("Invalid ObjectName: " + domain + "," + key
+ "," + value + "; " + e);
+ throw Messages.MESSAGES.invalidObjectName(e, domain + "," + key +
"," + value);
}
}
@@ -66,7 +66,7 @@
}
catch (MalformedObjectNameException e)
{
- throw new Error("Invalid ObjectName: " + domain + "," +
table + "; " + e);
+ throw Messages.MESSAGES.invalidObjectName(e, domain + "," + table);
}
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/ResourceLoaderAdapter.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -30,12 +33,9 @@
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -48,10 +48,8 @@
*/
public class ResourceLoaderAdapter implements UnifiedVirtualFile
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ResourceLoaderAdapter.class);
private URL resourceURL;
private ClassLoader loader;
- private static Logger log = Logger.getLogger(ResourceLoaderAdapter.class);
private static final String jarFileSeparator = "/";
public ResourceLoaderAdapter()
@@ -115,7 +113,7 @@
}
if (resourceURL == null)
- throw new IOException(BundleUtils.getMessage(bundle,
"CANNOT_GET_URL_FOR", resourcePath));
+ throw MESSAGES.cannotGetURLFor(resourcePath);
return new ResourceLoaderAdapter(loader, resourceURL);
}
@@ -123,14 +121,14 @@
public URL toURL()
{
if (null == this.resourceURL)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
+ throw MESSAGES.unifiedVirtualFileNotInitialized(loader);
return resourceURL;
}
public List<UnifiedVirtualFile> getChildren() throws IOException
{
if (null == this.resourceURL)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
+ throw MESSAGES.unifiedVirtualFileNotInitialized(loader);
List<UnifiedVirtualFile> list = new LinkedList<UnifiedVirtualFile>();
if (resourceURL.getProtocol().equals("jar"))
{
@@ -191,7 +189,7 @@
}
catch (Exception e)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", resourceURL), e);
+ ROOT_LOGGER.cannotGetChildrenForResource(e, resourceURL);
}
}
else //std file/dir
@@ -213,7 +211,7 @@
}
catch (Exception e)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", resourceURL), e);
+ ROOT_LOGGER.cannotGetChildrenForResource(e, resourceURL);
}
}
return list;
@@ -222,7 +220,7 @@
public String getName()
{
if (null == this.resourceURL)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNIFIEDVIRTUALFILE_NOT_INITIALIZED"));
+ throw MESSAGES.unifiedVirtualFileNotInitialized(loader);
String name = null;
try
{
@@ -234,7 +232,7 @@
}
catch (Exception e)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_NAME_FOR_RESOURCE", resourceURL));
+ ROOT_LOGGER.cannotGetNameForResource(e, resourceURL);
}
return name;
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/URLLoaderAdapter.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,232 +21,25 @@
*/
package org.jboss.ws.common;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
import java.net.URL;
-import java.net.URLClassLoader;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
-
/**
* Load resources through a URLClassLoader.<br>
* NOTE: The associated classloader doesn't do parent delegation.
+ *
+ * @deprecated Please use org.jboss.wsf.spi.util.URLLoaderAdapter instead
*
- *
* @author Heiko.Braun(a)jboss.org
* @author alessio.soldano(a)jboss.com
* @since 25.01.2007
*/
-public class URLLoaderAdapter implements UnifiedVirtualFile
+@Deprecated
+public class URLLoaderAdapter extends org.jboss.wsf.spi.util.URLLoaderAdapter
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(URLLoaderAdapter.class);
- private static final long serialVersionUID = 8263115387770740414L;
-
- private URL rootURL;
- private URL resourceURL;
- private transient URLClassLoader loader;
- private static Logger log = Logger.getLogger(URLLoaderAdapter.class);
- private static final String jarFileSeparator = "/";
public URLLoaderAdapter(URL rootURL)
{
- this.rootURL = rootURL;
+ super(rootURL);
}
- private URLLoaderAdapter(URL rootURL, URLClassLoader loader, URL resourceURL)
- {
- this.rootURL = rootURL;
- this.resourceURL = resourceURL;
- this.loader = loader;
- }
-
- public UnifiedVirtualFile findChild(String resourcePath) throws IOException
- {
- URL resourceURL = null;
- if (resourcePath != null)
- {
- // Try the child as URL
- try
- {
- resourceURL = new URL(resourcePath);
- }
- catch (MalformedURLException ex)
- {
- // ignore
- }
-
- // Try the filename as File
- if (resourceURL == null)
- {
- try
- {
- File file = new File(resourcePath);
- if (file.exists())
- resourceURL = file.toURI().toURL();
- }
- catch (MalformedURLException e)
- {
- // ignore
- }
- }
-
- // Try the filename as Resource
- if (resourceURL == null)
- {
- try
- {
- resourceURL = getResourceLoader().getResource(resourcePath);
- }
- catch (Exception ex)
- {
- // ignore
- }
- }
- }
-
- if (resourceURL == null)
- throw new IOException(BundleUtils.getMessage(bundle,
"CANNOT_GET_URL_FOR", resourcePath));
-
- return new URLLoaderAdapter(rootURL, loader, resourceURL);
- }
-
- public URL toURL()
- {
- if (resourceURL != null)
- return resourceURL;
- else
- return rootURL;
- }
-
- private URLClassLoader getResourceLoader()
- {
- if (loader == null)
- {
- loader = new URLClassLoader(new URL[] { rootURL });
- }
- return loader;
- }
-
- public List<UnifiedVirtualFile> getChildren() throws IOException
- {
- List<UnifiedVirtualFile> list = new LinkedList<UnifiedVirtualFile>();
-
- URL url = toURL();
-
- if (url.getProtocol().equals("jar"))
- {
- String urlString = url.toExternalForm();
- String jarRoot = urlString.substring(4, urlString.indexOf("ar!") +
2);
- String path = urlString.contains("!") ?
urlString.substring(urlString.lastIndexOf("!") + 2) : "";
- if (path.endsWith(jarFileSeparator))
- path = path.substring(0, path.lastIndexOf(jarFileSeparator));
-
- try
- {
- String folder = jarRoot.substring(5,jarRoot.lastIndexOf("/"));
- String filename = jarRoot.substring(jarRoot.lastIndexOf("/")+1);
- final File jar = new File(folder, filename);
-
- PrivilegedAction<JarFile> action = new
PrivilegedAction<JarFile>()
- {
- public JarFile run()
- {
- try
- {
- return new JarFile(jar);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
- };
- JarFile jarFile = AccessController.doPrivileged(action);
-
- if (jar.canRead())
- {
- Enumeration<JarEntry> entries = jarFile.entries();
- List<String> pathMatch = new LinkedList<String>();
- List<String> finalMatch = new LinkedList<String>();
- while (entries.hasMoreElements())
- {
- JarEntry entry = entries.nextElement();
- String name = entry.getName();
- //keep entries starting with the current resource path (exclude inner
classes and the current file)
- if (name.startsWith(path + jarFileSeparator) && (name.length()
> path.length() + 1) && !name.contains("$"))
- pathMatch.add(name.substring(path.length() + 1));
- }
-
- for (String s : pathMatch)
- {
- //do not go deeper than the current dir
- if (!s.contains(jarFileSeparator) || s.indexOf(jarFileSeparator) ==
s.length() - 1)
- finalMatch.add(s);
- }
- for (String s : finalMatch)
- {
- URL sUrl = new URL(urlString + jarFileSeparator + s);
- list.add(new URLLoaderAdapter(rootURL, loader, sUrl));
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url));
- }
- }
- else //std file/dir
- {
- try
- {
- File file = new File(url.toURI());
- if (file.exists() && file.isDirectory())
- {
- File[] files = file.listFiles();
- if (files != null)
- {
- for (File f : files)
- {
- list.add(new URLLoaderAdapter(rootURL, loader, f.toURI().toURL()));
- }
- }
- }
- }
- catch (Exception e)
- {
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url), e);
- }
- }
- return list;
- }
-
- public String getName()
- {
- String name = null;
- try
- {
- String filename = toURL().getFile();
- File f = new File(filename);
- name = f.getName();
- if (f.isDirectory() || (toURL().getProtocol().equals("jar") &&
filename.endsWith(jarFileSeparator)))
- name = name + jarFileSeparator;
- }
- catch (Exception e)
- {
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_NAME_FOR_RESOURCE", toURL()), e);
- }
- return name;
- }
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,13 +21,15 @@
*/
package org.jboss.ws.common.configuration;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.xml.ws.Binding;
@@ -37,9 +39,7 @@
import javax.xml.ws.http.HTTPBinding;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.configuration.ClientConfigurer;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -62,8 +62,6 @@
*/
public class ConfigHelper implements ClientConfigurer
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ConfigHelper.class);
-
private static Map<String, String> bindingIDs = new HashMap<String,
String>(8);
static {
bindingIDs.put(SOAPBinding.SOAP11HTTP_BINDING, "##SOAP11_HTTP");
@@ -83,7 +81,7 @@
@Override
public void setConfigProperties(Object proxy, String configFile, String configName)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"NOT_SUPPORTED", this.getClass()));
+ throw MESSAGES.operationNotSupportedBy("setConfigProperties",
this.getClass());
}
protected ClientConfig readConfig(String configFile, String configName) {
@@ -97,7 +95,7 @@
}
catch (Exception e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"COULD_NOT_READ_CONFIG", configFile));
+ throw MESSAGES.couldNotReadConfiguration(configFile, e);
}
finally
{
@@ -117,7 +115,7 @@
}
}
}
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"CONFIG_NOT_FOUND", configName));
+ throw MESSAGES.configurationNotFound(configName);
}
}
@@ -162,14 +160,14 @@
{
if (handlerChain.getPortNamePattern() != null ||
handlerChain.getServiceNamePattern() != null)
{
- Logger.getLogger(ConfigHelper.class).warn(BundleUtils.getMessage(bundle,
"FILTERS_NOT_SUPPORTED"));
+ ROOT_LOGGER.filtersNotSupported();
}
if (matchProtocolBinding(protocolBinding,
handlerChain.getProtocolBindings())) {
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
if (uhmd.getInitParams() != null &&
!uhmd.getInitParams().isEmpty())
{
-
Logger.getLogger(ConfigHelper.class).warn(BundleUtils.getMessage(bundle,
"INIT_PARAMS_NOT_SUPPORTED"));
+ ROOT_LOGGER.initParamsNotSupported();
}
Object h = newInstance(uhmd.getHandlerClass());
if (h != null)
@@ -187,7 +185,7 @@
}
else
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"NOT_HANDLER_INSTANCE", h));
+ throw MESSAGES.notJAXWSHandler(uhmd.getHandlerClass());
}
}
}
@@ -221,7 +219,7 @@
}
catch (Exception e)
{
- Logger.getLogger(ConfigHelper.class).warnf(e, BundleUtils.getMessage(bundle,
"CAN_NOT_ADD_HANDLER" , className));
+ ROOT_LOGGER.cannotAddHandler(className, e);
return null;
}
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/configuration/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/configuration/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/configuration/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,7 +0,0 @@
-FILTERS_NOT_SUPPORTED=PortNamePattern and ServiceNamePattern filters not supported;
adding handlers anyway.
-INIT_PARAMS_NOT_SUPPORTED=Init params not supported.
-NOT_HANDLER_INSTANCE={0} is not a JAX-WS Handler instance
-CAN_NOT_ADD_HANDLER=Could not add handler {0} as part of client or endpoint
configuration
-COULD_NOT_READ_CONFIG=Could not read configuration from file {0}
-CONFIG_NOT_FOUND=Configuration {0} not found
-NOT_SUPPORTED=Operation not supported by ClientConfigurer: {0}
\ No newline at end of file
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/AbstractDefaultEndpoint.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,7 +23,6 @@
import java.util.Iterator;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.Vector;
import javax.management.MalformedObjectNameException;
@@ -32,7 +31,7 @@
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.RecordFilter;
import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -55,7 +54,6 @@
*/
public class AbstractDefaultEndpoint extends AbstractExtensible
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractDefaultEndpoint.class);
protected Service service;
protected ObjectName name;
protected String shortName;
@@ -104,8 +102,6 @@
public synchronized Class<?> getTargetBeanClass()
{
- if (targetBean == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"TARGET_BEAN_NOT_SET"));
if (targetBeanClass != null)
return targetBeanClass;
@@ -256,7 +252,7 @@
protected void assertEndpointSetterAccess()
{
if (state == EndpointState.STARTED)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_MODIFY_ENDPOINT_PROPERTIES_IN_STATE", state));
+ throw Messages.MESSAGES.cannotModifyEndpointInState(state, getName());
}
public List<RecordProcessor> getRecordProcessors()
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/BackwardCompatibleContextRootDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,10 +21,9 @@
*/
package org.jboss.ws.common.deployment;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
@@ -41,7 +40,6 @@
*/
public class BackwardCompatibleContextRootDeploymentAspect extends
ContextRootDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(BackwardCompatibleContextRootDeploymentAspect.class);
@Override
protected String getExplicitContextRoot(Deployment dep)
{
@@ -58,7 +56,7 @@
{
String firstToken = st.nextToken();
if (contextRoot != null && contextRoot.equals(firstToken) ==
false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"MUST_SHARE_THE_SAME_CONTEXT_ROOT", new Object[]{ contextRoot ,firstToken}));
+ throw
Messages.MESSAGES.allEndpointsMustShareSameContextRoot(dep.getSimpleName());
contextRoot = firstToken;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,12 +21,10 @@
*/
package org.jboss.ws.common.deployment;
-import java.util.ResourceBundle;
-
import org.jboss.ws.api.annotation.AuthMethod;
import org.jboss.ws.api.annotation.TransportGuarantee;
import org.jboss.ws.api.annotation.WebContext;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -42,7 +40,6 @@
*/
public class ContextRootDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ContextRootDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
@@ -75,13 +72,13 @@
{
for (Endpoint ep : dep.getService().getEndpoints())
{
- Class implClass = ep.getTargetBeanClass();
- WebContext anWebContext =
(WebContext)implClass.getAnnotation(WebContext.class);
+ Class<?> implClass = ep.getTargetBeanClass();
+ WebContext anWebContext = implClass.getAnnotation(WebContext.class);
this.validateSecuritySettings(anWebContext);
if (anWebContext != null && anWebContext.contextRoot().length() >
0)
{
if (contextRoot != null &&
contextRoot.equals(anWebContext.contextRoot()) == false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"MUST_SHARE_THE_SAME_CONTEXT_ROOT"));
+ throw
Messages.MESSAGES.allEndpointsMustShareSameContextRoot(dep.getSimpleName());
contextRoot = anWebContext.contextRoot();
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultJMSEndpoint.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,9 +23,6 @@
import java.net.URI;
-import javax.naming.Context;
-
-import org.jboss.wsf.spi.deployment.EndpointType;
import org.jboss.wsf.spi.deployment.JMSEndpoint;
import org.jboss.wsf.spi.management.EndpointMetrics;
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/DefaultLifecycleHandler.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,10 +21,8 @@
*/
package org.jboss.ws.common.deployment;
-import java.util.ResourceBundle;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Loggers;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointState;
import org.jboss.wsf.spi.deployment.LifecycleHandler;
@@ -38,19 +36,12 @@
*/
public class DefaultLifecycleHandler implements LifecycleHandler
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultLifecycleHandler.class);
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
public void start(Endpoint ep)
{
- if (log.isTraceEnabled())
- log.trace("Start: " + ep.getName());
-
EndpointState state = ep.getState();
if (state != EndpointState.UNDEFINED)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_START_ENDPOINT_IN_STATE", state));
+ Loggers.DEPLOYMENT_LOGGER.cannotStartEndpoint(state, ep.getName());
}
else
{
@@ -59,7 +50,7 @@
InvocationHandler invHandler = ep.getInvocationHandler();
if (invHandler == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"INVOCATION_HANDLER_NOT_AVAILABLE"));
+ throw Messages.MESSAGES.invocationHandlerNotAvailable(ep.getName());
invHandler.init(ep);
ep.setState(EndpointState.STARTED);
@@ -68,13 +59,10 @@
public void stop(Endpoint ep)
{
- if (log.isTraceEnabled())
- log.trace("Stop: " + ep.getName());
-
EndpointState state = ep.getState();
if (state != EndpointState.STARTED)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_STOP_ENDPOINT_IN_STATE", state));
+ Loggers.DEPLOYMENT_LOGGER.cannotStopEndpoint(state, ep.getName());
}
else
{
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/DeploymentAspectManagerImpl.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,18 +21,18 @@
*/
package org.jboss.ws.common.deployment;
+import static org.jboss.ws.common.Loggers.DEPLOYMENT_LOGGER;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.DeploymentState;
import org.jboss.wsf.spi.deployment.WSFDeploymentException;
/**
@@ -42,9 +42,6 @@
*/
public class DeploymentAspectManagerImpl implements DeploymentAspectManager
{
- // provide logging
- private static final Logger log =
Logger.getLogger(DeploymentAspectManagerImpl.class);
-
private String name;
private DeploymentAspectManager parent;
private List<DeploymentAspect> depAspects = new
ArrayList<DeploymentAspect>();
@@ -79,14 +76,14 @@
depAspects.clear();
depAspects.addAll(aspects);
- if (log.isTraceEnabled())
+ if (DEPLOYMENT_LOGGER.isTraceEnabled())
{
// Debug the aspect list
StringBuilder builder = new StringBuilder("setDeploymentAspects on " +
name);
for (DeploymentAspect aspect : aspects)
builder.append("\n " + aspect.getClass().getName() + "
provides: " + aspect.getProvidesAsSet() + " requires: " +
aspect.getRequiresAsSet());
- log.trace(builder);
+ DEPLOYMENT_LOGGER.trace(builder);
}
}
@@ -141,7 +138,7 @@
}
catch (RuntimeException rte)
{
- log.debug("Error during deployment!", rte);
+ DEPLOYMENT_LOGGER.errorDuringDeployment(dep.getSimpleName(), rte);
while (--i >= 0)
{
// destroy the deployment
@@ -152,7 +149,7 @@
catch (RuntimeException destroyRte)
{
//log previous exception in the exotic case in which also stopping
already started aspects fails
-
log.error(BundleUtils.getMessage(BundleUtils.getBundle(DeploymentAspectManagerImpl.class),"ERROR_DESTROYING_DEPLOYMENT"),
rte);
+ DEPLOYMENT_LOGGER.errorDestroyingDeployment(dep.getSimpleName(), rte);
throw destroyRte;
}
}
@@ -190,11 +187,11 @@
private void logInvocation(DeploymentAspect aspect, String method)
{
- if (log.isTraceEnabled())
+ if (DEPLOYMENT_LOGGER.isTraceEnabled())
{
String name = aspect.getClass().getName();
name = name.substring(name.lastIndexOf(".") + 1);
- log.trace("[" + this.name + "]" + name + ":" +
method);
+ DEPLOYMENT_LOGGER.trace("[" + this.name + "]" + name +
":" + method);
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -22,17 +22,16 @@
package org.jboss.ws.common.deployment;
import static org.jboss.ws.common.integration.WSHelper.isJaxrpcDeployment;
-import static org.jboss.ws.common.integration.WSHelper.isJaxwsJseEndpoint;
import static org.jboss.ws.common.integration.WSHelper.isJaxwsEjbEndpoint;
+import static org.jboss.ws.common.integration.WSHelper.isJaxwsJseEndpoint;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import org.jboss.ws.api.annotation.WebContext;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -57,14 +56,13 @@
*/
public class EndpointAddressDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointAddressDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
final Service service = dep.getService();
String contextRoot = service.getContextRoot();
if (contextRoot == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_CONTEXT_ROOT"));
+ throw Messages.MESSAGES.cannotObtainContextRoot(dep.getSimpleName());
// TODO: remove this hack - review API
String protocol = (String)service.getProperty("protocol");
@@ -94,7 +92,7 @@
HttpEndpoint httpEp = (HttpEndpoint)ep;
String urlPattern = httpEp.getURLPattern();
if (urlPattern == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_URL_PATTERN"));
+ throw Messages.MESSAGES.cannotObtainUrlPattern(ep.getName());
if (urlPattern.endsWith("/*"))
urlPattern = urlPattern.substring(0, urlPattern.length() - 2);
@@ -138,7 +136,7 @@
String urlPattern = servletMappings.get(servletLink);
if (urlPattern == null)
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_URL_PATTERN", servletLink));
+ throw Messages.MESSAGES.cannotFindUrlPatternForServletName(servletLink);
List<JSESecurityMetaData> securityList =
webMetaData.getSecurityMetaData();
for (JSESecurityMetaData currentSecurity : securityList)
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointLifecycleDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,9 +21,7 @@
*/
package org.jboss.ws.common.deployment;
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -38,8 +36,6 @@
*/
public class EndpointLifecycleDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointLifecycleDeploymentAspect.class);
-
@Override
public void start(Deployment dep)
{
@@ -68,7 +64,7 @@
{
LifecycleHandler lifecycleHandler = ep.getLifecycleHandler();
if (lifecycleHandler == null && assertHandler)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"LIFECYCLEHANDLER_NOT_INITIALISED"));
+ throw Messages.MESSAGES.lifecycleHandlerNotInitialized(ep.getName());
return lifecycleHandler;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,9 +21,7 @@
*/
package org.jboss.ws.common.deployment;
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -37,15 +35,12 @@
*/
public class EndpointNameDeploymentAspect extends AbstractDeploymentAspect
{
-
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointNameDeploymentAspect.class);
-
@Override
public void start(Deployment dep)
{
final String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH", contextRoot));
+ throw
Messages.MESSAGES.contextRootExpectedToStartWithLeadingSlash(contextRoot);
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointRecordProcessorDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,13 +23,13 @@
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.management.JMException;
import javax.management.MBeanServer;
+import javax.management.ObjectName;
import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Loggers;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
@@ -44,7 +44,6 @@
*/
public class EndpointRecordProcessorDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EndpointRecordProcessorDeploymentAspect.class);
private MBeanServer mbeanServer;
private List<RecordProcessor> processors;
@@ -94,33 +93,35 @@
private void registerRecordProcessor(RecordProcessor processor, Endpoint ep)
{
+ final ObjectName on = ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName());
try
{
- mbeanServer.registerMBean(processor, ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName()));
+ mbeanServer.registerMBean(processor, on);
}
catch (JMException ex)
{
- log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ Loggers.MANAGEMENT_LOGGER.cannotRegisterProvidedProcessor(on, ex);
try
{
- mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(ep.getName() + ",recordProcessor=" +
processor.getName()));
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), on);
}
catch (JMException innerEx)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
+ Loggers.MANAGEMENT_LOGGER.cannotRegisterProcessorWithJmxServer(on, innerEx);
}
}
}
private void unregisterRecordProcessor(RecordProcessor processor, Endpoint ep)
{
+ final ObjectName on = ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName());
try
{
- mbeanServer.unregisterMBean(ObjectNameFactory.create(ep.getName() +
",recordProcessor=" + processor.getName()));
+ mbeanServer.unregisterMBean(on);
}
catch (JMException ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER"), ex);
+ Loggers.MANAGEMENT_LOGGER.cannotUnregisterProcessorWithJmxServer(on, ex);
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,13 +23,12 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.ResourceBundle;
+import java.net.URL;
import org.jboss.jaxb.intros.BindingCustomizationFactory;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.binding.BindingCustomization;
import org.jboss.ws.api.binding.JAXBBindingCustomization;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Loggers;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -44,8 +43,6 @@
*/
public class JAXBIntroDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JAXBIntroDeploymentAspect.class);
- private static Logger logger = Logger.getLogger(JAXBIntroDeploymentAspect.class);
private static final String META_INF_JAXB_INTROS_XML =
"META-INF/jaxb-intros.xml";
private static final String WEB_INF_JAXB_INTROS_XML =
"WEB-INF/jaxb-intros.xml";
@@ -54,19 +51,21 @@
// assert ArchiveDeployment
if(! (deployment instanceof ArchiveDeployment) )
{
- if (log.isTraceEnabled())
- log.trace("JAXBIntroDeploymentAspect doesn't work on " +
deployment.getClass());
+ if (Loggers.DEPLOYMENT_LOGGER.isTraceEnabled())
+ Loggers.DEPLOYMENT_LOGGER.aspectDoesNotWorkOnDeployment(this.getClass(),
deployment.getClass());
return;
}
ArchiveDeployment archive = (ArchiveDeployment)deployment;
InputStream introsConfigStream = null;
+ URL url = null;
try
{
// META-INF first
UnifiedVirtualFile vfs =
archive.getRootFile().findChild(META_INF_JAXB_INTROS_XML);
- introsConfigStream = vfs.toURL().openStream();
+ url = vfs.toURL();
+ introsConfigStream = url.openStream();
} catch (Exception e) {}
if(null == introsConfigStream)
@@ -75,7 +74,8 @@
{
// WEB-INF second
UnifiedVirtualFile vfs =
archive.getRootFile().findChild(WEB_INF_JAXB_INTROS_XML);
- introsConfigStream = vfs.toURL().openStream();
+ url = vfs.toURL();
+ introsConfigStream = url.openStream();
} catch (Exception e) {
return;
}
@@ -107,7 +107,7 @@
try {
introsConfigStream.close();
} catch (IOException e) {
- logger.error(BundleUtils.getMessage(bundle,
"ERROR_CLOSING_JAXB_INTRODUCTIONS", deployment.getService().getContextRoot() ),
e);
+ Loggers.DEPLOYMENT_LOGGER.errorClosingJAXBIntroConf(url, e);
}
}
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,24 +0,0 @@
-REQUIRED_CONDITIONS_''_NOT_SATISFIED_BY_''_FOR=Required conditions
'{0}' not satisfied by '{1}' for: {2}
-CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH=Context root expected to start with
leading slash: {0}
-TARGET_BEAN_NOT_SET=Target bean not set
-CANNOT_MODIFY_ENDPOINT_PROPERTIES_IN_STATE=Cannot modify endpoint properties in state:
{0}
-CONTEXT_ROOT_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=Context root must be the same
for all deployed endpoints
-CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
-CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER=Cannot unregister record processor
with JMX server
-MUST_SHARE_THE_SAME_CONTEXT_ROOT=All endpoints must share the same <context-root>:
{0}!={1}
-FAILED_TO_READ=Failed to read {0}:{1}
-UNEXPECTED_ELEMENT=Unexpected element: {0}
-REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
-CANNOT_START_ENDPOINT_IN_STATE=Cannot start endpoint in state: {0}
-INVOCATION_HANDLER_NOT_AVAILABLE=Invocation handler not available
-CANNOT_STOP_ENDPOINT_IN_STATE=Cannot stop endpoint in state: {0}
-COULD_NOT_FIND_IN_THE_ADDITIONAL_METADATAFILES=Could not find {0} in the additional
metadatafiles!
-VIRTUALHOST_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS=virtualHost must be the same for
all deployed endpoints
-CANNOT_OBTAIN_SERVLET_MAPPING_FOR=Cannot obtain servlet mapping for: {0}
-LIFECYCLEHANDLER_NOT_INITIALISED=LifecycleHandler not initialised
-CANNOT_OBTAIN_CONTEXT_ROOT=Cannot obtain context root
-CANNOT_OBTAIN_URL_PATTERN=Cannot obtain url pattern
-CANNOT_FIND_URL_PATTERN=Cannot find <url-pattern> for servlet-name: {0}
-USING_INITAL_CLASS_LAODER_AS_RUNTIME_LAODER=Using inital class laoder as runtime laoder.
Hack?
-ERROR_CLOSING_JAXB_INTRODUCTIONS=[{0}] Error closing JAXB Introductions Configurations
stream
-ERROR_DESTROYING_DEPLOYMENT=Error while destroying deployment due to previous exception
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/ResourceResolverImpl.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,15 +21,15 @@
*/
package org.jboss.ws.common.deployment;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
import java.util.Iterator;
-import java.util.ResourceBundle;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.deployment.ResourceResolver;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -42,9 +42,6 @@
*/
public class ResourceResolverImpl implements ResourceResolver
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ResourceResolverImpl.class);
- private static Logger log = Logger.getLogger(ResourceResolverImpl.class);
-
private UnifiedVirtualFile rootFile;
private Collection<UnifiedVirtualFile> metadataFiles;
@@ -87,8 +84,7 @@
}
else
{
- if (log.isTraceEnabled())
- log.trace("Cannot get " + resourcePath + " from root
file, trying with additional metadata files", e);
+
ROOT_LOGGER.cannotGetRootFileTryingWithAdditionalMetaData(resourcePath);
}
}
}
@@ -115,13 +111,12 @@
}
catch (IOException e)
{
- if (log.isTraceEnabled())
- log.trace("Cannot get " + resourcePath + " from
" + uvf, e);
+ ROOT_LOGGER.cannotGetRootResourceFrom(resourcePath, uvf, e);
}
}
}
if (vfResource == null)
- throw new IOException(BundleUtils.getMessage(bundle,
"COULD_NOT_FIND_IN_THE_ADDITIONAL_METADATAFILES", resourcePath ));
+ throw Messages.MESSAGES.cannotFindInAdditionalMetaData(resourcePath);
resourceURL = vfResource.toURL();
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/SOAPAddressWSDLParser.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,6 +23,7 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+import static org.jboss.ws.common.Messages.MESSAGES;
import static org.jboss.wsf.spi.util.StAXUtils.attributeAsQName;
import static org.jboss.wsf.spi.util.StAXUtils.match;
import static org.jboss.wsf.spi.util.StAXUtils.nextElement;
@@ -32,15 +33,12 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import javax.xml.ws.WebServiceException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.util.StAXUtils;
/**
@@ -50,7 +48,6 @@
*/
public final class SOAPAddressWSDLParser
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SOAPAddressWSDLParser.class);
public static final String SOAP_OVER_JMS_NS =
"http://www.w3.org/2010/soapjms/";
private static final String WSDL_NS = "http://schemas.xmlsoap.org/wsdl/";
private static final String SOAP_NS =
"http://schemas.xmlsoap.org/wsdl/soap/";
@@ -98,11 +95,11 @@
{
is = wsdlUrl.openStream();
XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
- return getMetaData(xmlr);
+ return getMetaData(xmlr, wsdlUrl);
}
catch (Exception e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_READ", new Object[]{ wsdlUrl , e.getMessage()}), e);
+ throw MESSAGES.failedToRead(wsdlUrl.toExternalForm(), e.getMessage(), e);
}
finally
{
@@ -114,7 +111,7 @@
}
}
- private static WSDLMetaData getMetaData(XMLStreamReader reader) throws
XMLStreamException
+ private static WSDLMetaData getMetaData(XMLStreamReader reader, URL wsdlUrl) throws
XMLStreamException
{
int iterate;
try
@@ -138,18 +135,18 @@
if (match(reader, WSDL_NS, DEFINITIONS))
{
String targetNS = reader.getAttributeValue(null, TARGET_NAMESPACE);
- parseDefinitions(reader, metadata, targetNS);
+ parseDefinitions(reader, metadata, targetNS, wsdlUrl);
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(wsdlUrl.toExternalForm(),
reader.getLocalName());
}
}
}
return metadata;
}
- private static void parseDefinitions(XMLStreamReader reader, WSDLMetaData metadata,
String targetNS) throws XMLStreamException
+ private static void parseDefinitions(XMLStreamReader reader, WSDLMetaData metadata,
String targetNS, URL wsdlUrl) throws XMLStreamException
{
while (reader.hasNext())
{
@@ -165,13 +162,13 @@
case XMLStreamConstants.START_ELEMENT : {
if (match(reader, WSDL_NS, SERVICE)) {
QName name = attributeAsQName(reader, null, NAME, targetNS);
- WSDLServiceMetaData smd = parseService(reader, targetNS);
+ WSDLServiceMetaData smd = parseService(reader, targetNS, wsdlUrl);
smd.setName(name);
metadata.getServices().put(smd.getName(), smd);
}
else if (match(reader, WSDL_NS, BINDING)) {
QName name = attributeAsQName(reader, null, NAME, targetNS);
- WSDLBindingMetaData bmd = parseBinding(reader);
+ WSDLBindingMetaData bmd = parseBinding(reader, wsdlUrl);
bmd.setName(name);
metadata.getBindings().put(bmd.getName(), bmd);
}
@@ -179,10 +176,10 @@
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(wsdlUrl.toExternalForm());
}
- private static WSDLServiceMetaData parseService(XMLStreamReader reader, String
targetNS) throws XMLStreamException
+ private static WSDLServiceMetaData parseService(XMLStreamReader reader, String
targetNS, URL wsdlUrl) throws XMLStreamException
{
WSDLServiceMetaData smd = new WSDLServiceMetaData();
while (reader.hasNext())
@@ -200,7 +197,7 @@
if (match(reader, WSDL_NS, PORT)) {
QName name = attributeAsQName(reader, null, NAME, targetNS);
QName binding = attributeAsQName(reader, null, BINDING, targetNS);
- WSDLPortMetaData pmd = parsePort(reader);
+ WSDLPortMetaData pmd = parsePort(reader, wsdlUrl);
pmd.setName(name);
pmd.setBindingName(binding);
smd.getPorts().put(pmd.getName(), pmd);
@@ -209,10 +206,10 @@
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(wsdlUrl.toExternalForm());
}
- private static WSDLPortMetaData parsePort(XMLStreamReader reader) throws
XMLStreamException
+ private static WSDLPortMetaData parsePort(XMLStreamReader reader, URL wsdlUrl) throws
XMLStreamException
{
WSDLPortMetaData pmd = new WSDLPortMetaData();
while (reader.hasNext())
@@ -236,10 +233,10 @@
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(wsdlUrl.toExternalForm());
}
- private static WSDLBindingMetaData parseBinding(XMLStreamReader reader) throws
XMLStreamException
+ private static WSDLBindingMetaData parseBinding(XMLStreamReader reader, URL wsdlUrl)
throws XMLStreamException
{
WSDLBindingMetaData bmd = new WSDLBindingMetaData();
while (reader.hasNext())
@@ -263,7 +260,7 @@
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(wsdlUrl.toExternalForm());
}
private static class WSDLMetaData
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -24,13 +24,12 @@
import static org.jboss.ws.common.integration.WSHelper.isEjbEndpoint;
import static org.jboss.ws.common.integration.WSHelper.isJseEndpoint;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
import javax.jws.WebService;
import org.jboss.ws.api.annotation.WebContext;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -47,8 +46,6 @@
*/
public class URLPatternDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(URLPatternDeploymentAspect.class);
-
@Override
public void start(Deployment dep)
{
@@ -85,7 +82,7 @@
String epName = ep.getShortName();
urlPattern = webMetaData.getServletMappings().get(epName);
if (urlPattern == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_SERVLET_MAPPING_FOR", epName));
+ throw Messages.MESSAGES.cannotObtainServletMapping(epName);
}
// #2 Use the explicit urlPattern from port-component/port-component-uri
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -24,10 +24,8 @@
import static org.jboss.ws.common.integration.WSHelper.isJaxwsEjbDeployment;
-import java.util.ResourceBundle;
-
import org.jboss.ws.api.annotation.WebContext;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -40,8 +38,6 @@
*/
public final class VirtualHostDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(VirtualHostDeploymentAspect.class);
-
@Override
public void start(Deployment dep)
{
@@ -71,7 +67,7 @@
{
if (!currentVirtualHost.equals(virtualHost))
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"VIRTUALHOST_MUST_BE_THE_SAME_FOR_ALL_DEPLOYED_ENDPOINTS"));
+ throw
Messages.MESSAGES.virtualHostMustBeTheSameForAllEndpoints(dep.getSimpleName());
}
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionException.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,10 +21,8 @@
*/
package org.jboss.ws.common.injection;
-import java.util.ResourceBundle;
+import org.jboss.ws.common.Loggers;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
/**
* Represents generic injection error.
@@ -33,16 +31,10 @@
*/
public class InjectionException extends RuntimeException
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionException.class);
-
/**
* Serial version UID.
*/
private static final long serialVersionUID = 1L;
- /**
- * Logger.
- */
- private static final Logger LOG = Logger.getLogger(InjectionException.class);
/**
* Constructor.
@@ -103,10 +95,10 @@
{
if (reason == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"REASON_EXPECTED"));
+ throw new IllegalArgumentException();
}
- LOG.error(message == null ? reason.getMessage() : message, reason);
+ Loggers.ROOT_LOGGER.error(message == null ? reason.getMessage() : message,
reason);
throw new InjectionException(message, reason);
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/InjectionHelper.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -24,12 +24,9 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
-import java.util.ResourceBundle;
import javax.xml.ws.WebServiceContext;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.injection.finders.PostConstructMethodFinder;
import org.jboss.ws.common.injection.finders.PreDestroyMethodFinder;
import org.jboss.ws.common.injection.finders.ResourceFieldFinder;
@@ -43,10 +40,6 @@
*/
public final class InjectionHelper
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(InjectionHelper.class);
-
- private static final Logger LOG = Logger.getLogger(InjectionHelper.class);
-
private static final ClassProcessor<Method> POST_CONSTRUCT_METHOD_FINDER = new
PostConstructMethodFinder();
private static final ClassProcessor<Method> PRE_DESTROY_METHOD_FINDER = new
PreDestroyMethodFinder();
private static final ClassProcessor<Method> WEB_SERVICE_CONTEXT_METHOD_FINDER =
new ResourceMethodFinder(WebServiceContext.class, true);
@@ -111,15 +104,13 @@
public static void callPostConstructMethod(final Object instance)
{
if (instance == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"OBJECT_INSTANCE_CANNOT_BE_NULL"));
+ throw new IllegalArgumentException();
final Collection<Method> methods =
POST_CONSTRUCT_METHOD_FINDER.process(instance.getClass());
if (methods.size() > 0)
{
final Method method = methods.iterator().next();
- if (LOG.isTraceEnabled())
- LOG.trace("Calling @PostConstruct annotated method: " + method);
try
{
invokeMethod(instance, method, null);
@@ -142,15 +133,13 @@
public static void callPreDestroyMethod(final Object instance)
{
if (instance == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"OBJECT_INSTANCE_CANNOT_BE_NULL"));
+ throw new IllegalArgumentException();
final Collection<Method> methods =
PRE_DESTROY_METHOD_FINDER.process(instance.getClass());
if (methods.size() > 0)
{
final Method method = methods.iterator().next();
- if (LOG.isTraceEnabled())
- LOG.trace("Calling @PreDestroy annotated method: " + method);
try
{
invokeMethod(instance, method, null);
Deleted: common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/injection/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,2 +0,0 @@
-REASON_EXPECTED=Reason expected
-OBJECT_INSTANCE_CANNOT_BE_NULL=Object instance cannot be null
Deleted:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,15 +0,0 @@
-METHOD_CANNOT_DECLARE_PRIMITIVE_PARAMETERS=Method {0} can't declare primitive
parameters: {1}
-FIELD_CANNOT_BE_OF_PRIMITIVE_TYPE=Field {0} can't be of primitive type: {1}
-METHOD_HAVE_TO_HAVE_NO_PARAMETERS=Method {0} have to have no parameters: {1}
-METHOD_HAVE_TO_RETURN_VOID=Method {0} have to return void: {1}
-FIELD_CANNOT_BE_OF_VOID_TYPE=Field {0} cannot be of void type: {1}
-METHOD_CANNOT_THROW_CHECKED_EXCEPTIONS=Method {0} cannot throw checked exceptions: {1}
-METHOD_CANNOT_BE_STATIC=Method {0} cannot be static: {1}
-FIELD_CANNOT_BE_STATIC=Field {0} cannot be static: {1}
-FIELD_CANNOT_BE_FINAL=Field {0} cannot be final: {1}
-METHOD_HAVE_TO_DECLARE_EXACTLY_ONE_PARAMETER=Method {0} have to declare exactly one
parameter: {1}
-METHOD_DOESN'T_FOLLOW_JAVA_BEANS_SETTER_METHOD_NAME=Method {0} doesn't follow
Java Beans setter method name: {1}
-ONLY_ONE_METHOD_CAN_EXIST=Only one method {0} can exist
-INJECTION_METADATA_CANNOT_BE_NULL=Injection metadata cannot be null
-MORE_THAN_ONE_FIELD_FOUND_MATCHING_THE_CRITERIA=More than one field found matching the
criteria: {0}
-MORE_THAN_ONE_METHOD_FOUND_MATCHING_THE_CRITERIA=More than one method found matching the
criteria: {0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,16 +21,14 @@
*/
package org.jboss.ws.common.injection.finders;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collection;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.injection.InjectionException;
-
/**
* Reflection utility class.
*
@@ -38,8 +36,6 @@
*/
final class ReflectionUtils
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ReflectionUtils.class);
-
/**
* Constructor.
*/
@@ -60,7 +56,7 @@
{
if (type.isPrimitive())
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_DECLARE_PRIMITIVE_PARAMETERS", new Object[]{
getAnnotationMessage(annotation) , method}));
+ throw annotation == null ?
MESSAGES.methodCannotDeclarePrimitiveParameters(method) :
MESSAGES.methodCannotDeclarePrimitiveParameters2(method, annotation);
}
}
}
@@ -85,7 +81,7 @@
{
if (field.getType().isPrimitive())
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_OF_PRIMITIVE_TYPE", new Object[]{
getAnnotationMessage(annotation) , field}));
+ throw annotation == null ? MESSAGES.fieldCannotBeOfPrimitiveOrVoidType(field) :
MESSAGES.fieldCannotBeOfPrimitiveOrVoidType2(field, annotation);
}
}
@@ -109,7 +105,7 @@
{
if (method.getParameterTypes().length != 0)
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_HAVE_NO_PARAMETERS", new Object[]{
getAnnotationMessage(annotation) , method}));
+ throw annotation == null ? MESSAGES.methodHasToHaveNoParameters(method) :
MESSAGES.methodHasToHaveNoParameters2(method, annotation);
}
}
@@ -133,7 +129,7 @@
{
if ((!method.getReturnType().equals(Void.class)) &&
(!method.getReturnType().equals(Void.TYPE)))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_RETURN_VOID", new Object[]{ getAnnotationMessage(annotation) ,
method}));
+ throw annotation == null ? MESSAGES.methodHasToReturnVoid(method) :
MESSAGES.methodHasToReturnVoid2(method, annotation);
}
}
@@ -157,7 +153,7 @@
{
if ((field.getClass().equals(Void.class)) &&
(field.getClass().equals(Void.TYPE)))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_OF_VOID_TYPE", new Object[]{ getAnnotationMessage(annotation) ,
field}));
+ throw annotation == null ? MESSAGES.fieldCannotBeOfPrimitiveOrVoidType(field) :
MESSAGES.fieldCannotBeOfPrimitiveOrVoidType2(field, annotation);
}
}
@@ -185,7 +181,7 @@
Class<?> exception = declaredExceptions[i];
if (!exception.isAssignableFrom(RuntimeException.class))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_THROW_CHECKED_EXCEPTIONS", new Object[]{
getAnnotationMessage(annotation) , method}));
+ throw annotation == null ? MESSAGES.methodCannotThrowCheckedException(method)
: MESSAGES.methodCannotThrowCheckedException2(method, annotation);
}
}
}
@@ -210,7 +206,7 @@
{
if (Modifier.isStatic(method.getModifiers()))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_CANNOT_BE_STATIC", new Object[]{ getAnnotationMessage(annotation) ,
method}));
+ throw annotation == null ? MESSAGES.methodCannotBeStatic(method) :
MESSAGES.methodCannotBeStatic2(method, annotation);
}
}
@@ -234,7 +230,7 @@
{
if (Modifier.isStatic(field.getModifiers()))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_STATIC", new Object[]{ getAnnotationMessage(annotation) ,
field}));
+ throw annotation == null ? MESSAGES.fieldCannotBeStaticOrFinal(field) :
MESSAGES.fieldCannotBeStaticOrFinal2(field, annotation);
}
}
@@ -258,7 +254,7 @@
{
if (Modifier.isFinal(field.getModifiers()))
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"FIELD_CANNOT_BE_FINAL", new Object[]{ getAnnotationMessage(annotation) ,
field}));
+ throw annotation == null ? MESSAGES.fieldCannotBeStaticOrFinal(field) :
MESSAGES.fieldCannotBeStaticOrFinal2(field, annotation);
}
}
@@ -282,7 +278,7 @@
{
if (method.getParameterTypes().length != 1)
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_HAVE_TO_DECLARE_EXACTLY_ONE_PARAMETER", new Object[]{
getAnnotationMessage(annotation) , method}));
+ throw annotation == null ?
MESSAGES.methodHasToDeclareExactlyOneParameter(method) :
MESSAGES.methodHasToDeclareExactlyOneParameter2(method, annotation);
}
}
@@ -311,7 +307,7 @@
if (!correctMethodNameLength || !isSetterMethodName || !isUpperCasedPropertyName)
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"METHOD_DOESN'T_FOLLOW_JAVA_BEANS_SETTER_METHOD_NAME", new Object[]{
getAnnotationMessage(annotation) , method}));
+ throw annotation == null ?
MESSAGES.methodDoesNotRespectJavaBeanSetterMethodName(method) :
MESSAGES.methodDoesNotRespectJavaBeanSetterMethodName2(method, annotation);
}
}
@@ -335,7 +331,7 @@
{
if (methods.size() > 1)
{
- throw new InjectionException(BundleUtils.getMessage(bundle,
"ONLY_ONE_METHOD_CAN_EXIST", getAnnotationMessage(annotation) ));
+ throw annotation == null ? MESSAGES.onlyOneMethodCanExist() :
MESSAGES.onlyOneMethodCanExist2(annotation);
}
}
@@ -349,15 +345,4 @@
assertOnlyOneMethod(methods, null);
}
- /**
- * Constructs annotation message. If annotation class is null it returns empty
string.
- *
- * @param annotation to construct message for
- * @return annotation message or empty string
- */
- private static String getAnnotationMessage(Class<? extends Annotation>
annotation)
- {
- return annotation == null ? "" : "annotated with @" +
annotation + " annotation ";
- }
-
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/AbstractReferenceResolver.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -25,9 +25,8 @@
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.injection.ReferenceResolver;
/**
@@ -42,8 +41,6 @@
public abstract class AbstractReferenceResolver<A extends Annotation>
implements ReferenceResolver
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractReferenceResolver.class);
-
/**
* Resolved annotation.
*/
@@ -58,7 +55,7 @@
if (annotationClass == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ANNOTATION_CLASS_CANNOT_BE_NULL"));
+ throw Messages.MESSAGES.annotationClassCannotBeNull();
}
this.annotationClass = annotationClass;
@@ -71,7 +68,7 @@
{
if (!this.canResolve(accessibleObject))
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_RESOLVE", accessibleObject));
+ throw Messages.MESSAGES.cannotResolve(accessibleObject);
}
if (accessibleObject.getClass().equals(Method.class))
@@ -123,7 +120,7 @@
{
if (accessibleObject == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ACCESSIBLEOBJECT_CANNOT_BE_NULL"));
+ throw Messages.MESSAGES.accessibleObjectClassCannotBeNull();
}
}
Deleted:
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/injection/resolvers/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,3 +0,0 @@
-ANNOTATION_CLASS_CANNOT_BE_NULL=Annotation class cannot be null
-CANNOT_RESOLVE=Cannot resolve: {0}
-ACCESSIBLEOBJECT_CANNOT_BE_NULL=AccessibleObject cannot be null
Modified:
common/trunk/src/main/java/org/jboss/ws/common/integration/AbstractDeploymentAspect.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/integration/AbstractDeploymentAspect.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/integration/AbstractDeploymentAspect.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -26,7 +26,6 @@
import java.util.Set;
import java.util.StringTokenizer;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -39,9 +38,6 @@
*/
public class AbstractDeploymentAspect implements DeploymentAspect
{
- // provide logging
- protected final Logger log = Logger.getLogger(getClass());
-
private String provides;
private String requires;
private int relativeOrder;
Deleted: common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/integration/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1 +0,0 @@
-CAN_NOT_FIND_ATTACHMENT=Cannot find attachment in webservice deployment :{0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/integration/WSHelper.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,17 +21,14 @@
*/
package org.jboss.ws.common.integration;
-import java.util.ResourceBundle;
-
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXRPC;
+import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_EJB21;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXRPC_JSE;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_EJB3;
import static org.jboss.wsf.spi.deployment.EndpointType.JAXWS_JSE;
-import static org.jboss.wsf.spi.deployment.DeploymentType.JAXWS;
-import static org.jboss.wsf.spi.deployment.DeploymentType.JAXRPC;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
@@ -41,12 +38,8 @@
*
* @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
-public final class WSHelper
-{
+public final class WSHelper {
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSHelper.class);
- private static final Logger LOG = Logger.getLogger( WSHelper.class );
-
private static final EndpointTypeFilter JAXRPC_EJB_ENDPOINT_FILTER = new
EndpointTypeFilterImpl( JAXRPC_EJB21 );
private static final EndpointTypeFilter JAXRPC_JSE_ENDPOINT_FILTER = new
EndpointTypeFilterImpl( JAXRPC_JSE );
private static final EndpointTypeFilter JAXWS_EJB_ENDPOINT_FILTER = new
EndpointTypeFilterImpl( JAXWS_EJB3 );
@@ -77,8 +70,7 @@
final A value = dep.getAttachment( key );
if ( value == null )
{
- LOG.error(BundleUtils.getMessage(bundle, "CAN_NOT_FIND_ATTACHMENT",
key ));
- throw new IllegalStateException();
+ throw Messages.MESSAGES.cannotFindAttachmentInDeployment(key,
dep.getSimpleName());
}
return value;
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandler.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandler.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -40,9 +40,8 @@
public abstract class AbstractInvocationHandler extends InvocationHandler
{
- /** Logger. */
- protected final Logger log = Logger.getLogger(this.getClass());
-
+ protected final Logger log = Logger.getLogger(this.getClass()); //TODO! remove after
having refactored the AbstractInvocationHandlerEJB3 in ASIL
+
/**
* Constructor.
*/
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/AbstractInvocationHandlerJSE.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -22,13 +22,12 @@
package org.jboss.ws.common.invocation;
import java.lang.reflect.Method;
-import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Loggers;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
@@ -40,8 +39,6 @@
*/
public abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractInvocationHandlerJSE.class);
-
private static final String POJO_JNDI_PREFIX = "java:comp/env/";
private volatile boolean initialized;
@@ -115,7 +112,7 @@
}
catch (Exception e)
{
- this.log.error(BundleUtils.getMessage(bundle,
"METHOD_INVOCATION_FAILED_WITH_EXCEPTION", e.getMessage()), e);
+ Loggers.ROOT_LOGGER.methodInvocationFailed(e);
// propagate exception
this.handleInvocationException(e);
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/InvocationHandlerJAXWS.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -59,7 +59,6 @@
if (!reference.isInitialized())
{
- this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: "
+ targetBean);
InjectionHelper.callPostConstructMethod(targetBean);
reference.setInitialized();
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,3 +0,0 @@
-METHOD_INVOCATION_FAILED_WITH_EXCEPTION=Method invocation failed with exception: {0}
-UNABLE_TO_READ_FROM_THE_HTTP_SERVLET_REQUEST=Unable to read from the http servlet
request: {0}
-CANNOT_TRACE_SOAPMESSAGE=Cannot trace SOAPMessage
Modified:
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/invocation/RecordingServerHandler.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,13 +21,13 @@
*/
package org.jboss.ws.common.invocation;
+import static org.jboss.ws.common.Loggers.MONITORING_LOGGER;
import java.net.URL;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.servlet.http.HttpServletRequest;
import javax.xml.namespace.QName;
@@ -36,13 +36,11 @@
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.handler.GenericSOAPHandler;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.Record.MessageType;
import org.jboss.ws.api.monitoring.RecordGroupAssociation;
import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.common.monitoring.RecordFactory;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -59,10 +57,6 @@
*/
public class RecordingServerHandler extends GenericSOAPHandler
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(RecordingServerHandler.class);
- // provide logging
- private static Logger log = Logger.getLogger(RecordingServerHandler.class);
-
@SuppressWarnings("unchecked")
protected boolean handleInbound(MessageContext ctx)
{
@@ -82,7 +76,7 @@
}
catch (Exception e)
{
- log.warn(BundleUtils.getMessage(bundle,
"UNABLE_TO_READ_FROM_THE_HTTP_SERVLET_REQUEST", e.getMessage()));
+ MONITORING_LOGGER.unableToReadFromHttpServletRequest(e);
}
}
record.setHeaders((Map<String,List<String>>)(ctx.get(MessageContext.HTTP_REQUEST_HEADERS)));
@@ -106,7 +100,7 @@
}
catch (SOAPException ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_TRACE_SOAPMESSAGE"), ex);
+ MONITORING_LOGGER.cannotTraceSoapMessage(ex);
}
}
endpoint.processRecord(record);
@@ -144,7 +138,7 @@
}
catch (SOAPException ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_TRACE_SOAPMESSAGE"), ex);
+ MONITORING_LOGGER.cannotTraceSoapMessage(ex);
}
}
endpoint.processRecord(record);
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,19 +21,18 @@
*/
package org.jboss.ws.common.management;
+import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
+
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.ResourceBundle;
import javax.management.MBeanServer;
import javax.management.ObjectName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -57,9 +56,6 @@
*/
public abstract class AbstractServerConfig implements AbstractServerConfigMBean,
ServerConfig
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractServerConfig.class);
- private static final Logger log = Logger.getLogger(AbstractServerConfig.class);
-
protected static final ObjectName OBJECT_NAME_SERVER_CONFIG;
static
{
@@ -102,13 +98,13 @@
{
if (host == null || host.trim().length() == 0)
{
- log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ MANAGEMENT_LOGGER.usingUndefinedWebServicesHost(UNDEFINED_HOSTNAME);
host = UNDEFINED_HOSTNAME;
}
if ("0.0.0.0".equals(host))
{
InetAddress localHost = InetAddress.getLocalHost();
- log.debug("Using local host: " + localHost.getHostName());
+ if (MANAGEMENT_LOGGER.isDebugEnabled())
MANAGEMENT_LOGGER.usingLocalHostWebServicesHost(localHost.getHostName());
host = localHost.getHostName();
}
this.webServiceHost = toIPv6URLFormat("127.0.0.1".equals(host) ?
"localhost" : host); // TCK workaround
@@ -123,7 +119,7 @@
}
catch (UnknownHostException e)
{
- log.debug(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_ADDRESS_FOR_HOST", host), e);
+ MANAGEMENT_LOGGER.couldNotGetAddressForHost(host, e);
//ignore, leave isIPv6Address to false
}
final boolean isIPv6Formatted = isIPv6Address &&
host.startsWith("[");
@@ -159,8 +155,7 @@
int localPort = webServicePort;
if (localPort <= 0)
{
- // Do not initialize webServicePort with the default, the connector port may
become available later
- log.debug("Unable to calculate 'WebServicePort', using default
'8080'");
+ if (MANAGEMENT_LOGGER.isDebugEnabled())
MANAGEMENT_LOGGER.unableToCalculateWebServicesPort("8080");
localPort = 8080;
}
@@ -175,8 +170,7 @@
int localPort = webServiceSecurePort;
if (localPort <= 0)
{
- // Do not initialize webServiceSecurePort with the default, the connector port
may become available later
- log.debug("Unable to calculate 'WebServiceSecurePort', using
default '8443'");
+ if (MANAGEMENT_LOGGER.isDebugEnabled())
MANAGEMENT_LOGGER.unableToCalculateWebServicesSecurePort("8443");
localPort = 8443;
}
@@ -194,7 +188,7 @@
}
catch (WSFException e)
{
- log.warn(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_WEBSERVERINFO"));
+ MANAGEMENT_LOGGER.couldNotGetPortFromConfiguredHTTPConnector();
}
return port;
}
@@ -206,7 +200,7 @@
SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
this.stackConfig = spiProvider.getSPI(StackConfigFactory.class,
cl).getStackConfig();
- log.info(getImplementationTitle() + ' ' + getImplementationVersion());
+ MANAGEMENT_LOGGER.startingWSServerConfig(getImplementationTitle(),
getImplementationVersion());
MBeanServer mbeanServer = getMbeanServer();
if (mbeanServer != null) {
mbeanServer.registerMBean(this, AbstractServerConfigMBean.OBJECT_NAME);
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/DefaultEndpointRegistry.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,15 +21,15 @@
*/
package org.jboss.ws.common.management;
+import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.management.ObjectName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointResolver;
@@ -44,19 +44,15 @@
*/
public class DefaultEndpointRegistry implements EndpointRegistry
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultEndpointRegistry.class);
- // provide logging
- private static final Logger log = Logger.getLogger(DefaultEndpointRegistry.class);
-
private Map<ObjectName, Endpoint> endpoints = new
ConcurrentHashMap<ObjectName, Endpoint>();
public Endpoint getEndpoint(ObjectName epName)
{
if (epName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL"));
+ throw MESSAGES.endpointNameCannotBeNull();
if (isRegistered(epName) == false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NOT_REGISTERED", epName));
+ throw MESSAGES.endpointNotRegistered(epName);
Endpoint endpoint = endpoints.get(epName);
return endpoint;
@@ -70,7 +66,7 @@
public boolean isRegistered(ObjectName epName)
{
if (epName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL"));
+ throw MESSAGES.endpointNameCannotBeNull();
return endpoints.get(epName) != null;
}
@@ -83,29 +79,29 @@
public void register(Endpoint endpoint)
{
if (endpoint == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_CANNOT_BE_NULL"));
+ throw MESSAGES.cannotRegisterUnregisterNullEndpoint();
ObjectName epName = endpoint.getName();
if (epName == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NAME_CANNOT_BE_NULL_FOR", endpoint));
+ throw MESSAGES.cannotRegisterEndpointWithNullName(endpoint.getName());
if (isRegistered(epName))
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_ALREADY_REGISTERED", epName));
+ throw MESSAGES.endpointAlreadyRegistered(epName);
- log.info("register: " + epName);
+ MANAGEMENT_LOGGER.endpointRegistered(epName);
endpoints.put(epName, endpoint);
}
public void unregister(Endpoint endpoint)
{
if (endpoint == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ENDPOINT_CANNOT_BE_NULL"));
+ throw MESSAGES.cannotRegisterUnregisterNullEndpoint();
ObjectName epName = endpoint.getName();
if (isRegistered(epName) == false)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"ENDPOINT_NOT_REGISTERED", epName));
+ throw MESSAGES.endpointNotRegistered(epName);
- log.info("remove: " + epName);
+ MANAGEMENT_LOGGER.endpointUnregistered(epName);
endpoints.remove(epName);
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpoint.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,17 +21,17 @@
*/
package org.jboss.ws.common.management;
+import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
+
import java.util.Date;
import java.util.List;
-import java.util.ResourceBundle;
import javax.management.JMException;
import javax.management.MBeanServer;
+import javax.management.ObjectName;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.RecordProcessor;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.monitoring.ManagedRecordProcessor;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -45,10 +45,8 @@
*/
public class ManagedEndpoint implements ManagedEndpointMBean
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ManagedEndpoint.class);
private Endpoint endpoint;
private MBeanServer mbeanServer;
- private Logger log = Logger.getLogger(this.getClass());
public ManagedEndpoint(Endpoint endpoint, MBeanServer mbeanServer)
{
@@ -132,21 +130,22 @@
public void addRecordProcessor(RecordProcessor processor)
{
+ ObjectName on = ObjectNameFactory.create(endpoint.getName() +
",recordProcessor=" + processor.getName());
this.getRecordProcessors().add(processor);
try
{
- mbeanServer.registerMBean(processor, ObjectNameFactory.create(endpoint.getName()
+ ",recordProcessor=" + processor.getName()));
+ mbeanServer.registerMBean(processor, on);
}
catch (JMException ex)
{
- log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ MANAGEMENT_LOGGER.cannotRegisterProvidedProcessor(on, ex);
try
{
- mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), on);
}
catch (JMException innerEx)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
+ MANAGEMENT_LOGGER.cannotRegisterProcessorWithJmxServer(on, innerEx);
}
}
}
@@ -159,35 +158,37 @@
public void setRecordProcessors(List<RecordProcessor> processors)
{
//unregister current processors
- for (RecordProcessor processor : processors)
+ for (RecordProcessor processor : endpoint.getRecordProcessors())
{
+ final ObjectName on = ObjectNameFactory.create(endpoint.getName() +
",recordProcessor=" + processor.getName());
try
{
- mbeanServer.unregisterMBean(ObjectNameFactory.create(endpoint.getName() +
",recordProcessor=" + processor.getName()));
+ mbeanServer.unregisterMBean(on);
}
catch (JMException ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER"), ex);
+ MANAGEMENT_LOGGER.cannotUnregisterProcessorWithJmxServer(on, ex);
}
}
//set and register the new processors
endpoint.setRecordProcessors(processors);
for (RecordProcessor processor : processors)
{
+ final ObjectName on = ObjectNameFactory.create(endpoint.getName() +
",recordProcessor=" + processor.getName());
try
{
- mbeanServer.registerMBean(processor,
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ mbeanServer.registerMBean(processor, on);
}
catch (JMException ex)
{
- log.debug("Cannot register endpoint with JMX server, trying with the
default ManagedRecordProcessor: " + ex.getMessage());
+ MANAGEMENT_LOGGER.cannotRegisterProvidedProcessor(on, ex);
try
{
- mbeanServer.registerMBean(new ManagedRecordProcessor(processor),
ObjectNameFactory.create(endpoint.getName() + ",recordProcessor=" +
processor.getName()));
+ mbeanServer.registerMBean(new ManagedRecordProcessor(processor), on);
}
catch (JMException innerEx)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), innerEx);
+ MANAGEMENT_LOGGER.cannotRegisterProcessorWithJmxServer(on, innerEx);
}
}
}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/ManagedEndpointRegistry.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,12 +21,11 @@
*/
package org.jboss.ws.common.management;
+import static org.jboss.ws.common.Loggers.MANAGEMENT_LOGGER;
+
import javax.management.JMException;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
import javax.management.MBeanServer;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.Endpoint;
/**
@@ -37,10 +36,6 @@
*/
public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements
ManagedEndpointRegistryMBean
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ManagedEndpointRegistry.class);
- // provide logging
- private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
// The MBeanServer
private MBeanServer mbeanServer;
@@ -66,7 +61,7 @@
}
catch (Exception ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER"), ex);
+ MANAGEMENT_LOGGER.cannotRegisterEndpointWithJmxServer(endpoint.getName(), ex);
}
}
@@ -79,11 +74,11 @@
if (getMbeanServer() != null)
getMbeanServer().unregisterMBean(endpoint.getName());
else
- log.warn(BundleUtils.getMessage(bundle,
"MBEANSERVER_NOT_AVAILABLE"));
+ MANAGEMENT_LOGGER.cannotUnregisterDueToMBeanServerUnavailable();
}
catch (JMException ex)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_UNREGISTER_ENDPOINT_WITH_JMX_SERVER"), ex);
+ MANAGEMENT_LOGGER.cannotUnregisterEndpointWithJmxServer(endpoint.getName(),
ex);
}
}
@@ -97,7 +92,7 @@
public void destroy() throws Exception
{
- log.debug("Destroy service endpoint manager");
+ MANAGEMENT_LOGGER.destroyingServiceEndpointManager();
if (mbeanServer != null)
{
getMbeanServer().unregisterMBean(OBJECT_NAME);
Deleted: common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,13 +0,0 @@
-CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
-CANNOT_UNREGISTER_RECORD_PROCESSOR_WITH_JMX_SERVER=Cannot unregister record processor
with JMX server
-COULD_NOT_GET_ADDRESS_FOR_HOST=Could not get address for host: {0}
-FOUND_MULTIPLE_CONNECTORS=Found multiple connectors for protocol={0} and secure={1},
using first port found {2}
-CANNOT_REGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot register endpoint with JMX server
-MBEANSERVER_NOT_AVAILABLE=MBeanServer not available, cannot unregister endpoint with JMX
server
-CANNOT_UNREGISTER_ENDPOINT_WITH_JMX_SERVER=Cannot unregister endpoint with JMX server
-ENDPOINT_NAME_CANNOT_BE_NULL=Endpoint name cannot be null
-ENDPOINT_NOT_REGISTERED=Endpoint not registered: {0}
-ENDPOINT_CANNOT_BE_NULL=Endpoint cannot be null
-ENDPOINT_NAME_CANNOT_BE_NULL_FOR=Endpoint name cannot be null for: {0}
-ENDPOINT_ALREADY_REGISTERED=Endpoint already registered: {0}
-ENDPOINT_NOT_REGISTERED=Endpoint not registered: {0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/monitoring/LogRecorder.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -24,12 +24,10 @@
import java.io.Serializable;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.monitoring.Record;
import org.jboss.ws.api.monitoring.Record.MessageType;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Loggers;
/**
* A simple record processor that writes records to the configured log.
@@ -39,11 +37,8 @@
*/
public class LogRecorder extends AbstractRecordProcessor implements Serializable
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(LogRecorder.class);
private static final long serialVersionUID = -7126227194320867819L;
- private Logger log = Logger.getLogger(this.getClass());
-
public LogRecorder()
{
this.name = "LogRecorder";
@@ -75,7 +70,6 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle, "UNKNOWN_MESSAGE_TYPE",
record.getMessageType()));
if (this.isProcessSourceHost() && record.getSourceHost() != null)
{
sb.append("from ");
@@ -127,6 +121,6 @@
{
sb.append(record.getEnvelope());
}
- log.debug(sb.toString());
+ Loggers.MONITORING_LOGGER.debug(LogRecorder.class.getName(), sb.toString(), null);
}
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/monitoring/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1 +0,0 @@
-UNKNOWN_MESSAGE_TYPE=Unknown message type: {0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/reflection/AbstractAnnotatedClassProcessor.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -23,9 +23,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
/**
* All annotation aware class processors should extend this class.
@@ -36,8 +35,6 @@
extends AbstractClassProcessor<AO>
implements AnnotationAware<A>
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractAnnotatedClassProcessor.class);
-
/**
* Annotation class.
*/
@@ -51,7 +48,7 @@
public AbstractAnnotatedClassProcessor(final Class<A> annotationClass)
{
if (annotationClass == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ANNOTATION_CLASS_CANNOT_BE_NULL"));
+ throw Messages.MESSAGES.annotationClassCannotBeNull();
this.annotationClass = annotationClass;
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/reflection/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1 +0,0 @@
-ANNOTATION_CLASS_CANNOT_BE_NULL=annotation class cannot be null
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/AbstractServiceObjectFactoryJAXWS.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -29,7 +29,6 @@
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.naming.Context;
import javax.naming.Name;
@@ -43,7 +42,7 @@
import javax.xml.ws.soap.AddressingFeature;
import javax.xml.ws.soap.MTOMFeature;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -56,7 +55,6 @@
*/
public abstract class AbstractServiceObjectFactoryJAXWS implements ObjectFactory
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractServiceObjectFactoryJAXWS.class);
/**
* Creates an object using the location or reference information specified.
* <p/>
@@ -237,7 +235,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_CREATE_SERVICE_WITHOUT_WSDLLOCATION", serviceRefMD));
+ throw
Messages.MESSAGES.cannotCreateServiceWithoutWsdlLocation(serviceRefMD);
}
}
else
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/DefaultServiceRefHandler.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,11 +21,9 @@
*/
package org.jboss.ws.common.serviceref;
-import java.util.ResourceBundle;
-
import javax.naming.Referenceable;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
@@ -40,17 +38,16 @@
*/
public final class DefaultServiceRefHandler implements ServiceRefHandler
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultServiceRefHandler.class);
@Override
public Referenceable createReferenceable(final UnifiedServiceRefMetaData
serviceRefMD)
{
if (serviceRefMD.getVfsRoot() == null)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"VFSROOT_MUST_BE_PROVIDED"));
+ throw
Messages.MESSAGES.missingVFSRootInServiceRef(serviceRefMD.getServiceRefName());
}
if (serviceRefMD.getType() == null)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"SERVICE_REFERENCE_TYPE_MUST_BE_PROVIDED"));
+ throw
Messages.MESSAGES.missingServiceRefTypeInServiceRef(serviceRefMD.getServiceRefName());
}
return this.getBinder(serviceRefMD.getType()).createReferenceable(serviceRefMD);
Deleted: common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,5 +0,0 @@
-CANNOT_CREATE_SERVICE_WITHOUT_WSDLLOCATION=Cannot create generic javax.xml.ws.Service
without wsdlLocation: {0}
-VFSROOT_MUST_BE_PROVIDED=VFSRoot must be provided
-SERVICE_REFERENCE_TYPE_MUST_BE_PROVIDED=Service reference type must be provided
-CANNOT_MARSHALL_SERVICE_REF_META_DATA=Cannot marshall service ref meta data, cause: {0}
-CANNOT_UNMARSHALL_SERVICE_REF_META_DATA=Cannot unmarshall service ref meta data, cause:
{0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/serviceref/ServiceRefSerializer.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.common.serviceref;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -28,11 +30,9 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
-import java.util.ResourceBundle;
import javax.naming.NamingException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
/**
@@ -42,7 +42,6 @@
*/
final class ServiceRefSerializer
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ServiceRefSerializer.class);
static final String SERVICE_REF_META_DATA = "SERVICE_REF_META_DATA";
private ServiceRefSerializer()
@@ -62,7 +61,7 @@
}
catch (final IOException e)
{
- throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_MARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
+ throw MESSAGES.cannotMarshallServiceRefMetaData(e);
}
return baos.toByteArray();
@@ -81,11 +80,11 @@
}
catch (final IOException e)
{
- throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
+ throw MESSAGES.cannotUnMarshallServiceRefMetaData(e);
}
catch (final ClassNotFoundException e)
{
- throw new NamingException(BundleUtils.getMessage(bundle,
"CANNOT_UNMARSHALL_SERVICE_REF_META_DATA", e.getMessage()));
+ throw MESSAGES.cannotUnMarshallServiceRefMetaData(e);
}
return sref;
Modified: common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/sort/DeploymentAspectSorter.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -28,10 +28,9 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
/**
@@ -42,8 +41,6 @@
*/
public final class DeploymentAspectSorter
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(DeploymentAspectSorter.class);
-
private static final DeploymentAspectSorter INSTANCE = new DeploymentAspectSorter();
private DeploymentAspectSorter()
@@ -77,8 +74,7 @@
return aspect;
}
}
-
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"NO_DEPLOYMENT_ASPECT_FOUND"));
+ throw Messages.MESSAGES.noDeploymentAspectFoundWithAttributeLast();
}
private Graph createOrientedGraph(final List<DeploymentAspect> aspects)
@@ -177,7 +173,7 @@
if (this.vertices.size() > 0)
{
// if graph has edges then graph has at least one cycle
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CYCLE_DETECTED_IN_SUBGRAPH", this.vertices));
+ throw Messages.MESSAGES.cycleDetectedInSubGraph(this.vertices);
}
else
{
Deleted: common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/sort/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,2 +0,0 @@
-NO_DEPLOYMENT_ASPECT_FOUND=No deployment aspect found with attribute last='true'
-CYCLE_DETECTED_IN_SUBGRAPH=Cycle detected in subgraph: {0}
Modified: common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,10 +21,8 @@
*/
package org.jboss.ws.common.spi;
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.api.util.ServiceLoader;
+import org.jboss.ws.common.Messages;
import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.ws.common.deployment.DefaultLifecycleHandlerFactory;
import org.jboss.ws.common.invocation.DefaultResourceInjectorFactory;
@@ -34,7 +32,6 @@
import org.jboss.ws.common.security.DefaultSecurityAdapterFactory;
import org.jboss.ws.common.serviceref.DefaultServiceRefHandlerFactory;
import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
@@ -50,7 +47,6 @@
*/
class DefaultSPIProvider extends SPIProvider
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(DefaultSPIProvider.class);
/**
* Gets the specified SPI, using the provided classloader
*/
@@ -99,7 +95,7 @@
}
if (returnType == null)
- throw new WSFException(BundleUtils.getMessage(bundle,
"FAILED_TO_PROVIDE_SPI", spiType ));
+ throw Messages.MESSAGES.failedToProvideSPI(spiType);
return returnType;
}
Deleted: common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/spi/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1 +0,0 @@
-FAILED_TO_PROVIDE_SPI=Failed to provide SPI:{0}
Modified:
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.common.utils;
+import static org.jboss.ws.common.Loggers.DEPLOYMENT_LOGGER;;
+import static org.jboss.ws.common.Messages.MESSAGES;
import static org.jboss.ws.common.integration.WSHelper.isJseDeployment;
import static org.jboss.ws.common.integration.WSHelper.isWarArchive;
@@ -32,7 +34,6 @@
import java.net.URL;
import java.util.Iterator;
import java.util.List;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.Import;
@@ -42,8 +43,6 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.spi.SPIProvider;
@@ -62,9 +61,6 @@
*/
public abstract class AbstractWSDLFilePublisher
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractWSDLFilePublisher.class);
- private static final Logger log = Logger.getLogger(AbstractWSDLFilePublisher.class);
-
// The deployment info for the web service archive
protected ArchiveDeployment dep;
// The expected wsdl location in the deployment
@@ -113,7 +109,7 @@
}
catch (ParserConfigurationException pce)
{
- log.error(pce);
+ DEPLOYMENT_LOGGER.error(pce);
}
builder = DOMUtils.newDocumentBuilder(factory);
}
@@ -168,7 +164,7 @@
wsdlWriter.writeWSDL(subdef, fw);
fw.close();
- log.debug("WSDL import published to: " + targetURL);
+ DEPLOYMENT_LOGGER.wsdlImportPublishedTo(targetURL);
// recursively publish imports
publishWsdlImports(targetURL, subdef, published, expLocation);
@@ -233,7 +229,7 @@
URL resourceURL = dep.getResourceResolver().resolve(resourcePath);
InputStream is = new ResourceURL(resourceURL).openStream();
if (is == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_SCHEMA_IMPORT_IN_DEPLOYMENT", resourcePath));
+ throw MESSAGES.cannotFindSchemaImportInDeployment(resourcePath,
deploymentName);
FileOutputStream fos = null;
try
@@ -246,7 +242,7 @@
if (fos != null) fos.close();
}
- log.debug("XMLSchema import published to: " + xsdURL);
+ DEPLOYMENT_LOGGER.xmlSchemaImportPublishedTo(xsdURL);
// recursively publish imports
Element subdoc = DOMUtils.parse(xsdURL.openStream(),
getDocumentBuilder());
@@ -289,7 +285,7 @@
else
{
if (file.delete() == false)
- log.warn(BundleUtils.getMessage(bundle,
"CANNOT_DELETE_PUBLISHED_WSDL_DOCUMENT", file.toURI().toURL()));
+ DEPLOYMENT_LOGGER.cannotDeletePublishedWsdlDoc(file.toURI().toURL());
}
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/JBossWSEntityResolver.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,6 +21,9 @@
*/
package org.jboss.ws.common.utils;
+import static org.jboss.ws.common.Loggers.ROOT_LOGGER;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -31,13 +34,10 @@
import java.util.Enumeration;
import java.util.Map;
import java.util.Properties;
-import java.util.ResourceBundle;
import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentHashMap;
-import org.jboss.logging.Logger;
import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
@@ -50,16 +50,12 @@
*/
public class JBossWSEntityResolver extends JBossEntityResolver
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWSEntityResolver.class);
/**
* A synchronized weak hash map that keeps entities' properties for each
classloader.
* Weak keys are used to remove entries when classloaders are garbage collected;
values are filenames -> properties.
*/
private static Map<ClassLoader, Map<String, Properties>> propertiesMap =
Collections.synchronizedMap(new WeakHashMap<ClassLoader, Map<String,
Properties>>());
- // provide logging
- private static final Logger log = Logger.getLogger(JBossWSEntityResolver.class);
-
private ClassLoader additionalClassLoader;
public JBossWSEntityResolver()
@@ -99,7 +95,7 @@
// load entities
props = loadEntitiesMappingFromClasspath(entitiesResource, tccl,
this.additionalClassLoader);
if (props.size() == 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NO_ENTITIES_MAPPING_DEFINED_IN_RESOURCE_FILE", entitiesResource));
+ throw MESSAGES.entityResolutionNoEntityMapppingDefined(entitiesResource);
map.put(entitiesResource, props);
}
@@ -126,7 +122,7 @@
InputStream is = new DelegateClassLoader(additionalClassLoader,
classLoader).getResourceAsStream(entitiesResource);
// get stream
if (is == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"RESOURCE_NOT_FOUND", entitiesResource ));
+ throw MESSAGES.entityResolutionResourceNotFound(entitiesResource);
// load props
Properties props = new Properties();
@@ -136,7 +132,7 @@
}
catch (IOException ioe)
{
- log.error(BundleUtils.getMessage(bundle, "CANNOT_READ_RESOURCE",
entitiesResource), ioe);
+ ROOT_LOGGER.cannotReadResource(entitiesResource, ioe);
}
finally
{
@@ -150,16 +146,16 @@
public InputSource resolveEntity(String publicId, String systemId) throws
SAXException, IOException
{
- if(log.isTraceEnabled()) log.trace("resolveEntity: [pub=" + publicId +
",sysid=" + systemId + "]");
+ if(ROOT_LOGGER.isTraceEnabled()) ROOT_LOGGER.trace(this.getClass().getName(),
"resolveEntity: [pub=" + publicId + ",sysid=" + systemId +
"]", null);
InputSource inputSource = super.resolveEntity(publicId, systemId);
if (inputSource == null)
- inputSource = resolveSystemIDAsURL(systemId, log.isTraceEnabled());
+ inputSource = resolveSystemIDAsURL(systemId, ROOT_LOGGER.isTraceEnabled());
if (inputSource == null)
{
- if (log.isDebugEnabled())
- log.debug("Cannot resolve entity: [pub=" + publicId +
",sysid=" + systemId + "]");
+ if (ROOT_LOGGER.isDebugEnabled())
+ ROOT_LOGGER.debug(this.getClass().getName(), "Cannot resolve entity:
[pub=" + publicId + ",sysid=" + systemId + "]", null);
}
return inputSource;
@@ -193,7 +189,7 @@
return null;
if (trace)
- log.trace("resolveIDAsResourceURL, id=" + id);
+ ROOT_LOGGER.trace(this.getClass().getName(), "resolveIDAsResourceURL,
id=" + id, null);
InputSource inputSource = null;
@@ -201,12 +197,9 @@
try
{
if (trace)
- log.trace("Trying to resolve id as a URL");
+ ROOT_LOGGER.trace(this.getClass().getName(), "Trying to resolve id as a
URL", null);
URL url = new URL(id);
- if (url.getProtocol().equalsIgnoreCase("file") == false)
- log.warn(BundleUtils.getMessage(bundle,
"TRYING_TO_RESOLVE_ID_AS_A_NON-FILE_URL", id));
-
InputStream ins = new ResourceURL(url).openStream();
if (ins != null)
{
@@ -215,21 +208,21 @@
}
else
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_LOAD_ID_AS_URL",
id));
+ ROOT_LOGGER.cannotLoadIDAsURL(id, url.getProtocol());
}
if (trace)
- log.trace("Resolved id as a URL");
+ ROOT_LOGGER.trace(this.getClass().getName(), "Resolved id as a
URL", null);
}
catch (MalformedURLException ignored)
{
if (trace)
- log.trace("id is not a url: " + id, ignored);
+ ROOT_LOGGER.trace(this.getClass().getName(), "id is not a url: " +
id, ignored);
}
catch (IOException e)
{
if (trace)
- log.trace("Failed to obtain URL.InputStream from id: " + id, e);
+ ROOT_LOGGER.trace(this.getClass().getName(), "Failed to obtain
URL.InputStream from id: " + id, e);
}
return inputSource;
}
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/JarUrlConnection.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -29,13 +29,12 @@
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
/** <code>URLConnection</code> capable of handling multiply-nested jars.
*
@@ -43,7 +42,6 @@
*/
public class JarUrlConnection extends JarURLConnection
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JarUrlConnection.class);
// ----------------------------------------------------------------------
// Instance members
// ----------------------------------------------------------------------
@@ -93,10 +91,10 @@
}
else
{
- throw new MalformedURLException(BundleUtils.getMessage(bundle,
"ERROR_IN_URL", url.toExternalForm()));
+ throw Messages.MESSAGES.jarUrlConnectionBuildError(url.toExternalForm());
}
- List segments = new ArrayList();
+ List<String> segments = new ArrayList<String>();
StringTokenizer tokens = new StringTokenizer(extraText, "!");
@@ -105,7 +103,7 @@
segments.add(tokens.nextToken());
}
- this.segments = (String[])segments.toArray(new String[segments.size()]);
+ this.segments = segments.toArray(new String[segments.size()]);
this.baseResource = new URL(baseResourceText);
}
@@ -218,7 +216,7 @@
}
}
- throw new IOException(BundleUtils.getMessage(bundle,
"UNABLE_TO_LOCATE_SEGMENT", segment));
+ throw Messages.MESSAGES.jarUrlConnectionUnableToLocateSegment(segment,
getURL().toExternalForm());
}
/** @see java.net.URLConnection
Deleted: common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/Message.properties 2012-09-21
15:48:32 UTC (rev 16752)
@@ -1,13 +0,0 @@
-NO_ENTITIES_MAPPING_DEFINED_IN_RESOURCE_FILE=No entities mapping defined in resource
file: {0}
-RESOURCE_NOT_FOUND=Resource {0} not found
-CANNOT_READ_RESOURCE=Cannot read resource: {0}
-TRYING_TO_RESOLVE_ID_AS_A_NON-FILE_URL=Trying to resolve id as a non-file URL: {0}
-CANNOT_LOAD_ID_AS_URL=Cannot load id as URL: {0}
-INVALID_CHARACTER_REFERENCE=Invalid character reference
-INVALID_ENTITY_REFERENCE=Invalid entity reference
-INVALID_ENTITY=Invalid entity: {0}
-CANNOT_FIND_SCHEMA_IMPORT_IN_DEPLOYMENT=Cannot find schema import in deployment: {0}
-CANNOT_DELETE_PUBLISHED_WSDL_DOCUMENT=Cannot delete published wsdl document: {0}
-ERROR_IN_URL=No ! in url: {0}
-UNABLE_TO_LOCATE_SEGMENT=unable to locate segment: {0}
-A_UUID_MUST_BE_16_BYTES=A UUID must be 16 bytes!
Modified: common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java 2012-09-21
12:47:11 UTC (rev 16751)
+++ common/trunk/src/main/java/org/jboss/ws/common/utils/UUIDGenerator.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -22,9 +22,9 @@
package org.jboss.ws.common.utils;
import java.security.SecureRandom;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Messages;
+
/**
* Generates the string form of IETF variant UUIDs.
*
@@ -37,7 +37,6 @@
*/
public class UUIDGenerator
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UUIDGenerator.class);
private static SecureRandom rand;
private static String bytesToHex(byte[] buffer, int offset, int length)
@@ -111,7 +110,7 @@
public static String convertToString(byte[] uuid)
{
if (uuid.length != 16)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"A_UUID_MUST_BE_16_BYTES"));
+ throw Messages.MESSAGES.uuidMustBeOf16Bytes();
String string = bytesToHex(uuid, 0, 4) + "-"
+ bytesToHex(uuid, 4, 2) + "-"
Modified:
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java 2012-09-21
12:47:11 UTC (rev 16751)
+++
common/trunk/src/main/java/org/jboss/ws/common/utils/XMLPredefinedEntityReferenceResolver.java 2012-09-21
15:48:32 UTC (rev 16752)
@@ -21,11 +21,10 @@
*/
package org.jboss.ws.common.utils;
+import static org.jboss.ws.common.Messages.MESSAGES;
+
import java.util.HashMap;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-
/**
* Utility class for resolving predefined XML entity and character references.
*
@@ -33,7 +32,6 @@
*/
public class XMLPredefinedEntityReferenceResolver
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(XMLPredefinedEntityReferenceResolver.class);
private static HashMap<String, Character> entities = new HashMap<String,
Character>(8);
static
@@ -56,7 +54,7 @@
int end = source.indexOf(';', pos);
if (end == -1)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_CHARACTER_REFERENCE"));
+ throw MESSAGES.entityResolutionInvalidCharacterReference(source);
int c = Integer.parseInt(source.substring(pos, end), radix);
builder.append((char) c);
@@ -68,12 +66,12 @@
{
int end = source.indexOf(';', ++pos);
if (end == -1)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY_REFERENCE"));
+ throw MESSAGES.entityResolutionInvalidEntityReference(source);
String entity = source.substring(pos, end);
Character c = entities.get(entity);
if (c == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY", entity));
+ throw MESSAGES.entityResolutionInvalidEntity(entity);
builder.append(c.charValue());
@@ -104,7 +102,7 @@
int peek = pos + 1;
if (peek == end)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_ENTITY_REFERENCE"));
+ throw MESSAGES.entityResolutionInvalidEntityReference(normalized);
if (normalized.charAt(peek) == '#')
pos = resolveCharRef(normalized, pos, builder);