Author: alessio.soldano(a)jboss.com
Date: 2012-09-19 13:43:14 -0400 (Wed, 19 Sep 2012)
New Revision: 16740
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/Loggers.java
spi/trunk/src/main/java/org/jboss/wsf/spi/Messages.java
Removed:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties
spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties
Modified:
spi/trunk/pom.xml
spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java
spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java
Log:
[JBWS-3509] Converting JBossWS-SPI to latest JBoss Logging...
Modified: spi/trunk/pom.xml
===================================================================
--- spi/trunk/pom.xml 2012-09-19 07:52:56 UTC (rev 16739)
+++ spi/trunk/pom.xml 2012-09-19 17:43:14 UTC (rev 16740)
@@ -27,7 +27,8 @@
<properties>
<jbossws.api.version>1.0.1-SNAPSHOT</jbossws.api.version>
<jms.api.version>1.0.0.Final</jms.api.version>
- <jboss-logging-spi.version>2.0.5.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>
<servlet.api.version>1.0.0.Final</servlet.api.version>
<junit.version>3.8.2</junit.version>
</properties>
@@ -56,10 +57,16 @@
</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>
<!-- test dependencies -->
<dependency>
@@ -82,6 +89,29 @@
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <!-- Optional if you wan to generate skeleton translation properties files
-->
+ <compilerArgument>
+
-AgeneratedTranslationFilesPath=${project.basedir}/target/generated-translation-files
+ </compilerArgument>
+ </configuration>
+ </plugin>
</plugins>
</build>
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/Loggers.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/Loggers.java (rev
0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/Loggers.java 2012-09-19 17:43:14 UTC (rev
16740)
@@ -0,0 +1,74 @@
+/*
+ * 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.wsf.spi;
+
+import static org.jboss.logging.Logger.Level.WARN;
+import static org.jboss.logging.Logger.Level.ERROR;
+
+import java.net.URL;
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.logging.BasicLogger;
+import org.jboss.logging.Cause;
+import org.jboss.logging.LogMessage;
+import org.jboss.logging.Logger.Level;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageLogger;
+
+/**
+ * JBossWS API 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.spi");
+ Loggers METADATA_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class,
"org.jboss.ws.spi.metadata");
+
+ @LogMessage(level = WARN)
+ @Message(id = 21003, value = "%s element not supported")
+ void elementNotSupported(String feature);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 21005, value = "Cannot get port component name {%s}, we have:
%s")
+ void cannotGetPortComponentName(String name, Collection<String> pcNames);
+
+ @LogMessage(level = WARN)
+ @Message(id = 21006, value = "Element in webservices.xml not namespace
qualified: %s")
+ void webservicesXmlElementNotNamespaceQualified(QName name);
+
+ @LogMessage(level = WARN)
+ @Message(id = 21010, value = "Multiple matching port-component-ref: sei={%s}
port={%s}")
+ void multipleMatchingPortComponentRef(String seiName, QName portName);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 21017, value = "Cannot get children for resource %s")
+ void cannotGetChildrenForResource(@Cause Throwable cause, URL url);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 21018, value = "Cannot get name for resource %s")
+ void cannotGetNameForResource(@Cause Throwable cause, URL url);
+
+}
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/Messages.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/Messages.java (rev
0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/Messages.java 2012-09-19 17:43:14 UTC (rev
16740)
@@ -0,0 +1,83 @@
+/*
+ * 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.wsf.spi;
+
+import java.io.IOException;
+import java.net.URL;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+
+/**
+ * JBossWS API 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 = 21000, value = "Unexpected end tag parsing %s: %s")
+ IllegalStateException unexpectedEndTag(String descriptor, String tag);
+
+ @Message(id = 21001, value = "Unexpected element parsing %s: %s")
+ IllegalStateException unexpectedElement(String descriptor, String elem);
+
+ @Message(id = 21002, value = "Unexpectedly reached end of XML document:
%s")
+ IllegalStateException reachedEndOfXMLDocUnexpectedly(String descriptor);
+
+ @Message(id = 21004, value = "Failed to unmarshall %s")
+ WebServiceException failedToUnmarshall(@Cause Throwable cause, URL url);
+
+ @Message(id = 21007, value = "Unsupported port-component addressing response
type '%s'. Only ALL, ANONYMOUS or NON_ANONYMOUS strings are allowed.")
+ IllegalArgumentException unsupportedAddressingResponseType(String responseType);
+
+ @Message(id = 21008, value = "Could not get a property name parsing: %s")
+ IllegalStateException couldNotGetPropertyName(String descriptor);
+
+ @Message(id = 21009, value = "Cannot find file %s")
+ WebServiceException cannotFindFile(@Cause Throwable cause, String file);
+
+ @Message(id = 21011, value = "Cannot match port-component-ref against null
service endpoint interface and port QName")
+ IllegalArgumentException cannotMatchAgainstNull();
+
+ @Message(id = 21012, value = "Invalid handler type %s")
+ IllegalArgumentException invalidHandlerType(String type);
+
+ @Message(id = 21013, value = "Could not get a feature name parsing: %s")
+ IllegalStateException couldNotGetFeatureName(String descriptor);
+
+ @Message(id = 21014, value = "Reading external entities is disabled")
+ XMLStreamException readingExternalEntitiesDisabled();
+
+ @Message(id = 21015, value = "Could not parse stream")
+ RuntimeException couldNotParseStream(@Cause Throwable cause);
+
+ @Message(id = 21016, value = "Cannot get URL for %s")
+ IOException cannotGetURLFor(String path);
+
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java 2012-09-19
07:52:56 UTC (rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/invocation/ResourceInjector.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -21,8 +21,6 @@
*/
package org.jboss.wsf.spi.invocation;
-import org.jboss.wsf.spi.SPIView;
-
import javax.xml.ws.WebServiceContext;
/**
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/AbstractHandlerChainsMetaDataParser.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -21,6 +21,7 @@
*/
package org.jboss.wsf.spi.metadata;
+import static org.jboss.wsf.spi.Messages.MESSAGES;
import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_PORT_PATTERN;
import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_PROTOCOL_BINDING;
import static org.jboss.wsf.spi.metadata.ParserConstants.CHAIN_SERVICE_PATTERN;
@@ -38,13 +39,10 @@
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
-import java.util.ResourceBundle;
-
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -58,7 +56,6 @@
*/
public abstract class AbstractHandlerChainsMetaDataParser
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractHandlerChainsMetaDataParser.class);
protected UnifiedHandlerChainsMetaData parseHandlerChains(XMLStreamReader reader,
String nsUri) throws XMLStreamException
{
return this.parseHandlerChains(reader, nsUri, nsUri, HANDLER_CHAINS);
@@ -79,7 +76,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -88,12 +85,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private UnifiedHandlerChainMetaData parseHandlerChain(XMLStreamReader reader, String
nsUri) throws XMLStreamException
@@ -110,7 +107,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -131,12 +128,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
protected UnifiedHandlerMetaData parseHandler(XMLStreamReader reader, String nsUri)
throws XMLStreamException
@@ -158,7 +155,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -181,12 +178,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private UnifiedInitParamMetaData parseInitParam(XMLStreamReader reader, String nsUri)
throws XMLStreamException
@@ -203,7 +200,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -217,11 +214,13 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+
+ protected abstract String getDescriptorForLogs();
}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties 2012-09-19
07:52:56 UTC (rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/Message.properties 2012-09-19
17:43:14 UTC (rev 16740)
@@ -1,3 +0,0 @@
-UNEXPECTED_END_TAG=Unexpected end tag: {0}
-UNEXPECTED_ELEMENT=Unexpected element: {0}
-REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2012-09-19
07:52:56 UTC (rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/ParserConstants.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -113,8 +113,10 @@
public static final String REQUIRED = "required";
- public static final String JBOSSWS_JAXWS_CONFIG_NS =
"urn:jboss:jbossws-jaxws-config:4.0";
+ public static final String JBOSSWS_JAXWS_CONFIG_NS =
"urn:jboss:jbossws-jaxws-config";
+ public static final String JBOSSWS_JAXWS_CONFIG_NS_4_0 = JBOSSWS_JAXWS_CONFIG_NS +
":4.0";
+
public static final String JAXWS_CONFIG = "jaxws-config";
public static final String ENDPOINT_CONFIG = "endpoint-config";
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/AbstractCommonConfig.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -24,9 +24,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Messages;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -38,7 +37,6 @@
*/
public abstract class AbstractCommonConfig implements CommonConfig
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractCommonConfig.class);
private String configName;
private Map<String, Feature> features = new HashMap<String, Feature>(2);
private Map<String, String> properties = new HashMap<String, String>(4);
@@ -72,7 +70,7 @@
handlerChains = getPreHandlerChains();
else if (type == HandlerType.POST)
handlerChains = getPostHandlerChains();
- else throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"INVALID_HANDLER_TYPE", type));
+ else throw Messages.MESSAGES.invalidHandlerType(type != null ? type.toString() :
null);
return handlerChains;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigMetaDataParser.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -31,7 +31,7 @@
import static org.jboss.wsf.spi.metadata.ParserConstants.FEATURE_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.JAVAEE_NS;
import static org.jboss.wsf.spi.metadata.ParserConstants.JAXWS_CONFIG;
-import static org.jboss.wsf.spi.metadata.ParserConstants.JBOSSWS_JAXWS_CONFIG_NS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.JBOSSWS_JAXWS_CONFIG_NS_4_0;
import static org.jboss.wsf.spi.metadata.ParserConstants.POST_HANDLER_CHAINS;
import static org.jboss.wsf.spi.metadata.ParserConstants.PRE_HANDLER_CHAINS;
import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY;
@@ -39,18 +39,18 @@
import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY_VALUE;
import static org.jboss.wsf.spi.util.StAXUtils.elementAsString;
import static org.jboss.wsf.spi.util.StAXUtils.match;
+import static org.jboss.wsf.spi.Messages.MESSAGES;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-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 org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Loggers;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -63,7 +63,6 @@
*/
public class ConfigMetaDataParser extends AbstractHandlerChainsMetaDataParser
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(ConfigMetaDataParser.class);
private ConfigMetaDataParser()
{
super();
@@ -121,14 +120,14 @@
}
case START_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, JAXWS_CONFIG))
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, JAXWS_CONFIG))
{
ConfigMetaDataParser parser = new ConfigMetaDataParser();
configRoot = parser.parseConfigRoot(reader);
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw
MESSAGES.unexpectedElement(org.jboss.wsf.spi.metadata.ParserConstants.JBOSSWS_JAXWS_CONFIG_NS,
reader.getLocalName());
}
}
}
@@ -143,34 +142,34 @@
switch (reader.nextTag())
{
case XMLStreamConstants.END_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, JAXWS_CONFIG))
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, JAXWS_CONFIG))
{
return configRoot;
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, ENDPOINT_CONFIG)) {
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, ENDPOINT_CONFIG)) {
EndpointConfig epConfig = new EndpointConfig();
parseConfig(reader, epConfig, ENDPOINT_CONFIG);
configRoot.addEndpointConfig(epConfig);
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, CLIENT_CONFIG)) {
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, CLIENT_CONFIG)) {
ClientConfig clConfig = new ClientConfig();
parseConfig(reader, clConfig, CLIENT_CONFIG);
configRoot.addClientConfig(clConfig);
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseConfig(XMLStreamReader reader, CommonConfig config, String
configElement) throws XMLStreamException
@@ -180,41 +179,41 @@
switch (reader.nextTag())
{
case XMLStreamConstants.END_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, configElement))
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, configElement))
{
return;
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, CONFIG_NAME)) {
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, CONFIG_NAME)) {
config.setConfigName(elementAsString(reader));
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, PRE_HANDLER_CHAINS)) {
- UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader,
JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS, PRE_HANDLER_CHAINS);
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PRE_HANDLER_CHAINS))
{
+ UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader,
JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS_4_0, PRE_HANDLER_CHAINS);
config.setPreHandlerChains(uhcmd.getHandlerChains());
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, POST_HANDLER_CHAINS)) {
- UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader,
JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS, POST_HANDLER_CHAINS);
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, POST_HANDLER_CHAINS))
{
+ UnifiedHandlerChainsMetaData uhcmd = parseHandlerChains(reader,
JAVAEE_NS, JBOSSWS_JAXWS_CONFIG_NS_4_0, POST_HANDLER_CHAINS);
config.setPostHandlerChains(uhcmd.getHandlerChains());
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, FEATURE)) {
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE)) {
config.setFeature(parseFeature(reader), true);
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, PROPERTY)) {
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PROPERTY)) {
parseProperty(reader, config);
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseProperty(XMLStreamReader reader, CommonConfig config) throws
XMLStreamException
@@ -226,35 +225,35 @@
switch (reader.nextTag())
{
case XMLStreamConstants.END_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, PROPERTY))
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PROPERTY))
{
if (name == null)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_PROPERTY_NAME"));
+ throw MESSAGES.couldNotGetPropertyName(getDescriptorForLogs());
}
config.setProperty(name, value);
return;
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, PROPERTY_NAME)) {
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PROPERTY_NAME)) {
name = elementAsString(reader);
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, PROPERTY_VALUE)) {
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, PROPERTY_VALUE)) {
value = elementAsString(reader);
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private Feature parseFeature(XMLStreamReader reader) throws XMLStreamException
@@ -265,29 +264,29 @@
switch (reader.nextTag())
{
case XMLStreamConstants.END_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, FEATURE))
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE))
{
if (feature == null)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_READ_FEATURE_NAME"));
+ throw MESSAGES.couldNotGetFeatureName(getDescriptorForLogs());
}
return feature;
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
- if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, FEATURE_NAME)) {
+ if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE_NAME)) {
feature = new Feature(elementAsString(reader));
}
- else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS, FEATURE_DATA)) {
+ else if (match(reader, JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE_DATA)) {
//not implemented yet
- Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle,
"FEATURE_DATA_NOT_SUPPORTED_YET"));
+ Loggers.METADATA_LOGGER.elementNotSupported(new
QName(JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE_DATA).toString());
while (reader.hasNext()) {
reader.next();
- if (reader.isEndElement() && match(reader,
JBOSSWS_JAXWS_CONFIG_NS, FEATURE_DATA))
+ if (reader.isEndElement() && match(reader,
JBOSSWS_JAXWS_CONFIG_NS_4_0, FEATURE_DATA))
{
break;
}
@@ -295,11 +294,17 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+
+ @Override
+ protected String getDescriptorForLogs()
+ {
+ return org.jboss.wsf.spi.metadata.ParserConstants.JBOSSWS_JAXWS_CONFIG_NS;
+ }
}
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/Message.properties 2012-09-19
17:43:14 UTC (rev 16740)
@@ -1,7 +0,0 @@
-INVALID_HANDLER_TYPE=Invalid handler type: {0}
-UNEXPECTED_ELEMENT=Unexpected element: {0}
-UNEXPECTED_END_TAG=Unexpected end tag: {0}
-REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
-COULD_NOT_GET_PROPERTY_NAME=Could not get property name!
-COULD_NOT_READ_FEATURE_NAME=Could not read feature name!
-FEATURE_DATA_NOT_SUPPORTED_YET=Feature data not supported yet!
Deleted:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/Message.properties 2012-09-19
17:43:14 UTC (rev 16740)
@@ -1,7 +0,0 @@
-ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED=Only ALL, ANONYMOUS or NON_ANONYMOUS strings
are allowed
-CANNOT_FIND_JAXRCP-MAPPING-FILE=Cannot find jaxrcp-mapping-file: {0}
-MULTIPLE_MATCHING_PORT_COMPONENT_REF=Multiple matching port component ref: sei={0}
port={1}
-CANNOT_FIND_WSDL-OVERRIDE=Cannot find wsdl-override: {0}
-CANNOT_FIND_WSDL-FILE=Cannot find wsdl-file: {0}
-UNEXPECTED_ELEMENT=Unexpected element: {0}
-CANNOT_MATCH=Cannot match against seiName=null && portName=null.
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerChainsMetaDataParser.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -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.
*
@@ -30,12 +30,11 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.ResourceBundle;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Messages;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -47,7 +46,6 @@
*/
public class UnifiedHandlerChainsMetaDataParser extends
AbstractHandlerChainsMetaDataParser
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedHandlerChainsMetaDataParser.class);
private UnifiedHandlerChainsMetaDataParser()
{
super();
@@ -95,10 +93,16 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw Messages.MESSAGES.unexpectedElement("handlers",
reader.getLocalName());
}
}
}
return handlerChains;
}
+
+ @Override
+ protected String getDescriptorForLogs()
+ {
+ return "handlers";
+ }
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedHandlerMetaData.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -21,7 +21,6 @@
*/
package org.jboss.wsf.spi.metadata.j2ee.serviceref;
-import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedPortComponentRefMetaData.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -23,20 +23,19 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Messages;
import org.jboss.wsf.spi.serviceref.ServiceRefElement;
-/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml,
and application-client.xml.
+/** The metadata data from service-ref/port-component-ref element in web.xml,
ejb-jar.xml, and application-client.xml.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
*/
public class UnifiedPortComponentRefMetaData extends ServiceRefElement
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedPortComponentRefMetaData.class);
private static final long serialVersionUID = 8622309745808960649L;
// The parent service-ref
@@ -108,7 +107,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED"));
+ throw Messages.MESSAGES.unsupportedAddressingResponseType(responsesTypes);
this.addressingResponses = responsesTypes;
}
@@ -246,7 +245,7 @@
public boolean matches(String seiName, QName portName)
{
if (seiName == null && portName == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_MATCH"));
+ throw Messages.MESSAGES.cannotMatchAgainstNull();
boolean match = false;
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/j2ee/serviceref/UnifiedServiceRefMetaData.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2010, 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,8 @@
*/
package org.jboss.wsf.spi.metadata.j2ee.serviceref;
+import static org.jboss.wsf.spi.Messages.MESSAGES;
+
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -35,13 +37,10 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import javax.xml.ws.WebServiceException;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Loggers;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.deployment.WritableUnifiedVirtualFile;
import org.jboss.wsf.spi.serviceref.ServiceRefElement;
@@ -58,12 +57,8 @@
*/
public final class UnifiedServiceRefMetaData extends ServiceRefElement
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedServiceRefMetaData.class);
private static final long serialVersionUID = -926464174132493955L;
- // provide logging
- private static Logger log = Logger.getLogger(UnifiedServiceRefMetaData.class);
-
private transient UnifiedVirtualFile vfsRoot;
// Standard properties
@@ -150,7 +145,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL,ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED"));
+ throw MESSAGES.unsupportedAddressingResponseType(responsesTypes);
this.addressingResponses = responsesTypes;
}
@@ -251,7 +246,7 @@
}
catch (Exception e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_JAXRCP-MAPPING-FILE", mappingFile), e);
+ throw MESSAGES.cannotFindFile(e, mappingFile);
}
}
return mappingURL;
@@ -270,7 +265,7 @@
if (ref.matches(seiName, portName))
{
if (matchingRef != null)
- log.warn(BundleUtils.getMessage(bundle,
"MULTIPLE_MATCHING_PORT_COMPONENT_REF", new Object[]{ seiName , portName }));
+ Loggers.METADATA_LOGGER.multipleMatchingPortComponentRef(seiName,
portName);
matchingRef = ref;
}
@@ -360,7 +355,7 @@
}
catch (Exception e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_WSDL-OVERRIDE", wsdlOverride), e);
+ throw MESSAGES.cannotFindFile(e, wsdlOverride);
}
}
}
@@ -379,7 +374,7 @@
}
catch (Exception e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_WSDL-FILE", wsdlFile), e);
+ throw MESSAGES.cannotFindFile(e, wsdlFile);
}
}
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/JBossWebservicesFactory.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -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.
*
@@ -24,20 +24,21 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+import static org.jboss.wsf.spi.Messages.MESSAGES;
import static org.jboss.wsf.spi.metadata.ParserConstants.AUTH_METHOD;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONFIG_FILE;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONFIG_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.CONTEXT_ROOT;
import static org.jboss.wsf.spi.metadata.ParserConstants.EJB_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.JBOSSEE_NS;
+import static org.jboss.wsf.spi.metadata.ParserConstants.NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT;
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT_NAME;
import static org.jboss.wsf.spi.metadata.ParserConstants.PORT_COMPONENT_URI;
import static org.jboss.wsf.spi.metadata.ParserConstants.PROPERTY;
-import static org.jboss.wsf.spi.metadata.ParserConstants.NAME;
-import static org.jboss.wsf.spi.metadata.ParserConstants.VALUE;
import static org.jboss.wsf.spi.metadata.ParserConstants.SECURE_WSDL_ACCESS;
import static org.jboss.wsf.spi.metadata.ParserConstants.TRANSPORT_GUARANTEE;
+import static org.jboss.wsf.spi.metadata.ParserConstants.VALUE;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICES;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION;
import static org.jboss.wsf.spi.metadata.ParserConstants.WEBSERVICE_DESCRIPTION_NAME;
@@ -49,14 +50,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ResourceBundle;
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.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -66,8 +65,6 @@
*/
public class JBossWebservicesFactory {
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWebservicesFactory.class);
-
// The URL to the jboss-webservices.xml descriptor
private URL descriptorURL;
@@ -120,7 +117,7 @@
XMLStreamReader xmlr = StAXUtils.createXMLStreamReader(is);
return parse(xmlr, wsddUrl);
} catch (Exception e) {
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_UNMARSHALL", wsddUrl), e);
+ throw MESSAGES.failedToUnmarshall(e, wsddUrl);
} finally {
try {
if (is != null)
@@ -169,7 +166,7 @@
JBossWebservicesFactory factory = new
JBossWebservicesFactory(descriptorURL);
metadata = factory.parseWebservices(reader, nsUri, descriptorURL);
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(descriptorURL != null ?
descriptorURL.toString() : "jboss-webservices.xml", reader.getLocalName());
}
}
}
@@ -185,8 +182,7 @@
if (match(reader, nsUri, WEBSERVICES)) {
return metadata;
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
@@ -203,13 +199,12 @@
} else if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
metadata.addWebserviceDescription(parseWebserviceDescription(reader, nsUri));
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private JBossPortComponentMetaData parsePortComponent(XMLStreamReader reader, String
nsUri) throws XMLStreamException {
@@ -220,8 +215,7 @@
if (match(reader, nsUri, PORT_COMPONENT)) {
return pc;
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
@@ -238,13 +232,12 @@
} else if (match(reader, nsUri, SECURE_WSDL_ACCESS)) {
pc.setSecureWSDLAccess(elementAsBoolean(reader));
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private JBossWebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader
reader, String nsUri)
@@ -256,8 +249,7 @@
if (match(reader, nsUri, WEBSERVICE_DESCRIPTION)) {
return description;
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT: {
@@ -266,13 +258,12 @@
} else if (match(reader, nsUri, WSDL_PUBLISH_LOCATION)) {
description.setWsdlPublishLocation(elementAsString(reader));
} else {
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT",
- reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseProperty(XMLStreamReader reader, String nsUri,
JBossWebservicesMetaData metadata) throws XMLStreamException
@@ -288,14 +279,14 @@
{
if (name == null)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"COULD_NOT_GET_PROPERTY_NAME"));
+ throw MESSAGES.couldNotGetPropertyName(getDescriptorForLogs());
}
metadata.setProperty(name, value);
return;
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -307,12 +298,16 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+
+ private String getDescriptorForLogs() {
+ return descriptorURL != null ? descriptorURL.toString() :
"jboss-webservices.xml";
+ }
}
Deleted:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/Message.properties 2012-09-19
17:43:14 UTC (rev 16740)
@@ -1,7 +0,0 @@
-CANNOT_GET_PORT_COMPONENT_NAME=Cannot get port component name {0}, we have: {1}
-FAILED_TO_UNMARSHALL=Failed to unmarshall:{0}
-UNEXPECTED_ELEMENT=Unexpected element: {0}
-UNEXPECTED_END_TAG=Unexpected end tag: {0}
-REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY=Reached end of xml document unexpectedly
-ELEMENT_IN_WEBSERVICES.XML_NOT_NAMESPACE_QUALIFIED=<wsdl-port> element in
webservices.xml not namespace qualified: {0}
-ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED=Only ALL, ANONYMOUS or NON_ANONYMOUS strings
are allowed
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/PortComponentMetaData.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -23,12 +23,11 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Loggers;
+import org.jboss.wsf.spi.Messages;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -45,15 +44,11 @@
*/
public class PortComponentMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(PortComponentMetaData.class);
/**
* The index of the webservice-description in webservices.xml
*/
public static final String PARAMETER_WEBSERVICE_ID = "webserviceID";
- // provide logging
- private static final Logger log = Logger.getLogger(PortComponentMetaData.class);
-
// The parent <webservice-description> element
private WebserviceDescriptionMetaData webserviceDescription;
@@ -123,7 +118,7 @@
public void setWsdlPort(QName wsdlPort)
{
if (wsdlPort.getNamespaceURI().length() == 0)
- log.warn(BundleUtils.getMessage(bundle,
"ELEMENT_IN_WEBSERVICES.XML_NOT_NAMESPACE_QUALIFIED", wsdlPort));
+ Loggers.METADATA_LOGGER.webservicesXmlElementNotNamespaceQualified(wsdlPort);
this.wsdlPort = wsdlPort;
}
@@ -199,7 +194,7 @@
public void setAddressingResponses(final String responsesTypes)
{
if (!"ANONYMOUS".equals(responsesTypes) &&
!"NON_ANONYMOUS".equals(responsesTypes) &&
!"ALL".equals(responsesTypes))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ONLY_ALL_ANONYMOUS_OR_NON_ANONYMOUS_ALLOWED"));
+ throw Messages.MESSAGES.unsupportedAddressingResponseType(responsesTypes);
this.addressingResponses = responsesTypes;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebserviceDescriptionMetaData.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -22,15 +22,13 @@
package org.jboss.wsf.spi.metadata.webservices;
import java.util.ArrayList;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
-import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.Loggers;
/**
* XML Binding element for <code>webservices/webservice-description</code>
@@ -40,10 +38,6 @@
*/
public class WebserviceDescriptionMetaData
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WebserviceDescriptionMetaData.class);
- // provide logging
- private static final Logger log =
Logger.getLogger(WebserviceDescriptionMetaData.class);
-
// The parent <webservices> element
private WebservicesMetaData webservices;
@@ -116,7 +110,7 @@
pcNames.add(wsdlPortName);
}
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_PORT_COMPONENT_NAME", new Object[]{ name , pcNames}));
+ Loggers.METADATA_LOGGER.cannotGetPortComponentName(name, pcNames);
return null;
}
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java
===================================================================
---
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2012-09-19
07:52:56 UTC (rev 16739)
+++
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/webservices/WebservicesFactory.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -23,6 +23,7 @@
import static javax.xml.stream.XMLStreamConstants.END_ELEMENT;
import static javax.xml.stream.XMLStreamConstants.START_ELEMENT;
+import static org.jboss.wsf.spi.Messages.MESSAGES;
import static org.jboss.wsf.spi.metadata.ParserConstants.ADDRESSING;
import static org.jboss.wsf.spi.metadata.ParserConstants.ADDRESSING_RESPONSES;
import static org.jboss.wsf.spi.metadata.ParserConstants.EJB_LINK;
@@ -57,14 +58,12 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ResourceBundle;
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.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.AbstractHandlerChainsMetaDataParser;
import org.jboss.wsf.spi.util.StAXUtils;
@@ -73,11 +72,11 @@
* A JBossXB factory for {@link WebservicesMetaData}
*
* @author Thomas.Diesler(a)jboss.org
+ * @author alessio.soldano(a)jboss.com
* @since 16-Apr-2004
*/
public class WebservicesFactory extends AbstractHandlerChainsMetaDataParser
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WebservicesFactory.class);
// The URL to the webservices.xml descriptor
private URL descriptorURL;
@@ -140,7 +139,7 @@
}
catch (Exception e)
{
- throw new WebServiceException(BundleUtils.getMessage(bundle,
"FAILED_TO_UNMARSHALL", wsddUrl), e);
+ throw MESSAGES.failedToUnmarshall(e, wsddUrl);
}
finally
{
@@ -204,7 +203,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(descriptorURL != null ?
descriptorURL.toString() : "webservices.xml", reader.getLocalName());
}
}
}
@@ -225,7 +224,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -243,12 +242,12 @@
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
WebserviceDescriptionMetaData parseWebserviceDescription(XMLStreamReader reader,
String nsUri, WebservicesMetaData wsMetaData) throws XMLStreamException
@@ -265,7 +264,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -283,12 +282,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private PortComponentMetaData parsePortComponent(XMLStreamReader reader, String nsUri,
WebserviceDescriptionMetaData desc) throws XMLStreamException
@@ -305,7 +304,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -356,12 +355,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseAddressing(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -377,7 +376,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -392,12 +391,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseRespectBinding(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -413,7 +412,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -422,12 +421,12 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
private void parseServiceImplBean(XMLStreamReader reader, String nsUri,
PortComponentMetaData pc) throws XMLStreamException
@@ -443,7 +442,7 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_END_TAG", reader.getLocalName()));
+ throw MESSAGES.unexpectedEndTag(getDescriptorForLogs(),
reader.getLocalName());
}
}
case XMLStreamConstants.START_ELEMENT : {
@@ -455,14 +454,19 @@
}
else
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"UNEXPECTED_ELEMENT", reader.getLocalName()));
+ throw MESSAGES.unexpectedElement(getDescriptorForLogs(),
reader.getLocalName());
}
}
}
}
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"REACHED_END_OF_XML_DOCUMENT_UNEXPECTEDLY"));
+ throw MESSAGES.reachedEndOfXMLDocUnexpectedly(getDescriptorForLogs());
}
+ @Override
+ protected String getDescriptorForLogs() {
+ return descriptorURL != null ? descriptorURL.toString() :
"webservices.xml";
+ }
+
public URL getDescriptorURL()
{
return descriptorURL;
Deleted: spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties 2012-09-19 07:52:56
UTC (rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/Message.properties 2012-09-19 17:43:14
UTC (rev 16740)
@@ -1,5 +0,0 @@
-CANNOT_GET_URL_FOR=Cannot get URL for: {0}
-CANNOT_GET_CHILDREN_FOR_RESOURCE=Cannot get children for resource: {0}
-CANNOT_GET_NAME_FOR_RESOURCE=Cannot get name for resource: {0}
-READING_EXTERNAL_ENTITIES_IS_DISABLED=Reading external entities is disabled
-COULDN'T_PARSE_STREAM=Couldn't parse stream
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java 2012-09-19 07:52:56 UTC
(rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/StAXUtils.java 2012-09-19 17:43:14 UTC
(rev 16740)
@@ -22,7 +22,6 @@
package org.jboss.wsf.spi.util;
import java.io.InputStream;
-import java.util.ResourceBundle;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -32,7 +31,7 @@
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.Messages;
/**
* StAX utils
@@ -42,7 +41,6 @@
*/
public class StAXUtils
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(StAXUtils.class);
private static final BlockingQueue<XMLInputFactory> INPUT_FACTORY_POOL;
static
@@ -81,7 +79,7 @@
public Object resolveEntity(String publicID, String systemID, String baseURI,
String namespace)
throws XMLStreamException
{
- throw new XMLStreamException(BundleUtils.getMessage(bundle,
"READING_EXTERNAL_ENTITIES_IS_DISABLED"));
+ throw Messages.MESSAGES.readingExternalEntitiesDisabled();
}
});
return factory;
@@ -111,7 +109,7 @@
}
catch (XMLStreamException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"COULDN'T_PARSE_STREAM"), e);
+ throw Messages.MESSAGES.couldNotParseStream(e);
}
finally
{
@@ -188,7 +186,7 @@
}
catch (XMLStreamException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"COULDN'T_PARSE_STREAM"), e);
+ throw Messages.MESSAGES.couldNotParseStream(e);
}
}
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java 2012-09-19
07:52:56 UTC (rev 16739)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/util/URLLoaderAdapter.java 2012-09-19
17:43:14 UTC (rev 16740)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.spi.util;
+import static org.jboss.wsf.spi.Loggers.ROOT_LOGGER;
+
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -31,12 +33,10 @@
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.Messages;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
/**
@@ -50,13 +50,11 @@
*/
public class URLLoaderAdapter implements UnifiedVirtualFile
{
- 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)
@@ -116,7 +114,7 @@
}
if (resourceURL == null)
- throw new IOException(BundleUtils.getMessage(bundle,
"CANNOT_GET_URL_FOR", resourcePath));
+ throw Messages.MESSAGES.cannotGetURLFor(resourcePath);
return new URLLoaderAdapter(rootURL, loader, resourceURL);
}
@@ -203,8 +201,7 @@
}
catch (Exception e)
{
- e.printStackTrace();
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url));
+ ROOT_LOGGER.cannotGetChildrenForResource(e, url);
}
}
else //std file/dir
@@ -226,7 +223,7 @@
}
catch (Exception e)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_CHILDREN_FOR_RESOURCE", url), e);
+ ROOT_LOGGER.cannotGetChildrenForResource(e, url);
}
}
return list;
@@ -245,7 +242,7 @@
}
catch (Exception e)
{
- log.error(BundleUtils.getMessage(bundle,
"CANNOT_GET_NAME_FOR_RESOURCE", toURL()), e);
+ ROOT_LOGGER.cannotGetNameForResource(e, toURL());
}
return name;
}