JBossWS SVN: r16762 - in stack/native/trunk: modules/core and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-25 13:02:14 -0400 (Tue, 25 Sep 2012)
New Revision: 16762
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
Modified:
stack/native/trunk/modules/core/pom.xml
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
stack/native/trunk/pom.xml
Log:
[JBWS-3509] Moving to latest jboss-logging of some of the most used logs...
Modified: stack/native/trunk/modules/core/pom.xml
===================================================================
--- stack/native/trunk/modules/core/pom.xml 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/pom.xml 2012-09-25 17:02:14 UTC (rev 16762)
@@ -60,6 +60,11 @@
<artifactId>jboss-logging</artifactId>
</dependency>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</dependency>
@@ -97,6 +102,15 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <showDeprecation>false</showDeprecation>
+ <compilerArguments>
+ <AgeneratedTranslationFilesPath>${project.basedir}/target/generated-translation-files</AgeneratedTranslationFilesPath>
+ </compilerArguments>
+ </configuration>
+ </plugin>
</plugins>
</build>
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+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.xml.namespace.QName;
+import javax.xml.rpc.handler.HandlerInfo;
+
+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;
+
+/**
+ * JBossWS-CXF log messages
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+@MessageLogger(projectCode = "JBWS")
+public interface NativeLoggers extends BasicLogger
+{
+ NativeLoggers ROOT_LOGGER = org.jboss.logging.Logger.getMessageLogger(NativeLoggers.class, "org.jboss.ws.native");
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25006, value = "Cannot process metrics")
+ void cannotProcessMetrics(@Cause Throwable cause);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25009, value = "Error processing web service request")
+ void errorProcessingWebServiceRequest(@Cause Throwable cause);
+
+ @LogMessage(level = INFO)
+ @Message(id = 25010, value = "WSDL published to: %s")
+ void wsdlFilePublished(URL url);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25015, value = "Cannot get wsdl publish location for null wsdl location")
+ void cannotGetWsdlPublishLocation();
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 25016, value = "Adding server side handler to service '%s': %s")
+ void addingServerSideHandler(QName serviceName, HandlerInfo handlerInfo);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25017, value = "SOAP request exception")
+ void soapRequestException(@Cause Throwable cause);
+
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -0,0 +1,82 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * JBossWS-CXF exception messages
+ *
+ * @author alessio.soldano(a)jboss.com
+ */
+@MessageBundle(projectCode = "JBWS")
+public interface NativeMessages {
+
+ NativeMessages MESSAGES = org.jboss.logging.Messages.getBundle(NativeMessages.class);
+
+ @Message(id = 25000, value = "server config cannot be null")
+ IllegalArgumentException serverConfigCannotBeNull();
+
+ @Message(id = 25001, value = "Unsupported method: %s")
+ WSException unsupportedMethod(String method);
+
+ @Message(id = 25002, value = "Deployment has no classloader associated: %s")
+ IllegalStateException deploymentHasNoClassLoaderAssociated(Deployment dep);
+
+ @Message(id = 25003, value = "Cannot obtain endpoint meta data for endpoint %s")
+ IllegalStateException cannotObtainEndpointMetaData(ObjectName epName);
+
+ @Message(id = 25004, value = "Cannot obtain SOAPPart from response message")
+ SOAPException cannotObtainSoapPart();
+
+ @Message(id = 25005, value = "Cannot obtain ServiceEndpointInvoker for endpoint %s")
+ IllegalStateException cannotObtainServiceEndpointInvoker(ObjectName epName);
+
+ @Message(id = 25007, value = "Failed to post process response message")
+ String failedToPostProcessResponseMessage();
+
+ @Message(id = 25008, value = "Invalid endpoint address: %s")
+ IllegalArgumentException invalidEndpointAddress(String epAddress);
+
+ @Message(id = 25011, value = "WSDL 2.0 not supported")
+ UnsupportedOperationException wsdl20NotSupported();
+
+ @Message(id = 25012, value = "Cannot publish wsdl to: %s")
+ WSException cannotPublishWSDLTo(File file, @Cause Throwable cause);
+
+ @Message(id = 25013, value = "Invalid publish location: %s")
+ IllegalArgumentException invalidPublishLocation(String publishLocation, @Cause Throwable cause);
+
+ @Message(id = 25014, value = "Invalid wsdlFile %s, expected in: %s")
+ RuntimeException invalidWsdlFile(String wsdlLocation, String expLocation);
+
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -47,6 +47,7 @@
import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
@@ -212,7 +213,7 @@
}
Throwable faultCause = faultEx.getCause();
- log.error(BundleUtils.getMessage(bundle, "SOAP_REQUEST_EXCEPTION"), faultCause != null ? faultCause : faultEx);
+ NativeLoggers.ROOT_LOGGER.soapRequestException(faultCause != null ? faultCause : faultEx);
try
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -32,7 +32,7 @@
import javax.xml.rpc.handler.HandlerChain;
import javax.xml.rpc.handler.HandlerInfo;
-import org.jboss.logging.Logger;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.core.RoleSource;
import org.jboss.ws.core.server.ServerHandlerDelegate;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
@@ -49,9 +49,6 @@
*/
public class HandlerDelegateJAXRPC extends ServerHandlerDelegate implements RoleSource
{
- // provide logging
- private static Logger log = Logger.getLogger(HandlerDelegateJAXRPC.class);
-
// This endpoints handler chain
private ServerHandlerChain preHandlerChain;
// This endpoints handler chain
@@ -173,8 +170,7 @@
hConfig.put(HandlerType.class.getName(), jaxrpcMetaData.getHandlerType());
HandlerInfo info = new HandlerInfo(hClass, hConfig, headerArr);
- if (log.isDebugEnabled())
- log.debug("Adding server side handler to service '" + sepMetaData.getPortName() + "': " + info);
+ NativeLoggers.ROOT_LOGGER.addingServerSideHandler(sepMetaData.getPortName(), info);
hInfos.add(info);
}
@@ -183,9 +179,6 @@
private void initHandlerChain(ServerEndpointMetaData sepMetaData, List<HandlerInfo> hInfos, Set<String> handlerRoles, HandlerType type)
{
- if (log.isDebugEnabled())
- log.debug("Init handler chain with [" + hInfos.size() + "] handlers");
-
ServerHandlerChain handlerChain = new ServerHandlerChain(hInfos, handlerRoles, type);
if (type == HandlerType.PRE)
preHandlerChain = handlerChain;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties 2012-09-25 17:02:14 UTC (rev 16762)
@@ -7,22 +7,5 @@
CANNOT_OBTAIN_UNIFIEDMD=Cannot obtain unified meta data
NULL_RUNTIME_CLASSLOADER=Runtime classloader may not be null
-NOT_SUPPORTED_WSDL20=WSDL2.0 is not supported
-CANNOT_PUBLISH_WSDL=Cannot publish wsdl to: {0}
-CANNOT_GET_WSDL_PUBLISH_LOCATION=Cannot get wsdl publish location for null wsdl location!
-INVALID_PUBLISH_LOCATION=Invalid publish location: {0}
-INVALID_WSDLFILE=Invalid wsdlFile {0}, expected in: {1}
-
CANNOT_GET_EPR=Cannot get epr when using the XML/HTTP binding
-
-SERVER_CONFIG_CANNOT_BE_NULL=server config cannot be null
-UNSUPPORTED_METHOD=Unsupported method: {0}
-NO_CLASSLOADER_ASSOCIATED=Deployment has no classloader associated
-CANNOT_OBTAIN_ENDPOINTMD=Cannot obtain endpoint meta data
-CANNOT_OBTAIN_SOAPPART=Cannot obtain SOAPPart from response message
-CANNOT_OBTAIN_SEINVOKER=Cannot obtain ServiceEndpointInvoker
-CANNOT_PROCESS_METRICS=Cannot process metrics
-INVALID_ENDPOINT_ADDRESS=Invalid endpoint address: {0}
-ERROR_PROCESSING_WEB_SERVICE_REQUEST=Error processing web service request
-
CANNOT_LOAD_CLASS=Cannot load class: {0}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -21,6 +21,9 @@
*/
package org.jboss.wsf.stack.jbws;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+import static org.jboss.ws.NativeLoggers.ROOT_LOGGER;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -28,7 +31,6 @@
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.ResourceBundle;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -44,9 +46,7 @@
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
-import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.common.IOUtils;
@@ -87,10 +87,6 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(RequestHandlerImpl.class);
- // provide logging
- private static final Logger log = Logger.getLogger(RequestHandlerImpl.class);
-
protected ServerConfig serverConfig;
protected MessageFactoryImpl msgFactory;
@@ -105,7 +101,7 @@
public RequestHandlerImpl(final ServerConfig serverConfig)
{
if (serverConfig == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SERVER_CONFIG_CANNOT_BE_NULL"));
+ throw MESSAGES.serverConfigCannotBeNull();
this.init(serverConfig);
}
@@ -129,7 +125,7 @@
}
else
{
- throw new WSException(BundleUtils.getMessage(bundle, "UNSUPPORTED_METHOD", method));
+ throw MESSAGES.unsupportedMethod(method);
}
}
@@ -157,13 +153,13 @@
}
catch (IOException ioex)
{
- if (log.isTraceEnabled() == true)
+ if (ROOT_LOGGER.isTraceEnabled() == true)
{
- log.trace("Cannot close output stream", ioex);
+ ROOT_LOGGER.trace("Cannot close output stream", ioex);
}
else
{
- log.debug("Cannot close output stream");
+ ROOT_LOGGER.debug("Cannot close output stream");
}
}
}
@@ -180,15 +176,15 @@
private void doPost(Endpoint endpoint, HttpServletRequest req, HttpServletResponse res, ServletContext context) throws ServletException, IOException
{
- if (log.isDebugEnabled())
- log.debug("doPost: " + req.getRequestURI());
+ if (ROOT_LOGGER.isTraceEnabled())
+ ROOT_LOGGER.trace("doPost: " + req.getRequestURI());
ServletInputStream in = req.getInputStream();
ServletOutputStream out = res.getOutputStream();
ClassLoader classLoader = endpoint.getService().getDeployment().getRuntimeClassLoader();
if (classLoader == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "NO_CLASSLOADER_ASSOCIATED"));
+ throw MESSAGES.deploymentHasNoClassLoaderAssociated(endpoint.getService().getDeployment());
// Set the thread context class loader
ClassLoader ctxClassLoader = SecurityActions.getContextClassLoader();
@@ -213,13 +209,13 @@
}
catch (IOException ioex)
{
- if (log.isTraceEnabled() == true)
+ if (ROOT_LOGGER.isTraceEnabled() == true)
{
- log.trace("Cannot close output stream", ioex);
+ ROOT_LOGGER.trace("Cannot close output stream", ioex);
}
else
{
- log.debug("Cannot close output stream");
+ ROOT_LOGGER.debug("Cannot close output stream");
}
}
}
@@ -228,12 +224,12 @@
@SuppressWarnings("unchecked")
public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream outStream, InvocationContext invContext)
{
- if (log.isDebugEnabled())
- log.debug("handleRequest: " + endpoint.getName());
+ if (ROOT_LOGGER.isTraceEnabled())
+ ROOT_LOGGER.trace("handleRequest: " + endpoint.getName());
ServerEndpointMetaData sepMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_ENDPOINTMD"));
+ throw MESSAGES.cannotObtainEndpointMetaData(endpoint.getName());
// Build the message context
CommonMessageContext msgContext = new SOAPMessageContextJAXRPC();
@@ -267,7 +263,7 @@
boolean isFault = false;
SOAPPart part = ((SOAPMessage)resMessage).getSOAPPart();
if (part == null)
- throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_SOAPPART"));
+ throw MESSAGES.cannotObtainSoapPart();
// R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP status code
// if the response envelope is a Fault.
@@ -312,7 +308,7 @@
if (resMessage == null)
{
- log.debug("Null response message");
+ ROOT_LOGGER.debug("Null response message");
return;
}
@@ -328,10 +324,10 @@
ServerEndpointMetaData sepMetaData = ep.getAttachment(ServerEndpointMetaData.class);
if (sepMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_ENDPOINTMD"));
+ throw MESSAGES.cannotObtainEndpointMetaData(ep.getName());
long beginProcessing = 0;
- boolean debugEnabled = log.isDebugEnabled();
+ boolean traceEnabled = ROOT_LOGGER.isTraceEnabled();
try
{
EndpointState state = ep.getState();
@@ -342,8 +338,8 @@
throw new CommonSOAPFaultException(faultCode, faultString);
}
- if (debugEnabled)
- log.debug("BEGIN handleRequest: " + ep.getName());
+ if (traceEnabled)
+ ROOT_LOGGER.trace("BEGIN handleRequest: " + ep.getName());
beginProcessing = initRequestMetrics(ep);
MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() : null);
@@ -362,7 +358,7 @@
// Get the Invoker
ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class);
if (epInvoker == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_SEINVOKER"));
+ throw MESSAGES.cannotObtainServiceEndpointInvoker(ep.getName());
// Invoke the service endpoint
epInvoker.invoke(reqContext);
@@ -414,11 +410,11 @@
}
catch (Exception ex)
{
- log.error(BundleUtils.getMessage(bundle, "CANNOT_PROCESS_METRICS"), ex);
+ ROOT_LOGGER.cannotProcessMetrics(ex);
}
- if (debugEnabled)
- log.debug("END handleRequest: " + ep.getName());
+ if (traceEnabled)
+ ROOT_LOGGER.trace("END handleRequest: " + ep.getName());
}
}
@@ -465,14 +461,14 @@
}
catch (Exception ex)
{
- WSException.rethrow("Faild to post process response message", ex);
+ WSException.rethrow(MESSAGES.failedToPostProcessResponseMessage(), ex);
}
}
public void handleWSDLRequest(Endpoint endpoint, OutputStream outStream, InvocationContext context)
{
- if (log.isDebugEnabled())
- log.debug("handleWSDLRequest: " + endpoint.getName());
+ if (ROOT_LOGGER.isTraceEnabled())
+ ROOT_LOGGER.trace("handleWSDLRequest: " + endpoint.getName());
try
{
@@ -486,7 +482,7 @@
{
final String epAddress = endpoint.getAddress();
if (epAddress == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_ENDPOINT_ADDRESS", epAddress));
+ throw MESSAGES.invalidEndpointAddress(epAddress);
final URL wsdlUrl = new URL(epAddress + "?wsdl");
IOUtils.copyStream(outStream, wsdlUrl.openStream());
@@ -554,7 +550,7 @@
{
ServerEndpointMetaData epMetaData = endpoint.getAttachment(ServerEndpointMetaData.class);
if (epMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_ENDPOINTMD"));
+ throw MESSAGES.cannotObtainEndpointMetaData(endpoint.getName());
//The WSDLFilePublisher should set the location to an URL
URL wsdlLocation = epMetaData.getServiceMetaData().getWsdlLocation();
@@ -569,7 +565,7 @@
private void handleException(Exception ex) throws ServletException
{
- log.error(BundleUtils.getMessage(bundle, "ERROR_PROCESSING_WEB_SERVICE_REQUEST"), ex);
+ ROOT_LOGGER.errorProcessingWebServiceRequest(ex);
if (ex instanceof JAXRPCException)
throw (JAXRPCException)ex;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2012-09-25 17:02:14 UTC (rev 16762)
@@ -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.wsf.stack.jbws;
+import static org.jboss.ws.NativeLoggers.ROOT_LOGGER;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.File;
import java.io.IOException;
import java.io.Writer;
@@ -28,13 +31,9 @@
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.IOUtils;
import org.jboss.ws.common.utils.AbstractWSDLFilePublisher;
@@ -53,10 +52,6 @@
*/
public class WSDLFilePublisher extends AbstractWSDLFilePublisher
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLFilePublisher.class);
- // provide logging
- private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
-
public WSDLFilePublisher(ArchiveDeployment dep)
{
super(dep);
@@ -88,7 +83,7 @@
new WSDLWriter(wsdlDefinitions).write(fWriter, Constants.DEFAULT_XML_CHARSET);
URL wsdlPublishURL = wsdlFile.toURI().toURL();
- log.info("WSDL published to: " + wsdlPublishURL);
+ ROOT_LOGGER.wsdlFilePublished(wsdlPublishURL);
// udpate the wsdl file location
serviceMD.setWsdlLocation(wsdlPublishURL);
@@ -106,7 +101,7 @@
}
else
{
- throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORTED_WSDL20"));
+ throw MESSAGES.wsdl20NotSupported();
}
}
catch (RuntimeException rte)
@@ -115,7 +110,7 @@
}
catch (Exception e)
{
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_PUBLISH_WSDL", wsdlFile), e);
+ throw MESSAGES.cannotPublishWSDLTo(wsdlFile, e);
}
finally
{
@@ -142,13 +137,10 @@
{
if (wsdlLocation == null)
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_GET_WSDL_PUBLISH_LOCATION"));
+ ROOT_LOGGER.cannotGetWsdlPublishLocation();
return null;
}
- if (log.isTraceEnabled())
- log.trace("Publishing WSDL file: " + wsdlLocation);
-
// Only file URLs are supported in <wsdl-publish-location>
String publishLocation = wsdlPublishLocation;
boolean predefinedLocation = publishLocation != null && publishLocation.startsWith("file:");
@@ -171,7 +163,7 @@
}
catch (MalformedURLException e)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_PUBLISH_LOCATION", e.getMessage()));
+ throw MESSAGES.invalidPublishLocation(publishLocation, e);
}
}
@@ -190,7 +182,7 @@
}
else
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "INVALID_WSDLFILE_", new Object[]{ wsdlLocation , expLocation}));
+ throw MESSAGES.invalidWsdlFile(wsdlLocation, expLocation);
}
return result;
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2012-09-25 16:50:32 UTC (rev 16761)
+++ stack/native/trunk/pom.xml 2012-09-25 17:02:14 UTC (rev 16762)
@@ -70,7 +70,8 @@
<servlet.api.version>1.0.1.Final</servlet.api.version>
<saaj.api.version>1.0.1.Final</saaj.api.version>
<jboss.common.core.version>2.2.16.GA</jboss.common.core.version>
- <jboss.logging.version>3.1.0.GA</jboss.logging.version>
+ <jboss.logging.version>3.1.2.GA</jboss.logging.version>
+ <jboss-logging-processor.version>1.0.3.Final</jboss-logging-processor.version>
<netty.version>3.4.5.Final</netty.version>
<wsdl4j.version>1.6.2</wsdl4j.version>
<xerces.version>2.9.1</xerces.version>
@@ -177,6 +178,11 @@
<version>${jboss.logging.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <version>${jboss-logging-processor.version}</version>
+ </dependency>
+ <dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>${wsdl4j.version}</version>
12 years, 3 months
JBossWS SVN: r16761 - in stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc: jbws414 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-25 12:50:32 -0400 (Tue, 25 Sep 2012)
New Revision: 16761
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1386/Message.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws414/St.java
Log:
Fix tests failing with log level DEBUG or TRACE for whole org.jboss.ws category
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1386/Message.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1386/Message.java 2012-09-25 13:19:21 UTC (rev 16760)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws1386/Message.java 2012-09-25 16:50:32 UTC (rev 16761)
@@ -71,6 +71,6 @@
public String toString()
{
- return "[name=" + name + ",data=" + new String(data) + "]";
+ return "[name=" + name + ",data=" + ((data != null && data.length > 0) ? new String(data) : "null") + "]";
}
}
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws414/St.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws414/St.java 2012-09-25 13:19:21 UTC (rev 16760)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxrpc/jbws414/St.java 2012-09-25 16:50:32 UTC (rev 16761)
@@ -55,6 +55,6 @@
public String toString()
{
- return ref.toString();
+ return ref != null ? ref.toString() : "null";
}
}
12 years, 3 months
JBossWS SVN: r16760 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-25 09:19:21 -0400 (Tue, 25 Sep 2012)
New Revision: 16760
Modified:
stack/native/trunk/pom.xml
Log:
Use latest component snapshots
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2012-09-25 09:52:59 UTC (rev 16759)
+++ stack/native/trunk/pom.xml 2012-09-25 13:19:21 UTC (rev 16760)
@@ -56,11 +56,11 @@
<!-- Properties -->
<properties>
- <jbossws.api.version>1.0.1.Beta3</jbossws.api.version>
- <jbossws.spi.version>2.1.0.Beta3</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Beta3</jbossws.common.version>
- <jbossws.common.tools.version>1.0.1.GA</jbossws.common.tools.version>
- <jbossws.shared.testsuite.version>4.1.0.Beta2</jbossws.shared.testsuite.version>
+ <jbossws.api.version>1.0.1-SNAPSHOT</jbossws.api.version>
+ <jbossws.spi.version>2.1.0-SNAPSHOT</jbossws.spi.version>
+ <jbossws.common.version>2.1.0-SNAPSHOT</jbossws.common.version>
+ <jbossws.common.tools.version>1.1.0-SNAPSHOT</jbossws.common.tools.version>
+ <jbossws.shared.testsuite.version>4.1.0-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss712.version>4.1.0-SNAPSHOT</jbossws.jboss712.version>
<jboss712.version>7.1.2.Final</jboss712.version>
<jboss720.version>7.2.0.Alpha1-SNAPSHOT</jboss720.version>
12 years, 3 months
JBossWS SVN: r16759 - in stack/cxf/trunk: modules/client and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-25 05:52:59 -0400 (Tue, 25 Sep 2012)
New Revision: 16759
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-3548] Upgrade woodstox to 4.1.1 and change artifactId to woodstox-core-asl instead of wstx-lgpl
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2012-09-24 15:40:38 UTC (rev 16758)
+++ stack/cxf/trunk/modules/client/pom.xml 2012-09-25 09:52:59 UTC (rev 16759)
@@ -138,7 +138,7 @@
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-lgpl</artifactId>
+ <artifactId>woodstox-core-asl</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.fastinfoset</groupId>
Modified: stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml
===================================================================
--- stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2012-09-24 15:40:38 UTC (rev 16758)
+++ stack/cxf/trunk/modules/dist/src/main/scripts/assembly-deploy-artifacts.xml 2012-09-25 09:52:59 UTC (rev 16759)
@@ -143,15 +143,6 @@
<dependencySet>
<outputDirectory>deploy-artifacts/lib</outputDirectory>
<unpack>false</unpack>
- <outputFileNameMapping>wstx.jar</outputFileNameMapping>
- <includes>
- <include>org.codehaus.woodstox:wstx-lgpl:jar</include>
- </includes>
- <useProjectArtifact>false</useProjectArtifact>
- </dependencySet>
- <dependencySet>
- <outputDirectory>deploy-artifacts/lib</outputDirectory>
- <unpack>false</unpack>
<outputFileNameMapping>jaxb-api.jar</outputFileNameMapping>
<includes>
<include>org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:jar</include>
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2012-09-24 15:40:38 UTC (rev 16758)
+++ stack/cxf/trunk/modules/server/pom.xml 2012-09-25 09:52:59 UTC (rev 16759)
@@ -151,7 +151,7 @@
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-lgpl</artifactId>
+ <artifactId>woodstox-core-asl</artifactId>
</dependency>
<dependency>
<groupId>asm</groupId>
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-09-24 15:40:38 UTC (rev 16758)
+++ stack/cxf/trunk/pom.xml 2012-09-25 09:52:59 UTC (rev 16759)
@@ -105,7 +105,7 @@
<xerces.version>2.9.1</xerces.version>
<xmlsec.version>1.5.2</xmlsec.version>
<wss4j.version>1.6.6</wss4j.version>
- <wstx.version>3.2.9</wstx.version>
+ <wstx.version>4.1.1</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
</properties>
@@ -956,7 +956,7 @@
</dependency>
<dependency>
<groupId>org.codehaus.woodstox</groupId>
- <artifactId>wstx-lgpl</artifactId>
+ <artifactId>woodstox-core-asl</artifactId>
<version>${wstx.version}</version>
</dependency>
<dependency>
12 years, 3 months
JBossWS SVN: r16758 - in stack/cxf/trunk: modules/client and 19 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-24 11:40:38 -0400 (Mon, 24 Sep 2012)
New Revision: 16758
Added:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
Removed:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties
Modified:
stack/cxf/trunk/modules/client/pom.xml
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFInstanceProvider.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3509] Converting JBossWS-CXF to latest JBoss Logging...
Modified: stack/cxf/trunk/modules/client/pom.xml
===================================================================
--- stack/cxf/trunk/modules/client/pom.xml 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/pom.xml 2012-09-24 15:40:38 UTC (rev 16758)
@@ -225,6 +225,11 @@
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>junit</groupId>
@@ -241,6 +246,7 @@
<showDeprecation>false</showDeprecation>
<compilerArguments>
<endorseddirs>${project.build.directory}/endorsed</endorseddirs>
+ <AgeneratedTranslationFilesPath>${project.basedir}/target/generated-translation-files</AgeneratedTranslationFilesPath>
</compilerArguments>
</configuration>
</plugin>
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -0,0 +1,199 @@
+/*
+ * 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.stack.cxf;
+
+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 java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.Bus;
+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;
+
+/**
+ * JBossWS-CXF 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.cxf");
+ Loggers ADDRESS_REWRITE_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class, "org.jboss.ws.cxf.endpointAddressRewrite");
+ Loggers SECURITY_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class, "org.jboss.ws.cxf.security");
+ Loggers METADATA_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class, "org.jboss.ws.cxf.metadata");
+ Loggers DEPLOYMENT_LOGGER = org.jboss.logging.Logger.getMessageLogger(Loggers.class, "org.jboss.ws.cxf.deployment");
+
+ @LogMessage(level = INFO)
+ @Message(id = 24015, value = "Cannot use the bus associated to the current deployment for starting a new endpoint, creating a new bus...")
+ void cannotUseCurrentDepBusForStartingNewEndpoint();
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24016, value = "Unable to retrieve server config; this is an expected condition for jboss-modules enabled client.")
+ void cannotRetrieveServerConfigIgnoreForClients(@Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24018, value = "Unable to retrieve port QName from %s, trying matching port using endpoint interface name only.")
+ void cannotRetrievePortQNameTryingMatchingUsingEpInterface(String portName, @Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24027, value = "Spring initial application context creation failed using classloader %s, will try again after having switched the current thread context classloader to %s")
+ void appContextCreationFailedWillTryWithNewTCCL(ClassLoader currentCL, ClassLoader newCL, @Cause Throwable cause);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24033, value = "Setting new service endpoint address in wsdl: %s")
+ void settingNewServiceEndpointAddressInWsdl(String address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24034, value = "WSDL service endpoint address rewrite required because of server configuration: %s")
+ void addressRewriteRequiredBecauseOfServerConf(String address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24035, value = "WSDL service endpoint address rewrite required because of invalid URL: %s")
+ void addressRewriteRequiredBecauseOfInvalidAddress(String address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24036, value = "WSDL service endpoint address rewrite not required: %s")
+ void rewriteNotRequired(String address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24037, value = "Rewritten new candidate WSDL service endpoint address '%s' to '%s'")
+ void addressRewritten(String previousAddress, String address);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24038, value = "Invalid url provided, using it without rewriting: %s")
+ void invalidAddressProvidedUseItWithoutRewriting(String address);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24039, value = "Spring namespace handler resolution: unable to resolve JBossWS specific handler for namespace '%s'; trying default namespace resolution...")
+ void unableToResolveJBWSSpringNSHandler(String ns, @Cause Throwable cause);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24040, value = "About to authenticate, using security domain %s")
+ void aboutToAuthenticate(String securityDomain);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24041, value = "Authenticated, principal=%s")
+ void authenticated(String principal);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24042, value = "Security context propagated for principal %s")
+ void securityContextPropagated(String principal);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 24054, value = "User principal is not available on the current message")
+ void userPrincipalNotAvailableOnCurrentMessage();
+
+ @LogMessage(level = WARN)
+ @Message(id = 24059, value = "%s cannot open stream for resource: %s")
+ void cannotOpenStream(String callerClass, String resourcePath);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24060, value = "%s cannot resolve resource: %s")
+ void cannotResolveResource(String callerClass, String resourcePath);
+
+ @LogMessage(level = INFO)
+ @Message(id = 24061, value = "Adding service endpoint metadata: %s")
+ void addingServiceEndpointMetadata(Object o);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24062, value = "id %s, overriding portName %s with %s")
+ void overridePortName(String id, QName portName, QName newPortName);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24063, value = "id %s, overriding portName %s with %s")
+ void overrideServiceName(String id, QName serviceName, QName newServiceName);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24064, value = "id %s, enabling MTOM...")
+ void enableMTOM(String id);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24065, value = "id %s, enabling Addressing...")
+ void enableAddressing(String id);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24066, value = "id %s, enabling RespectBinding...")
+ void enableRespectBinding(String id);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24067, value = "id %s, overriding wsdlFile location with %s")
+ void overridingWsdlFileLocation(String id, String wsdlLoc);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24068, value = "Handler chain deployment descriptor contribution: PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.")
+ void filtersNotSupported();
+
+ @LogMessage(level = WARN)
+ @Message(id = 24069, value = "Init params not supported, handler: %s")
+ void initParamsSupported(String handlerName);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 24073, value = "Error registering bus for management: %s")
+ void errorRegisteringBus(Bus bus, @Cause Throwable cause);
+
+ @LogMessage(level = INFO)
+ @Message(id = 24074, value = "WSDL published to: %s")
+ void wsdlFilePublished(URL url);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24077, value = "Cannot get wsdl publish location for null wsdl location and serviceName")
+ void cannotGetWsdlPublishLocation();
+
+ @LogMessage(level = WARN)
+ @Message(id = 24078, value = "WSDL publisher not configured, unable to publish contract for endpoint class %s")
+ void unableToPublishContractDueToMissingPublisher(Class<?> clazz);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24079, value = "JBossWS-CXF configuration generated: %s")
+ void jbwscxfConfGenerated(URL url);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24080, value = "Actual configuration from file: %s")
+ void actualConfFromFile(URL url);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24081, value = "JBossWS-CXF configuration found: %s")
+ void jbwscxfConfFound(URL url);
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24086, value = "Error while getting default WSSConfig")
+ void errorGettingWSSConfig(@Cause Throwable cause);
+
+ @LogMessage(level = WARN)
+ @Message(id = 24087, value = "Could not early initialize security engine")
+ void couldNotInitSecurityEngine();
+
+ @LogMessage(level = TRACE)
+ @Message(id = 24089, value = "Unable to load additional configuration from %s")
+ void unableToLoadAdditionalConfigurationFrom(URL url, @Cause Throwable cause);
+}
Added: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java (rev 0)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -0,0 +1,214 @@
+/*
+ * 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.stack.cxf;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletException;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPException;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Cause;
+import org.jboss.logging.Message;
+import org.jboss.logging.MessageBundle;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentType;
+
+/**
+ * JBossWS-CXF 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 = 24000, value = "Could not make directory: %s")
+ IllegalStateException couldNotMakeDirectory(String dir);
+
+ @Message(id = 24001, value = "Class not found: %s")
+ IllegalArgumentException classNotFound(String clazz);
+
+ @Message(id = 24002, value = "Failed to invoke %s")
+ String failedToInvoke(String s);
+
+ @Message(id = 24003, value = "Unsupported value '%s' for target, using default value '%s'")
+ String unsupportedTargetUsingDefault(String target, String defTarget);
+
+ @Message(id = 24004, value = "SOAP message could not be sent")
+ SOAPException soapMessageCouldNotBeSent(@Cause Throwable cause);
+
+ @Message(id = 24005, value = "GET request could not be sent")
+ SOAPException getRequestCouldNotBeSent(@Cause Throwable cause);
+
+ @Message(id = 24006, value = "Connection already closed!")
+ SOAPException connectionAlreadyClosed();
+
+ @Message(id = 24007, value = "Address object of type %s is not supported")
+ SOAPException addressTypeNotSupported(Class<?> clazz);
+
+ @Message(id = 24008, value = "No ConduitInitiator is available for %s")
+ SOAPException noConduitInitiatorAvailableFor(String s);
+
+ @Message(id = 24009, value = "No ConduitInitiator is available for %s")
+ SOAPException noConduitInitiatorAvailableFor2(String s, @Cause Throwable cause);
+
+ @Message(id = 24010, value = "SOAP message could not be read")
+ SOAPException soapMessageCouldNotBeRead(@Cause Throwable cause);
+
+ @Message(id = 24011, value = "Cannot send messages using a previously closed connection")
+ SOAPException cantSendMessagesOnClosedConnection();
+
+ @Message(id = 24012, value = "Unsupported MAPEndpoint: %s")
+ IllegalArgumentException unsupportedMapEndpoin(Object o);
+
+ @Message(id = 24013, value = "Invalid null endpoint reference")
+ IllegalArgumentException invalidNullEndpointReference();
+
+ @Message(id = 24014, value = "Unsupported MAP: %s")
+ IllegalArgumentException unsupportedMap(Object o);
+
+ @Message(id = 24017, value = "Unknown feature error: %s")
+ WebServiceException unknownFeature(String f);
+
+ @Message(id = 24019, value = "Apache CXF does not support JAX-RPC and a JAX-RPC service ref is requested with it; something is likely wrong with the user configuration or classpath")
+ UnsupportedOperationException jaxrpcServiceRefNotSupported();
+
+ @Message(id = 24020, value = "Handler config file not found: %s")
+ WebServiceException handlerConfigFileNotFound(String file);
+
+ @Message(id = 24021, value = "Error parsing %s, %s element expected, but found %s")
+ WebServiceException differentElementExpected(String file, String exp, String found);
+
+ @Message(id = 24022, value = "No handler-chain found while parsing: %s")
+ WebServiceException noHandlerChainFound(String file, @Cause Throwable cause);
+
+ @Message(id = 24023, value = "Error parsing %s, invalid element in handler: %s")
+ WebServiceException invalidElementInHandler(String file, String el);
+
+ @Message(id = 24024, value = "Error parsing %s, %s is not a valid QName pattern")
+ WebServiceException notAQNamePattern(String file, String pattern);
+
+ @Message(id = 24025, value = "Cannot resolve handler file %s on %s")
+ WebServiceException cannotResolveHandlerFile(String file, String className);
+
+ @Message(id = 24026, value = "%s is not a BusExtension instance")
+ RuntimeException notABusExtensionInstance(Object obj);
+
+ @Message(id = 24028, value = "Cannot obtain %s")
+ ServletException cannotObtainRegistry(String registryInterfaceName);
+
+ @Message(id = 24029, value = "Cannot obtain destination for %s")
+ ServletException cannotObtainDestinationFor(String requestURI);
+
+ @Message(id = 24030, value = "Cannot obtain destination factory for http transport")
+ ServletException cannotObtainDestinationFactoryForHttpTransport(@Cause Throwable cause);
+
+ @Message(id = 24031, value = "Cannot load class %s")
+ IllegalStateException cannotLoadClass(String clazz);
+
+ @Message(id = 24032, value = "Cannot obtain endpoint %s")
+ WebServiceException cannotObtainEndpoint(ObjectName on);
+
+ @Message(id = 24043, value = "Class %s for namespace %s does not implement the %s interface")
+ Exception nsHandlerInterfaceNotImplemented(String s1, String s2, String s3);
+
+ @Message(id = 24044, value = "NamespaceHandler class %s for namespace %s not found")
+ Exception nsHandlerClassNotFound(String s1, String s2, @Cause Throwable cause);
+
+ @Message(id = 24045, value = "Invalid NamespaceHandler class %s for namespace %s : problem with handler class file or dependent class")
+ Exception nsHandlerInvalidClass(String s1, String s2, @Cause Throwable cause);
+
+ @Message(id = 24046, value = "Unable to load NamespaceHandler mappings from location [%s]")
+ IllegalStateException unableToLoadNSHandler(String location, @Cause Throwable cause);
+
+ @Message(id = 24047, value = "Authentication failed, principal=%s")
+ SecurityException authenticationFailed(String principal);
+
+ @Message(id = 24048, value = "Request rejected since a stale timestamp has been provided: %s")
+ SecurityException requestRejectedTimeStamp(String created);
+
+ @Message(id = 24049, value = "Request rejected since a message with the same nonce has been recently received; nonce = %s")
+ SecurityException requestRejectedSameNonce(String nonce);
+
+ @Message(id = 24050, value = "DateTime value does not follow the format '[-]yyyy-mm-ddThh:mm:ss[.s+][timezone]': expected 'T' but got %s")
+ IllegalArgumentException invalidDateTimeFormat(char c);
+
+ @Message(id = 24051, value = "Date value does not follow the format '-'? yyyy '-' mm '-' dd: %s")
+ IllegalArgumentException invalidDateValueFormat(String value);
+
+ @Message(id = 24052, value = "Time value does not follow the format 'hh:mm:ss.[s+]': %s")
+ IllegalArgumentException invalidTimeValueFormat(String value);
+
+ @Message(id = 24053, value = "Timezone value does not follow the format ([+/-]HH:MM): %s")
+ NumberFormatException invalidTimeZoneValueFormat(String value);
+
+ @Message(id = 24055, value = "Unsupported token type: %s")
+ SecurityException unsupportedTokenType(Object tokenType);
+
+ @Message(id = 24056, value = "Could not get subject info neither from Security Token in the current message nor directly from computed SecurityContext")
+ SecurityException couldNotGetSubjectInfo();
+
+ @Message(id = 24057, value = "Failed Authentication : Subject has not been created")
+ SecurityException authenticationFailedSubjectNotCreated(@Cause Throwable cause);
+
+ @Message(id = 24058, value = "Failed Authentication : Invalid Subject")
+ SecurityException authenticationFailedSubjectInvalid();
+
+ @Message(id = 24070, value = "Runtime loader cannot be null; deployment: %s")
+ IllegalStateException runtimeLoaderCannotBeNull(Deployment dep);
+
+ @Message(id = 24071, value = "@WebService annotation not found on %s")
+ RuntimeException webserviceAnnotationNotFound(String sei);
+
+ @Message(id = 24072, value = "@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on %s")
+ RuntimeException webserviceAnnotationSEIAttributes(String sei);
+
+ @Message(id = 24075, value = "WSDL 2.0 not supported")
+ RuntimeException wsdl20NotSupported();
+
+ @Message(id = 24076, value = "Service %s, cannot publish wsdl to: %s")
+ RuntimeException cannotPublishWSDLTo(QName serviceName, File file, @Cause Throwable cause);
+
+ @Message(id = 24082, value = "Unsupported deployment type: %s")
+ IllegalStateException unsupportedDeploymentType(DeploymentType depType);
+
+ @Message(id = 24083, value = "Endpoint %s is not defined in jbossws-cxf.xml")
+ IllegalStateException endpointNotDefineInJbwsCxf(String ep);
+
+ @Message(id = 24084, value = "Underlying bus is already configured for JBossWS use: %s")
+ IllegalStateException busAlreadyConfigured(Object ctx);
+
+ @Message(id = 24085, value = "Unable to load configuration from %s")
+ RuntimeException unableToLoadConfigurationFrom(URL url, @Cause Throwable cause);
+
+ @Message(id = 24088, value = "Cannot load additional config from null location")
+ IllegalArgumentException unableToLoadAdditionalConfigFromNull();
+
+ @Message(id = 24090, value = "Could not read from config file: %s")
+ RuntimeException couldNotReadConfigFile(String file);
+
+}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -46,7 +46,6 @@
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.jaxws.ServiceImpl;
import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.jboss.logging.Logger;
import org.jboss.ws.common.configuration.ConfigHelper;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.SPIProvider;
@@ -55,6 +54,8 @@
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.management.ServerConfigFactory;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
import org.jboss.wsf.stack.cxf.client.configuration.HandlerChainSortInterceptor;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSBusFactory;
@@ -91,8 +92,7 @@
Boolean db = (Boolean)bus.getProperty(Constants.DEPLOYMENT_BUS);
if (db != null && db)
{
- Logger.getLogger(ProviderImpl.class).info(
- "Cannot use the bus associated to the current deployment for starting a new endpoint, creating a new bus...");
+ Loggers.ROOT_LOGGER.cannotUseCurrentDepBusForStartingNewEndpoint();
bus = BusFactory.newInstance().createBus();
}
return super.createEndpointImpl(bus, bindingId, implementor, features);
@@ -184,7 +184,7 @@
Bus bus = setValidThreadDefaultBus();
for (WebServiceFeature f : features) {
if (!f.getClass().getName().startsWith("javax.xml.ws")) {
- throw new WebServiceException("Unknown feature error: " + f.getClass().getName());
+ throw Messages.MESSAGES.unknownFeature(f.getClass().getName());
}
}
return new JBossWSServiceImpl(bus, wsdlDocumentLocation, serviceName, serviceClass, features);
@@ -493,10 +493,7 @@
SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
serverConfig = spiProvider.getSPI(ServerConfigFactory.class, cl).getServerConfig();
} catch (Exception e) {
- Logger log = Logger.getLogger(ProviderImpl.class);
- if (log.isTraceEnabled()) {
- log.trace("Unable to retrieve server config; this is expected for jboss-modules enabled client", e);
- }
+ Loggers.ROOT_LOGGER.cannotRetrieveServerConfigIgnoreForClients(e);
} finally {
serverConfigInit = true;
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringBusFactory.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -22,16 +22,14 @@
package org.jboss.wsf.stack.cxf.client.configuration;
import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import org.apache.cxf.Bus;
import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
-import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.configuration.Configurer;
+import org.jboss.wsf.stack.cxf.Loggers;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
@@ -46,8 +44,6 @@
*/
public class JBossWSSpringBusFactory extends SpringBusFactory
{
- private static final Logger LOG = LogUtils.getL7dLogger(JBossWSSpringBusFactory.class);
-
private boolean customContextProvided = false;
public JBossWSSpringBusFactory()
@@ -83,7 +79,6 @@
}
catch (BeansException ex)
{
- LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[]) null);
throw new RuntimeException(ex);
}
}
@@ -97,7 +92,6 @@
}
catch (BeansException ex)
{
- LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[]) null);
throw new RuntimeException(ex);
}
}
@@ -126,10 +120,10 @@
}
catch (BeansException ex)
{
- LogUtils.log(LOG, Level.WARNING, "INITIAL_APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[]) null);
ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
if (contextLoader != BusApplicationContext.class.getClassLoader())
{
+ Loggers.ROOT_LOGGER.appContextCreationFailedWillTryWithNewTCCL(contextLoader, BusApplicationContext.class.getClassLoader(), ex);
Thread.currentThread().setContextClassLoader(BusApplicationContext.class.getClassLoader());
try
{
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/JBossWSSpringConfigurer.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,12 +21,10 @@
*/
package org.jboss.wsf.stack.cxf.client.configuration;
-import java.util.ResourceBundle;
-
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.configuration.spring.ConfigurerImpl;
import org.apache.cxf.extension.BusExtension;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.stack.cxf.Messages;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
@@ -40,7 +38,6 @@
*/
public class JBossWSSpringConfigurer implements JBossWSConfigurer, ApplicationContextAware, BusExtension
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossWSSpringConfigurer.class);
private BeanCustomizer customizer;
private Configurer delegate;
@@ -96,7 +93,7 @@
{
return ((BusExtension)delegate).getRegistrationType();
}
- throw new RuntimeException(BundleUtils.getMessage(bundle, "NOT_A_BUSEXTENSION_INSTANCE", delegate));
+ throw Messages.MESSAGES.notABusExtensionInstance(delegate);
}
@Override
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/configuration/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1 +0,0 @@
-NOT_A_BUSEXTENSION_INSTANCE=Delegate {0} is not a BusExtension instance
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFHandlerResolverImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -40,9 +40,12 @@
*/
package org.jboss.wsf.stack.cxf.client.serviceref;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.io.File;
-import java.util.ResourceBundle;
import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.spi.metadata.ParserConstants;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -70,7 +73,6 @@
import org.apache.cxf.resource.DefaultResourceManager;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
-import org.jboss.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -81,9 +83,6 @@
*/
final class CXFHandlerResolverImpl extends HandlerChainBuilder implements HandlerResolver
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFHandlerResolverImpl.class);
-
- private static final Logger log = Logger.getLogger(CXFHandlerResolverImpl.class);
@SuppressWarnings("rawtypes")
private final Map<PortInfo, List<Handler>> handlerMap = new HashMap<PortInfo, List<Handler>>();
private final String handlerFile;
@@ -150,25 +149,25 @@
try {
if (is == null) {
- throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CONFIG_FILE_NOT_FOUND", handlerFile));
+ throw MESSAGES.handlerConfigFileNotFound(handlerFile);
}
Document doc = XMLUtils.parse(is);
Element el = doc.getDocumentElement();
- if (!"http://java.sun.com/xml/ns/javaee".equals(el.getNamespaceURI())
- || !"handler-chains".equals(el.getLocalName())) {
-
- throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CHAINS_ELEMENT_EXPECTED"));
+ if (!ParserConstants.JAVAEE_NS.equals(el.getNamespaceURI())
+ || !ParserConstants.HANDLER_CHAINS.equals(el.getLocalName())) {
+ throw MESSAGES.differentElementExpected(handlerFile, "{" + ParserConstants.JAVAEE_NS + "}"
+ + ParserConstants.HANDLER_CHAINS, "{" + el.getNamespaceURI() + "}" + el.getLocalName());
}
chain = new ArrayList<Handler>();
Node node = el.getFirstChild();
while (node != null) {
if (node instanceof Element) {
el = (Element)node;
- if (!el.getNamespaceURI().equals("http://java.sun.com/xml/ns/javaee")
- || !el.getLocalName().equals("handler-chain")) {
-
- throw new WebServiceException(BundleUtils.getMessage(bundle, "HANDLER_CHAINS_ELEMENT_EXPECTED"));
+ if (!el.getNamespaceURI().equals(ParserConstants.JAVAEE_NS)
+ || !el.getLocalName().equals(ParserConstants.HANDLER_CHAIN)) {
+ throw MESSAGES.differentElementExpected(handlerFile, "{" + ParserConstants.JAVAEE_NS + "}"
+ + ParserConstants.HANDLER_CHAIN, "{" + el.getNamespaceURI() + "}" + el.getLocalName());
}
processHandlerChainElement(el, chain, portQName, serviceQName, bindingID);
}
@@ -177,7 +176,7 @@
} catch (WebServiceException e) {
throw e;
} catch (Exception e) {
- throw new WebServiceException(BundleUtils.getMessage(bundle, "NO_HANDLER_CHAIN_FOUND"), e);
+ throw MESSAGES.noHandlerChainFound(handlerFile, e);
}
finally
{
@@ -198,9 +197,9 @@
node = node.getNextSibling();
if (cur instanceof Element) {
el = (Element)cur;
- if (!el.getNamespaceURI().equals("http://java.sun.com/xml/ns/javaee")) {
+ if (!el.getNamespaceURI().equals(ParserConstants.JAVAEE_NS)) {
String xml = XMLUtils.toString(el);
- throw new WebServiceException(BundleUtils.getMessage(bundle, "INVALID_ELEMENT_IN_HANDLER", xml));
+ throw MESSAGES.invalidElementInHandler(handlerFile, xml);
}
String name = el.getLocalName();
if ("port-name-pattern".equals(name)) {
@@ -252,7 +251,7 @@
return true;
}
if (!namePattern.contains(":")) {
- throw new WebServiceException(BundleUtils.getMessage(bundle, "NOT_A_QNAME_PATTERN", namePattern));
+ throw MESSAGES.notAQNamePattern(handlerFile, namePattern);
}
String localPart = namePattern.substring(namePattern.indexOf(':') + 1,
namePattern.length());
@@ -296,9 +295,6 @@
private InputStream getInputStream(String filename, Class<?> wsClass)
{
URL fileURL = null;
- if (log.isDebugEnabled())
- log.debug("processHandlerChain [" + filename + "] on: " + wsClass.getName());
-
// Try the filename as URL
try
{
@@ -327,11 +323,6 @@
// Try the filename as Resource
if (fileURL == null)
{
- if (log.isDebugEnabled())
- {
- log.debug(wsClass.getProtectionDomain().getCodeSource());
- log.debug(wsClass.getClassLoader());
- }
fileURL = wsClass.getClassLoader().getResource(filename);
}
@@ -351,7 +342,7 @@
}
if (fileURL == null)
- throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_RESOLVE_HANDLER_FILE", new Object[]{ filename, wsClass.getName()}));
+ throw MESSAGES.cannotResolveHandlerFile(filename, wsClass.getName());
try
{
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefBinderJAXRPC.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,13 +21,11 @@
*/
package org.jboss.wsf.stack.cxf.client.serviceref;
-import java.util.ResourceBundle;
-
import javax.naming.Referenceable;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.serviceref.ServiceRefBinder;
+import org.jboss.wsf.stack.cxf.Messages;
/**
* Binds a JAXRPC Service object to the client's ENC.
@@ -36,10 +34,9 @@
*/
final class CXFServiceRefBinderJAXRPC implements ServiceRefBinder
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFServiceRefBinderJAXRPC.class);
@Override
public Referenceable createReferenceable(final UnifiedServiceRefMetaData serviceRefUMDM)
{
- throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "DOES_NOT_SUPPORT_JAX_RPC"));
+ throw Messages.MESSAGES.jaxrpcServiceRefNotSupported();
}
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/CXFServiceRefStubPropertyConfigurer.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,7 +25,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import javax.xml.ws.WebServiceFeature;
@@ -35,11 +34,10 @@
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
+import org.jboss.wsf.stack.cxf.Loggers;
/**
* A CXF configurer that sets the serviceref data in the JaxWsProxyFactoryBean
@@ -49,7 +47,6 @@
*/
final class CXFServiceRefStubPropertyConfigurer implements Configurer
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFServiceRefStubPropertyConfigurer.class);
private UnifiedServiceRefMetaData serviceRefMD;
private Configurer delegate;
@@ -78,8 +75,8 @@
portQName = QName.valueOf(portName);
}
catch (Exception e)
- {
- Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "UNABLE_TO_RETRIEVE_PORT_QNAME", name));
+ {
+ Loggers.ROOT_LOGGER.cannotRetrievePortQNameTryingMatchingUsingEpInterface(name, e);
}
configureJaxWsProxyFactoryBean(portQName, (JaxWsProxyFactoryBean)beanInstance);
}
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/serviceref/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,8 +0,0 @@
-UNABLE_TO_RETRIEVE_PORT_QNAME=Unable to retrieve port QName from {0}, trying matching port using endpoint interface name only.
-DOES_NOT_SUPPORT_JAX_RPC=CXF does not support JAX-RPC
-HANDLER_CONFIG_FILE_NOT_FOUND=Handler config file not found: {0}
-HANDLER_CHAINS_ELEMENT_EXPECTED={http://java.sun.com/xml/ns/javaee}handler-chain element expected
-NO_HANDLER_CHAIN_FOUND=No handler chain found
-INVALID_ELEMENT_IN_HANDLER=Invalid element in handler: {0}
-NOT_A_QNAME_PATTERN=Not a qname pattern: {0}
-CANNOT_RESOLVE_HANDLER_FILE=Cannot resolve handler file {0} on {1}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/CXFMAP.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,10 +21,11 @@
*/
package org.jboss.wsf.stack.cxf.extensions.addressing.map;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -37,7 +38,6 @@
import org.jboss.ws.api.addressing.MAPBuilder;
import org.jboss.ws.api.addressing.MAPEndpoint;
import org.jboss.ws.api.addressing.MAPRelatesTo;
-import org.jboss.ws.api.util.BundleUtils;
import org.w3c.dom.Element;
/**
@@ -52,7 +52,6 @@
*/
public class CXFMAP implements MAP
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFMAP.class);
/**
* the wrapped instance which this class delegates to
*/
@@ -156,7 +155,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
+ throw MESSAGES.unsupportedMapEndpoin(epref);
}
}
else
@@ -203,7 +202,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
+ throw MESSAGES.unsupportedMapEndpoin(epref);
}
}
else
@@ -222,7 +221,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
+ throw MESSAGES.unsupportedMapEndpoin(epref);
}
}
else
@@ -262,7 +261,7 @@
public void initializeAsDestination(MAPEndpoint epref)
{
if (epref == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_NULL_ENDPOINT_REFERENCE"));
+ throw MESSAGES.invalidNullEndpointReference();
if (epref instanceof CXFMAPEndpoint)
{
@@ -270,7 +269,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAPENDPOINT", epref));
+ throw MESSAGES.unsupportedMapEndpoin(epref);
}
}
@@ -293,7 +292,7 @@
{
if (!(map instanceof CXFMAP))
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAP", map));
+ throw MESSAGES.unsupportedMap(map);
}
AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
@@ -305,7 +304,7 @@
{
if (!(map instanceof CXFMAP))
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_MAP", map));
+ throw MESSAGES.unsupportedMap(map);
}
AddressingProperties addressingProperties = ((CXFMAP)map).implementation;
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/extensions/addressing/map/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,3 +0,0 @@
-INVALID_NULL_ENDPOINT_REFERENCE=Invalid null endpoint reference
-UNSUPPORTED_MAPENDPOINT=Unsupported MAPEndpoint: {0}
-UNSUPPORTED_MAP=Unsupported MAP: {0}
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,6 +0,0 @@
-SOAPMESSAGE_CAN_NOT_BE_SENT=SOAPMessage can not be sent
-GET_REQUEST_CAN_NOT_BE_SENT=GET request can not be sent
-CONNECTION_ALREADY_CLOSED=Connection already closed!
-ADDRESS_TYPE_NOT_SUPPORTED=Address object of type {0} is not supported
-NO_CONDUITINITIATOR_IS_AVAILABLE_FOR=No ConduitInitiator is available for {0}
-CANNOT_SENT_WITH_CLOSED_CONNECTION=Cannot send messages using a previously closed connection
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/saaj/SOAPConnectionImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.cxf.saaj;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -30,7 +32,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.MimeHeader;
@@ -54,11 +55,9 @@
import org.apache.cxf.transport.ConduitInitiatorManager;
import org.apache.cxf.transport.MessageObserver;
import org.apache.cxf.transport.http.HTTPConduit;
-import org.jboss.ws.api.util.BundleUtils;
public class SOAPConnectionImpl extends SOAPConnection
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPConnectionImpl.class);
private boolean closed = false;
@Override
@@ -122,7 +121,7 @@
}
catch (Exception ex)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CAN_NOT_BE_SENT"), ex);
+ throw MESSAGES.soapMessageCouldNotBeSent(ex);
}
// read SOAPMessage
@@ -164,7 +163,7 @@
}
catch (Exception ex)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "GET_REQUEST_CAN_NOT_BE_SENT"), ex);
+ throw MESSAGES.getRequestCouldNotBeSent(ex);
}
// read SOAPMessage
@@ -176,7 +175,7 @@
{
if (this.closed)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "CONNECTION_ALREADY_CLOSED"));
+ throw MESSAGES.connectionAlreadyClosed();
}
this.closed = true;
}
@@ -187,7 +186,7 @@
{
return addressObject.toString();
}
- throw new SOAPException(BundleUtils.getMessage(bundle, "ADDRESS_TYPE_NOT_SUPPORTED", addressObject.getClass()));
+ throw MESSAGES.addressTypeNotSupported(addressObject.getClass());
}
private ConduitInitiator getConduitInitiator(String address) throws SOAPException
@@ -215,12 +214,12 @@
}
catch (Exception ex)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "NO_CONDUITINITIATOR_IS_AVAILABLE", address), ex);
+ throw MESSAGES.noConduitInitiatorAvailableFor2(address, ex);
}
if (ci == null)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "NO_CONDUITINITIATOR_IS_AVAILABLE", address));
+ throw MESSAGES.noConduitInitiatorAvailableFor(address);
}
return ci;
}
@@ -299,14 +298,14 @@
}
catch (Exception ex)
{
- throw new SOAPException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CAN_NOT_BE_READ"), ex);
+ throw MESSAGES.soapMessageCouldNotBeRead(ex);
}
}
private void checkClosed() throws SOAPException
{
if (closed) {
- throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_SENT_WITH_CLOSED_CONNECTION"));
+ throw MESSAGES.cantSendMessagesOnClosedConnection();
}
}
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,19 +21,20 @@
*/
package org.jboss.wsf.stack.cxf.tools;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.io.File;
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import org.apache.cxf.helpers.FileUtils;
import org.apache.cxf.tools.common.ToolContext;
import org.apache.cxf.tools.wsdlto.WSDLToJava;
import org.jboss.ws.api.tools.WSContractConsumer;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.NullPrintStream;
+import org.jboss.wsf.stack.cxf.Messages;
/**
* A WSContractConsumer for CXF stack
@@ -43,7 +44,6 @@
*/
public class CXFConsumerImpl extends WSContractConsumer
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFConsumerImpl.class);
private List<File> bindingFiles = null;
private File catalog = null;
private boolean extension;
@@ -160,7 +160,7 @@
}
else if (target != null && !target.equals("2.2"))
{
- stream.println("Unsupported target, using default value '2.2'");
+ stream.println(Messages.MESSAGES.unsupportedTargetUsingDefault(target, "2.2"));
}
if (bindingFiles != null)
@@ -200,7 +200,7 @@
sourceDir = outputDir;
}
if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", sourceDir.getName()));
+ throw Messages.MESSAGES.couldNotMakeDirectory(sourceDir.getName());
args.add("-d");
args.add(sourceDir.getAbsolutePath());
@@ -227,7 +227,7 @@
}
if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", outputDir.getName()));
+ throw Messages.MESSAGES.couldNotMakeDirectory(outputDir.getName());
// Always add the output directory and the wsdl location
if (!nocompile)
@@ -263,7 +263,7 @@
{
if (messageStream != null)
{
- messageStream.println("Failed to invoke WSDLToJava");
+ messageStream.println(MESSAGES.failedToInvoke(WSDLToJava.class.getName()));
t.printStackTrace(messageStream);
}
else
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFProviderImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,18 +21,19 @@
*/
package org.jboss.wsf.stack.cxf.tools;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.io.File;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.List;
-import java.util.ResourceBundle;
import org.apache.cxf.tools.java2ws.JavaToWS;
import org.jboss.ws.api.tools.WSContractProvider;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.NullPrintStream;
+import org.jboss.wsf.stack.cxf.Messages;
/**
* A WSContractProvider for the CXF stack
@@ -42,7 +43,6 @@
*/
public class CXFProviderImpl extends WSContractProvider
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFProviderImpl.class);
private ClassLoader loader;
private boolean generateWsdl;
private boolean extension;
@@ -110,7 +110,7 @@
}
catch (ClassNotFoundException e)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CLASS_NOT_FOUND", endpointClass));
+ throw Messages.MESSAGES.classNotFound(endpointClass);
}
}
@@ -139,14 +139,14 @@
if (sourceDir != null)
{
if (!sourceDir.exists() && !sourceDir.mkdirs())
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", sourceDir.getName()));
+ throw MESSAGES.couldNotMakeDirectory(sourceDir.getName());
args.add("-s");
args.add(sourceDir.getAbsolutePath());
}
if (!outputDir.exists() && !outputDir.mkdirs())
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", outputDir.getName()));
+ throw MESSAGES.couldNotMakeDirectory(outputDir.getName());
args.add("-classdir");
args.add(outputDir.getAbsolutePath());
@@ -154,7 +154,7 @@
if (resourceDir != null)
{
if (!resourceDir.exists() && !resourceDir.mkdirs())
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "COULD_NOT_MAKE_DIRECTORY", resourceDir.getName()));
+ throw MESSAGES.couldNotMakeDirectory(resourceDir.getName());
args.add("-d");
args.add(resourceDir.getAbsolutePath());
}
@@ -203,7 +203,7 @@
{
if (messageStream != null)
{
- messageStream.println("Failed to invoke JavaToWS");
+ messageStream.println(MESSAGES.failedToInvoke(JavaToWS.class.getName()));
t.printStackTrace(messageStream);
}
else
Deleted: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,2 +0,0 @@
-CLASS_NOT_FOUND=Class not found: {0}
-COULD_NOT_MAKE_DIRECTORY=Could not make directory: {0}
\ No newline at end of file
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFInstanceProvider.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFInstanceProvider.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFInstanceProvider.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,13 +25,11 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.ws.handler.Handler;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.deployment.ReferenceFactory;
import org.jboss.wsf.spi.deployment.InstanceProvider;
import org.jboss.wsf.spi.deployment.Reference;
@@ -43,7 +41,6 @@
*/
public final class CXFInstanceProvider implements InstanceProvider {
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFInstanceProvider.class);
private final ServerFactoryBean factory;
private final Map<String, Reference> cache = new HashMap<String, Reference>(8);
@@ -72,7 +69,7 @@
}
}
if (instance == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_CLASS", className));
+ throw Messages.MESSAGES.cannotLoadClass(className);
return instance;
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,4 +0,0 @@
-CANNOT_OBTAIN_REGISTRY=Cannot obtain DestinationRegistry!
-CANNOT_OBTAIN_DESTINATION=Cannot obtain destination for: {0}
-CANNOT_GET_DESTINATIONFACTORY=Cannot get DestinationFactory for http transport!
-CANNOT_LOAD_CLASS=Cannot load class: {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -27,7 +27,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
-import java.util.ResourceBundle;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -47,7 +46,6 @@
import org.apache.cxf.transports.http.QueryHandler;
import org.apache.cxf.transports.http.QueryHandlerRegistry;
import org.jboss.util.NotImplementedException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -66,7 +64,6 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(RequestHandlerImpl.class);
private ServerConfig serverConfig;
RequestHandlerImpl()
@@ -128,7 +125,7 @@
DestinationRegistry destRegistry = getDestinationRegistryFromBus(bus);
if (destRegistry == null)
{
- throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_REGISTRY"));
+ throw Messages.MESSAGES.cannotObtainRegistry(DestinationRegistry.class.getName());
}
Collection<AbstractHTTPDestination> destinations = destRegistry.getDestinations();
AbstractHTTPDestination returnValue = null;
@@ -161,7 +158,7 @@
}
if (returnValue == null)
- throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_DESTINATION", requestURI));
+ throw Messages.MESSAGES.cannotObtainDestinationFor(requestURI);
return returnValue;
}
@@ -176,7 +173,7 @@
return transportFactory.getRegistry();
}
} catch (BusException e) {
- throw new ServletException(BundleUtils.getMessage(bundle, "CANNOT_GET_DESTINATIONFACTORY"));
+ throw Messages.MESSAGES.cannotObtainDestinationFactoryForHttpTransport(e);
}
return null;
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/config/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1 +0,0 @@
-INTERRUPTED=Interrupted while waiting for default bus to be set
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,6 +0,0 @@
-BUS_IS_ALREADY_CONFIGURED=Underlying bus is already configured for JBossWS use
-UNABLE_TO_LOAD_CONFIGURATION=Unable to load configuration from {0}
-COULD_NOT_INITIALIZE_SECURITY_ENGINE=Could not early initialize security engine!
-CANNOT_LOAD_ADDITIONAL_CONFIG=Cannot load additional config from null location!
-COULD_NOT_READ=Could not read from config file: {0}
-UNDERLYING_BUS_IS_ALREADY_CONFIGURED_FOR_JBOSSWS_USE=Underlying bus is already configured for JBossWS use!
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,7 +25,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
@@ -39,10 +38,10 @@
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.apache.cxf.ws.rm.RMManager;
import org.jboss.ws.api.binding.BindingCustomization;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringConfigurer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
@@ -60,7 +59,6 @@
*/
public class NonSpringBusHolder extends BusHolder
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(NonSpringBusHolder.class);
private boolean configured = false;
protected DDBeans metadata;
@@ -89,7 +87,7 @@
{
if (configured)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "BUS_IS_ALREADY_CONFIGURED"));
+ throw Messages.MESSAGES.busAlreadyConfigured(bus);
}
super.configure(soapTransportFactory, resolver, configurer, wsmd);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -23,11 +23,9 @@
import java.io.IOException;
import java.util.List;
-import java.util.ResourceBundle;
import org.apache.cxf.frontend.ServerFactoryBean;
import org.jboss.ws.api.annotation.EndpointConfig;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -38,6 +36,7 @@
import org.jboss.wsf.spi.metadata.config.ConfigMetaDataParser;
import org.jboss.wsf.spi.metadata.config.ConfigRoot;
import org.jboss.wsf.stack.cxf.JBossWSInvoker;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.configuration.BeanCustomizer;
import org.jboss.wsf.stack.cxf.deployment.EndpointImpl;
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
@@ -49,7 +48,6 @@
*/
public class ServerBeanCustomizer extends BeanCustomizer
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(ServerBeanCustomizer.class);
private static ServerConfig serverConfig;
private WSDLFilePublisher wsdlPublisher;
@@ -162,7 +160,7 @@
}
catch (IOException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "COULD_NOT_READ", configFile));
+ throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
}
}
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,13 +21,15 @@
*/
package org.jboss.wsf.stack.cxf.configuration;
+import static org.jboss.wsf.stack.cxf.Loggers.DEPLOYMENT_LOGGER;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import org.apache.cxf.Bus;
import org.apache.cxf.binding.soap.SoapTransportFactory;
@@ -38,9 +40,7 @@
import org.apache.cxf.transport.http.HttpDestinationFactory;
import org.apache.cxf.transport.servlet.ServletDestinationFactory;
import org.apache.ws.security.WSSConfig;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.binding.BindingCustomization;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
@@ -62,9 +62,6 @@
*/
public class SpringBusHolder extends BusHolder
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(SpringBusHolder.class);
- private static final Logger log = Logger.getLogger(BusHolder.class);
-
private boolean configured = false;
protected BusApplicationContext ctx;
@@ -107,8 +104,7 @@
}
catch (IOException e)
{
- if (log.isTraceEnabled())
- log.trace("Could not load additional config from location: " + location, e);
+ DEPLOYMENT_LOGGER.unableToLoadAdditionalConfigurationFrom(location, e);
}
}
//Force servlet transport to prevent CXF from using Jetty / http server or other transports
@@ -130,7 +126,7 @@
{
if (configured)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "BUS_IS_ALREADY_CONFIGURED"));
+ throw MESSAGES.busAlreadyConfigured(ctx);
}
super.configure(soapTransportFactory, resolver, configurer, wsmd);
if (additionalLocations != null)
@@ -143,7 +139,7 @@
}
catch (IOException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "UNABLE_TO_LOAD_CONFIGURATION", jbossCxfXml), e);
+ throw MESSAGES.unableToLoadConfigurationFrom(jbossCxfXml, e);
}
}
}
@@ -155,11 +151,8 @@
}
catch (Exception e)
{
- log.warn(BundleUtils.getMessage(bundle, "COULD_NOT_INITIALIZE_SECURITY_ENGINE"));
- if (log.isTraceEnabled())
- {
- log.trace("Error while getting default WSSConfig: ", e);
- }
+ DEPLOYMENT_LOGGER.couldNotInitSecurityEngine();
+ DEPLOYMENT_LOGGER.errorGettingWSSConfig(e);
}
configured = true;
}
@@ -187,7 +180,7 @@
throws IOException
{
if (locationUrl == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_ADDITIONAL_CONFIG"));
+ throw MESSAGES.unableToLoadAdditionalConfigFromNull();
InputStream is = locationUrl.openStream();
GenericApplicationContext childCtx = new GenericApplicationContext(ctx);
additionalCtx.add(childCtx);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -34,10 +33,9 @@
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.service.Service;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.configuration.ConfigHelper;
import org.jboss.wsf.spi.metadata.config.CommonConfig;
+import org.jboss.wsf.stack.cxf.Loggers;
/**
* An extension of @see org.apache.cxf.jaxws.EndpointImpl for dealing with
@@ -49,7 +47,6 @@
*/
public class EndpointImpl extends org.apache.cxf.jaxws22.EndpointImpl
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(EndpointImpl.class);
private WSDLFilePublisher wsdlPublisher;
private CommonConfig config;
@@ -136,12 +133,12 @@
}
catch (IOException ioe)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "PUBLISHING_WSDL_ERROR", service.getName()), ioe);
+ throw new RuntimeException(ioe);
}
}
else
{
- Logger.getLogger(this.getClass()).warn(BundleUtils.getMessage(bundle, "UNABLE_TO_PUBLISH_CONTRACT"));
+ Loggers.DEPLOYMENT_LOGGER.unableToPublishContractDueToMissingPublisher(getImplementorClass());
}
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,9 +0,0 @@
-FILTERS_NOT_SUPPORTED=PortNamePattern and ServiceNamePattern filters not supported; adding handlers anyway.
-INIT_PARAMS_NOT_SUPPORTED=Init params not supported.
-PUBLISHING_WSDL_ERROR=Error while publishing wsdl for service {0}
-UNABLE_TO_PUBLISH_CONTRACT=WSDLPublisher not configured, unable to publish contract
-WSDL20_NOT_SUPPORTED=WSDL-2.0 imports
-CANNOT_PUBLISH_WSDL=Cannot publish wsdl to: {0}
-CANNOT_GET_PUBLISH_LOCATION=Cannot get wsdl publish location for null wsdl location and serviceName
-NOT_HANDLER_INSTANCE={0} is not a JAX-WS Handler instance
-CAN_NOT_ADD_HANDLER=Could not add handler {0} as part of endpoint configuration"
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/WSDLFilePublisher.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -28,7 +28,6 @@
import java.net.URLDecoder;
import java.util.LinkedList;
import java.util.List;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
@@ -42,11 +41,10 @@
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.wsdl.WSDLManager;
import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.AbstractWSDLFilePublisher;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
import org.w3c.dom.Document;
/**
@@ -58,9 +56,6 @@
*/
public class WSDLFilePublisher extends AbstractWSDLFilePublisher
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLFilePublisher.class);
- private static final Logger log = Logger.getLogger(WSDLFilePublisher.class);
-
public WSDLFilePublisher(ArchiveDeployment dep)
{
super(dep);
@@ -83,7 +78,7 @@
writeDocument(doc, wsdlFile);
URL wsdlPublishURL = new URL(URLDecoder.decode(wsdlFile.toURI().toURL().toExternalForm(), "UTF-8"));
- log.info("WSDL published to: " + wsdlPublishURL);
+ Loggers.DEPLOYMENT_LOGGER.wsdlFilePublished(wsdlPublishURL);
// Process the wsdl imports
if (def != null)
@@ -97,7 +92,7 @@
}
else
{
- throw new NotImplementedException(BundleUtils.getMessage(bundle, "WSDL20_NOT_SUPPORTED"));
+ throw Messages.MESSAGES.wsdl20NotSupported();
}
}
catch (RuntimeException rte)
@@ -106,7 +101,7 @@
}
catch (Exception e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "CANNOT_PUBLISH_WSDL", wsdlFile), e);
+ throw Messages.MESSAGES.cannotPublishWSDLTo(serviceName, wsdlFile, e);
}
}
@@ -152,7 +147,7 @@
{
if (wsdlLocation == null && serviceName == null)
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_GET_PUBLISH_LOCATION"));
+ Loggers.DEPLOYMENT_LOGGER.cannotGetWsdlPublishLocation();
return null;
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -22,14 +22,12 @@
package org.jboss.wsf.stack.cxf.deployment.aspect;
-import java.util.ResourceBundle;
-
import org.apache.cxf.frontend.ServerFactoryBean;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.stack.cxf.CXFInstanceProvider;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
@@ -40,7 +38,6 @@
*/
public final class CXFInstanceProviderDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CXFInstanceProviderDeploymentAspect.class);
@Override
public void start(final Deployment dep)
{
@@ -50,7 +47,7 @@
//TODO: remove this after JBWS-3396 resolved
if (factory == null && SpringUtils.isSpringAvailable())
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "SPRING_ENDPOINT_NOT_DEFINED", ep.getTargetBeanName()));
+ throw Messages.MESSAGES.endpointNotDefineInJbwsCxf(ep.getTargetBeanName());
}
ep.setInstanceProvider(new CXFInstanceProvider(factory));
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/DescriptorDeploymentAspect.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,19 +25,18 @@
import static org.jboss.ws.common.integration.WSHelper.isJaxrpcDeployment;
import static org.jboss.ws.common.integration.WSHelper.isJseDeployment;
import static org.jboss.ws.common.integration.WSHelper.isWarArchive;
+import static org.jboss.wsf.stack.cxf.Loggers.DEPLOYMENT_LOGGER;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
-import java.util.ResourceBundle;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.integration.WSConstants;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
@@ -55,10 +54,6 @@
{
private static final boolean PREFER_SPRING_DESCRIPTOR_GENERATION = Boolean.getBoolean("org.jboss.ws.cxf.prefer_spring_descriptor_generation");
- private static final ResourceBundle bundle = BundleUtils.getBundle(DescriptorDeploymentAspect.class);
- // provide logging
- private static final Logger log = Logger.getLogger(DescriptorDeploymentAspect.class);
-
@Override
public void start(Deployment dep)
{
@@ -73,7 +68,7 @@
{
DDBeans dd = generateMetadataFromDeployment(dep);
cxfURL = dd.createFileURL();
- log.debug("JBossWS-CXF configuration generated: " + cxfURL);
+ DEPLOYMENT_LOGGER.jbwscxfConfGenerated(cxfURL);
}
}
if (cxfURL == null)
@@ -82,7 +77,7 @@
}
else
{
- log.debug("Actual configuration from file: " + cxfURL);
+ DEPLOYMENT_LOGGER.actualConfFromFile(cxfURL);
putCXFConfigToDeployment(dep, cxfURL);
}
}
@@ -110,7 +105,7 @@
{
if (isJaxrpcDeployment(dep))
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "UNSUPPORTED_DEPLOYMENT_TYPE", JAXRPC));
+ throw Messages.MESSAGES.unsupportedDeploymentType(JAXRPC);
}
String metadir = null;
if (isJseDeployment(dep) || isWarArchive(dep))
@@ -131,7 +126,7 @@
// get resource URL
ArchiveDeployment archDep = (ArchiveDeployment)dep;
cxfURL = archDep.getResourceResolver().resolve(metadir + "/" + Constants.JBOSSWS_CXF_SPRING_DD);
- log.debug("JBossWS-CXF configuration found: " + cxfURL);
+ DEPLOYMENT_LOGGER.jbwscxfConfFound(cxfURL);
}
catch (IOException ignore)
{
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,2 +0,0 @@
-UNSUPPORTED_DEPLOYMENT_TYPE=Unsupported deployment type: {0}
-SPRING_ENDPOINT_NOT_DEFINED=Endpoint {0} is not defined in jbossws-cxf.xml
\ No newline at end of file
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/management/InstrumentationManagerExtImpl.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,16 +1,14 @@
package org.jboss.wsf.stack.cxf.management;
import java.util.Iterator;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.management.JMException;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import org.apache.cxf.bus.ManagedBus;
-import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.management.jmx.InstrumentationManagerImpl;
+import org.jboss.wsf.stack.cxf.Loggers;
/**
@@ -21,7 +19,6 @@
public class InstrumentationManagerExtImpl extends InstrumentationManagerImpl
{
- private static final Logger LOG = LogUtils.getL7dLogger(InstrumentationManagerExtImpl.class);
private MBeanServer mbeanServer = null;
@@ -39,7 +36,7 @@
}
catch (JMException e)
{
- LOG.log(Level.SEVERE, "Register bus " + this.getBus() + " failure :" + e.getMessage());
+ Loggers.ROOT_LOGGER.errorRegisteringBus(this.getBus(), e);
}
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,6 +0,0 @@
-FILTERS_NOT_SUPPORTED=PortNamePattern, ServiceNamePattern and ProtocolBindings filters not supported; adding handlers anyway.
-INIT_PARAMS_NOT_SUPPORTED=Init params not supported.
-RUNTIME_LOADER_CANNOT_BE_NULL=Runtime loader cannot be null
-CANNOT_LOAD_SEI_CLASS=Cannot load service endpoint interface class
-WEBSERVICE_ANNOTATION_NOT_FOUND=Interface does not have a @WebService annotation: {0}
-ATTRIBUTES_NOT_FOUND=@WebService cannot have attribute 'portName', 'serviceName', 'endpointInterface' on: {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, 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,11 +21,13 @@
*/
package org.jboss.wsf.stack.cxf.metadata;
+import static org.jboss.wsf.stack.cxf.Loggers.METADATA_LOGGER;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Stack;
import java.util.StringTokenizer;
@@ -36,8 +38,6 @@
import javax.xml.ws.soap.MTOM;
import javax.xml.ws.soap.SOAPBinding;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
@@ -48,7 +48,6 @@
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
-import org.jboss.wsf.spi.metadata.webservices.WebservicesFactory;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
import org.jboss.wsf.stack.cxf.JBossWSInvoker;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -63,9 +62,6 @@
*/
public class MetadataBuilder
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(MetadataBuilder.class);
- private static final Logger log = Logger.getLogger(MetadataBuilder.class);
-
public MetadataBuilder()
{
@@ -84,7 +80,7 @@
}
processWSDDContribution(ddep, (ArchiveDeployment)dep);
- log.info("Add " + ddep);
+ METADATA_LOGGER.addingServiceEndpointMetadata(ddep);
dd.addEndpoint(ddep);
}
return dd;
@@ -125,18 +121,17 @@
if (doesMatch)
{
+ final String id = endpoint.getId();
// PortQName overrides
if (portComp.getWsdlPort() != null)
{
- if (log.isDebugEnabled())
- log.debug("Override portName " + endpoint.getPortName() + " with " + portComp.getWsdlPort());
+ METADATA_LOGGER.overridePortName(id, endpoint.getPortName(), portComp.getWsdlPort());
endpoint.setPortName(portComp.getWsdlPort());
}
//ServiceQName overrides
if (portComp.getWsdlService() != null)
{
- if (log.isDebugEnabled())
- log.debug("Override serviceName " + endpoint.getServiceName() + " with " + portComp.getWsdlService());
+ METADATA_LOGGER.overrideServiceName(id, endpoint.getServiceName(), portComp.getWsdlService());
endpoint.setServiceName(portComp.getWsdlService());
}
@@ -150,7 +145,7 @@
// MTOM settings
if (portComp.isMtomEnabled())
{
- log.debug("Enabling MTOM");
+ METADATA_LOGGER.enableMTOM(id);
endpoint.setMtomEnabled(true);
endpoint.setMtomThreshold(portComp.getMtomThreshold());
}
@@ -158,23 +153,22 @@
//Addressing
if (portComp.isAddressingEnabled())
{
- log.debug("Enabling Addressing");
- endpoint.setAddressingEnabled(true);
- endpoint.setAddressingRequired(portComp.isAddressingRequired());
- endpoint.setAddressingResponses(portComp.getAddressingResponses());
+ METADATA_LOGGER.enableAddressing(id);
+ endpoint.setAddressingEnabled(true);
+ endpoint.setAddressingRequired(portComp.isAddressingRequired());
+ endpoint.setAddressingResponses(portComp.getAddressingResponses());
}
//RespectBinding
if (portComp.isRespectBindingEnabled())
{
- log.debug("RepectBinging...");
- endpoint.setRespectBindingEnabled(true);
+ METADATA_LOGGER.enableRespectBinding(id);
+ endpoint.setRespectBindingEnabled(true);
}
//wsdlLocation override
String wsdlFile = portComp.getWebserviceDescription().getWsdlFile();
if (wsdlFile != null)
{
- if (log.isDebugEnabled())
- log.debug("Override wsdlFile location with " + wsdlFile);
+ METADATA_LOGGER.overridingWsdlFileLocation(id, wsdlFile);
endpoint.setWsdlLocation(wsdlFile);
}
}
@@ -193,15 +187,13 @@
if (handlerChain.getPortNamePattern() != null || handlerChain.getProtocolBindings() != null
|| handlerChain.getServiceNamePattern() != null)
{
- log.warn(BundleUtils.getMessage(bundle, "FILTERS_NOT_SUPPORTED"));
+ METADATA_LOGGER.filtersNotSupported();
}
for (UnifiedHandlerMetaData uhmd : handlerChain.getHandlers())
{
- if (log.isDebugEnabled())
- log.debug("Contribute handler from webservices.xml: " + uhmd.getHandlerName());
if (uhmd.getInitParams() != null && !uhmd.getInitParams().isEmpty())
{
- log.warn(BundleUtils.getMessage(bundle, "INIT_PARAMS_NOT_SUPPORTED"));
+ METADATA_LOGGER.initParamsSupported(uhmd.getHandlerName());
}
handlers.add(uhmd.getHandlerClass());
}
@@ -239,7 +231,7 @@
seiName = anWebService.endpointInterface();
ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
if(null == runtimeClassLoader)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "RUNTIME_LOADER_CANNOT_BE_NULL"));
+ throw MESSAGES.runtimeLoaderCannotBeNull(dep);
try
{
@@ -247,15 +239,15 @@
}
catch (ClassNotFoundException cnfe)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle, "CANNOT_LOAD_SEI_CLASS"), cnfe);
+ throw new RuntimeException(cnfe);
}
WebService seiAnnotation = seiClass.getAnnotation(WebService.class);
if (seiAnnotation == null)
- throw new RuntimeException(BundleUtils.getMessage(bundle, "WEBSERVICE_ANNOTATION_NOT_FOUND", seiName));
+ throw MESSAGES.webserviceAnnotationNotFound(seiName);
if (seiAnnotation.portName().length() > 0 || seiAnnotation.serviceName().length() > 0 || seiAnnotation.endpointInterface().length() > 0)
- throw new RuntimeException(BundleUtils.getMessage(bundle, "ATTRIBUTES_NOT_FOUND", seiName));
+ throw MESSAGES.webserviceAnnotationSEIAttributes(seiName);
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -319,8 +319,8 @@
public String toString()
{
- StringBuilder str = new StringBuilder("Service");
- str.append("\n id=" + this.id);
+ StringBuilder str = new StringBuilder();
+ str.append("id=" + this.id);
str.append("\n address=" + this.address);
str.append("\n implementor=" + this.implementor);
str.append("\n invoker=" + this.invoker);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/JBossWSResourceResolver.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -24,11 +24,9 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
-import java.util.ResourceBundle;
import org.apache.cxf.resource.ResourceResolver;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.stack.cxf.Loggers;
/**
* A CXF resource resolver that uses the JBossWS spi resource resolver,
@@ -41,8 +39,6 @@
*/
public class JBossWSResourceResolver implements ResourceResolver
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JBossWSResourceResolver.class);
- private static Logger log = Logger.getLogger(JBossWSResourceResolver.class);
private org.jboss.wsf.spi.deployment.ResourceResolver resolver;
public JBossWSResourceResolver(org.jboss.wsf.spi.deployment.ResourceResolver resolver)
@@ -61,7 +57,7 @@
}
catch (IOException ioe)
{
- log.warn(BundleUtils.getMessage(bundle, "CANNOT_OPEN_STREAM_FOR_RESOURCE", resourcePath));
+ Loggers.ROOT_LOGGER.cannotOpenStream(JBossWSResourceResolver.class.getSimpleName(), resourcePath);
}
}
return null;
@@ -76,8 +72,8 @@
}
catch (IOException ioe)
{
- if (log.isDebugEnabled())
- log.debug(BundleUtils.getMessage(bundle, "CANNOT_RESOLVE_RESOURCE", resourcePath));
+ if (Loggers.ROOT_LOGGER.isDebugEnabled())
+ Loggers.ROOT_LOGGER.cannotResolveResource(JBossWSResourceResolver.class.getSimpleName(), resourcePath);
}
if (url != null && resourceType.isInstance(url))
{
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/resolver/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,2 +0,0 @@
-CANNOT_OPEN_STREAM_FOR_RESOURCE=Cannot open stream for resource: {0}
-CANNOT_RESOLVE_RESOURCE=Cannot resolve resource: {0}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,7 +0,0 @@
-AUTHENTICATION_FAILED=Authentication failed, principal= {0}
-REQUEST_REJECTED_TIMESTAMP=Request rejected since a stale timestamp has been provided: {0}
-REQUEST_REJECTED_SAME_NONCE=Request rejected since a message with the same nonce has been recently received; nonce = {0}
-INVALID_DATE_VALUE_FORMAT=Date value does not follow the format '-'? yyyy '-' mm '-' dd: {0}
-TIME_VALUE_DOES_NOT_FOLLOW_THE_FORMAT_'HH:MM:SS.[S+]'=Time value does not follow the format 'hh:mm:ss.[s+]': {0}
-INVALID_TIME_VALUE_FORMAT=Timezone value does not follow the format ([+/-]HH:MM):
-INVALID_DATATIME_FORMAT=DateTime value does not follow the format '[-]yyyy-mm-ddThh:mm:ss[.s+][timezone]': expected 'T' but got {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingPolicyInterceptor.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -36,9 +36,10 @@
import org.apache.cxf.phase.Phase;
import org.apache.cxf.security.SecurityContext;
import org.apache.ws.security.WSUsernameTokenPrincipal;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.security.SecurityDomainContext;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.security.nonce.NonceStore;
/**
@@ -50,8 +51,6 @@
*/
public class SubjectCreatingPolicyInterceptor extends AbstractPhaseInterceptor<Message>
{
- private static Logger LOG = Logger.getLogger(SubjectCreatingPolicyInterceptor.class);
-
private SubjectCreator helper = new SubjectCreator();
public SubjectCreatingPolicyInterceptor()
@@ -68,7 +67,7 @@
SecurityContext context = message.get(SecurityContext.class);
if (context == null || context.getUserPrincipal() == null)
{
- LOG.error("User Principal is not available on the current message"); //TODO i18n
+ Loggers.SECURITY_LOGGER.userPrincipalNotAvailableOnCurrentMessage();
return;
}
@@ -79,7 +78,7 @@
//Try authenticating using SecurityToken info
if (token.getTokenType() != TokenType.UsernameToken)
{
- reportSecurityException("Unsupported token type " + token.getTokenType().toString());
+ throw Messages.MESSAGES.unsupportedTokenType(token.getTokenType());
}
UsernameToken ut = (UsernameToken) token;
subject = createSubject(sdc, ut.getName(), ut.getPassword(), ut.isHashed(), ut.getNonce(), ut.getCreatedTime());
@@ -90,7 +89,7 @@
//Try authenticating using WSS4J internal info (previously set into SecurityContext by WSS4JInInterceptor)
Principal p = context.getUserPrincipal();
if (!(p instanceof WSUsernameTokenPrincipal)) {
- reportSecurityException("Could not get subject info neither from Security Token in the current message nor directly from computed SecurityContext");
+ throw Messages.MESSAGES.couldNotGetSubjectInfo();
}
WSUsernameTokenPrincipal up = (WSUsernameTokenPrincipal) p;
subject = createSubject(sdc, up.getName(), up.getPassword(), up.isPasswordDigest(), up.getNonce(), up.getCreatedTime());
@@ -109,11 +108,11 @@
}
catch (Exception ex)
{
- reportSecurityException("Failed Authentication : Subject has not been created, " + ex.getMessage());
+ throw Messages.MESSAGES.authenticationFailedSubjectNotCreated(ex);
}
if (subject == null || subject.getPrincipals().size() == 0)
{
- reportSecurityException("Failed Authentication : Invalid Subject");
+ throw Messages.MESSAGES.authenticationFailedSubjectInvalid();
}
return subject;
}
@@ -137,12 +136,6 @@
return new DefaultSecurityContext(p, subject);
}
- protected void reportSecurityException(String errorMessage)
- {
- LOG.error(errorMessage); //TODO i18n
- throw new SecurityException(errorMessage);
- }
-
public void setPropagateContext(boolean propagateContext)
{
this.helper.setPropagateContext(propagateContext);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreator.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,18 +21,18 @@
*/
package org.jboss.wsf.stack.cxf.security.authentication;
+import static org.jboss.wsf.stack.cxf.Loggers.SECURITY_LOGGER;
+import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+
import java.security.Principal;
import java.util.Calendar;
-import java.util.ResourceBundle;
import java.util.TimeZone;
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import org.apache.cxf.common.security.SimplePrincipal;
-import org.jboss.logging.Logger;
import org.jboss.security.auth.callback.CallbackHandlerPolicyContextHandler;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.security.SecurityDomainContext;
@@ -49,9 +49,6 @@
*/
public class SubjectCreator
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(SubjectCreator.class);
- private static final Logger log = Logger.getLogger(SubjectCreator.class);
-
private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
private boolean propagateContext;
@@ -83,9 +80,9 @@
Principal principal = new SimplePrincipal(name);
Subject subject = new Subject();
- boolean TRACE = log.isTraceEnabled();
+ boolean TRACE = SECURITY_LOGGER.isTraceEnabled();
if (TRACE)
- log.trace("About to authenticate, using security domain '" + ctx.getSecurityDomain() + "'");
+ SECURITY_LOGGER.aboutToAuthenticate(ctx.getSecurityDomain());
try
{
@@ -96,9 +93,7 @@
{
if (ctx.isValid(principal, password, subject) == false)
{
- String msg = BundleUtils.getMessage(bundle, "AUTHENTICATION_FAILED", principal.getName());
- log.error(msg);
- throw new SecurityException(msg);
+ throw MESSAGES.authenticationFailed(principal.getName());
}
}
finally
@@ -117,13 +112,13 @@
}
if (TRACE)
- log.trace("Authenticated, principal=" + name);
+ SECURITY_LOGGER.authenticated(name);
if (propagateContext)
{
ctx.pushSubjectContext(subject, principal, password);
if (TRACE)
- log.trace("Security Context has been propagated");
+ SECURITY_LOGGER.securityContextPropagated(name);
}
return subject;
}
@@ -136,13 +131,13 @@
Calendar ref = Calendar.getInstance();
ref.add(Calendar.SECOND, -timestampThreshold);
if (ref.after(cal))
- throw new SecurityException(BundleUtils.getMessage(bundle, "REQUEST_REJECTED", created));
+ throw MESSAGES.requestRejectedTimeStamp(created);
}
if (nonce != null && nonceStore != null)
{
if (nonceStore.hasNonce(nonce))
- throw new SecurityException(BundleUtils.getMessage(bundle, "REQUEST_REJECTED_SAME_NONCE", nonce));
+ throw MESSAGES.requestRejectedSameNonce(nonce);
nonceStore.putNonce(nonce);
}
}
@@ -175,7 +170,7 @@
int timeInd = parseDate(value, 0, cal);
if (value.charAt(timeInd) != 'T')
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATATIME_FORMAT", value.charAt(timeInd)));
+ throw MESSAGES.invalidDateTimeFormat(value.charAt(timeInd));
}
int tzStart = parseTime(value, timeInd + 1, cal);
@@ -203,13 +198,13 @@
if (!Character.isDigit(value.charAt(start)))
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
+ throw MESSAGES.invalidDateValueFormat(value);
}
int nextToken = value.indexOf('-', start);
if (nextToken == -1 || nextToken - start < 4)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
+ throw MESSAGES.invalidDateValueFormat(value);
}
int year = Integer.parseInt(value.substring(start, nextToken));
@@ -218,7 +213,7 @@
nextToken = value.indexOf('-', start);
if (nextToken == -1 || nextToken - start < 2)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_DATE_VALUE_FORMAT", value));
+ throw MESSAGES.invalidDateValueFormat(value);
}
int month = Integer.parseInt(value.substring(start, nextToken));
@@ -238,7 +233,7 @@
{
if (value.charAt(start + 2) != ':' || value.charAt(start + 5) != ':')
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value));
+ throw MESSAGES.invalidTimeValueFormat(value);
}
int hh = Integer.parseInt(value.substring(start, start + 2));
@@ -292,7 +287,7 @@
}
else
{
- throw new NumberFormatException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value.substring(start)));
+ throw MESSAGES.invalidTimeZoneValueFormat(value.substring(start));
}
}
else if (value.charAt(start) == 'Z')
@@ -301,7 +296,7 @@
}
else
{
- throw new NumberFormatException(BundleUtils.getMessage(bundle, "INVALID_TIME_VALUE_FORMAT", value.substring(start)));
+ throw MESSAGES.invalidTimeZoneValueFormat(value.substring(start));
}
return tz;
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1,3 +0,0 @@
-INVALID_NAMESPACEHANDLER_CLASS=Invalid NamespaceHandler class {0} for namespace {1} : problem with handler class file or dependent class
-NOT_IMPLEMENT_NSHANDLER_INTERFACE=Class {0} for namespace {1} does not implement the {2} interface
-NSHANDLER_CLASS_NOT_FOUND=NamespaceHandler class {0} for namespace {1} not found
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/spring/handler/NamespaceHandlerResolver.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,10 +25,9 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import java.util.ResourceBundle;
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.wsf.stack.cxf.Loggers;
+import org.jboss.wsf.stack.cxf.Messages;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver;
@@ -48,11 +47,8 @@
*/
public class NamespaceHandlerResolver extends DefaultNamespaceHandlerResolver
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(NamespaceHandlerResolver.class);
public static final String JBOSSWS_HANDLER_MAPPINGS_LOCATION = "META-INF/jbossws.spring.handlers";
- private static final Logger logger = Logger.getLogger(NamespaceHandlerResolver.class);
-
private ClassLoader loader;
private Map<Object, Object> jbosswsHandlerMappings;
@@ -83,9 +79,7 @@
}
catch (Throwable t)
{
- if (logger.isTraceEnabled())
- logger.trace("Unable to resolve JBossWS specific handler for namespace '" + namespaceUri
- + "'; trying default namespace resolution...", t);
+ Loggers.ROOT_LOGGER.unableToResolveJBWSSpringNSHandler(namespaceUri, t);
}
return jbosswsHandler != null ? jbosswsHandler : super.resolve(namespaceUri);
}
@@ -110,8 +104,7 @@
Class<?> handlerClass = ClassUtils.forName(className, this.loader);
if (!NamespaceHandler.class.isAssignableFrom(handlerClass))
{
- throw new FatalBeanException(BundleUtils.getMessage(bundle, "NOT_IMPLEMENT_NSHANDLER_INTERFACE",
- new Object[]{className, namespaceUri, NamespaceHandler.class.getName()}));
+ throw new FatalBeanException("", Messages.MESSAGES.nsHandlerInterfaceNotImplemented(className, namespaceUri, NamespaceHandler.class.getName()));
}
NamespaceHandler namespaceHandler = (NamespaceHandler) BeanUtils.instantiateClass(handlerClass);
namespaceHandler.init();
@@ -120,13 +113,11 @@
}
catch (ClassNotFoundException ex)
{
- throw new FatalBeanException(BundleUtils.getMessage(bundle, "NSHANDLER_CLASS_NOT_FOUND",
- new Object[]{className, namespaceUri}), ex);
+ throw new FatalBeanException("", Messages.MESSAGES.nsHandlerClassNotFound(className, namespaceUri, ex));
}
catch (LinkageError err)
{
- throw new FatalBeanException(BundleUtils.getMessage(bundle, "INVALID_NAMESPACEHANDLER_CLASS",
- new Object[]{className, namespaceUri} ), err);
+ throw new FatalBeanException("", Messages.MESSAGES.nsHandlerInvalidClass(className, namespaceUri, err));
}
}
}
@@ -142,18 +133,11 @@
{
Properties mappings = PropertiesLoaderUtils.loadAllProperties(JBOSSWS_HANDLER_MAPPINGS_LOCATION,
this.loader);
- if (logger.isDebugEnabled())
- {
- logger.debug("Loaded mappings [" + mappings + "]");
- }
this.jbosswsHandlerMappings = new HashMap<Object, Object>(mappings);
}
catch (IOException ex)
{
- IllegalStateException ise = new IllegalStateException(
- "Unable to load NamespaceHandler mappings from location [" + JBOSSWS_HANDLER_MAPPINGS_LOCATION + "]");
- ise.initCause(ex);
- throw ise;
+ throw Messages.MESSAGES.unableToLoadNSHandler(JBOSSWS_HANDLER_MAPPINGS_LOCATION, ex);
}
}
return this.jbosswsHandlerMappings;
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -21,13 +21,14 @@
*/
package org.jboss.wsf.stack.cxf.transport;
+import static org.jboss.wsf.stack.cxf.Loggers.ADDRESS_REWRITE_LOGGER;
+
import java.net.URI;
import java.net.URL;
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress;
-import org.jboss.logging.Logger;
import org.jboss.wsf.spi.management.ServerConfig;
/**
@@ -43,8 +44,6 @@
*/
public class AddressRewritingEndpointInfo extends EndpointInfo
{
- private static Logger log = Logger.getLogger(AddressRewritingEndpointInfo.class);
-
private ServerConfig serverConfig;
SoapAddress saddress;
@@ -92,7 +91,7 @@
}
if (setNewAddress && saddress != null)
{
- log.info("Setting new service endpoint address in wsdl: " + s);
+ ADDRESS_REWRITE_LOGGER.settingNewServiceEndpointAddressInWsdl(s);
saddress.setLocationURI(s);
}
}
@@ -122,16 +121,16 @@
//check config prop forcing address rewrite
if (serverConfig.isModifySOAPAddress())
{
- log.debug("Rewrite required because of configuration");
+ ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfServerConf(previousAddress);
return true;
}
//check if the previous address is not valid
if (isInvalidAddress(previousAddress))
{
- log.debug("Rewrite required because of invalid url");
+ ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfInvalidAddress(previousAddress);
return true;
}
- log.debug("Rewrite not required");
+ ADDRESS_REWRITE_LOGGER.rewriteNotRequired(previousAddress);
return false;
}
@@ -190,12 +189,13 @@
}
}
String urlStr = uriScheme + "://" + host + port + path;
- log.debugf("Rewritten new candidate service endpoint address '%s' to '%s'", s, urlStr);
+
+ ADDRESS_REWRITE_LOGGER.addressRewritten(s, urlStr);
return urlStr;
}
catch (Exception e)
{
- log.debugf("Invalid url provided, using it without rewriting: %s", s);
+ ADDRESS_REWRITE_LOGGER.invalidAddressProvidedUseItWithoutRewriting(s);
return s;
}
}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/Message.properties 2012-09-24 15:40:38 UTC (rev 16758)
@@ -1 +0,0 @@
-CANNOT_OBTAIN_ENDPOINT=Cannot obtain endpoint for: {0}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2012-09-24 15:40:38 UTC (rev 16758)
@@ -25,7 +25,6 @@
import java.io.IOException;
import java.util.List;
-import java.util.ResourceBundle;
import javax.management.ObjectName;
import javax.servlet.ServletConfig;
@@ -33,7 +32,6 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.WebServiceException;
import javax.xml.ws.handler.Handler;
import org.apache.cxf.Bus;
@@ -45,7 +43,6 @@
import org.apache.cxf.management.interceptor.ResponseTimeMessageInInterceptor;
import org.apache.cxf.management.interceptor.ResponseTimeMessageInvokerInterceptor;
import org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.common.injection.InjectionHelper;
import org.jboss.wsf.spi.SPIProvider;
@@ -57,6 +54,7 @@
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
/**
@@ -67,7 +65,6 @@
*/
public class ServletHelper
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(ServletHelper.class);
public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
public static Endpoint initEndpoint(ServletConfig servletConfig, String servletName)
@@ -105,7 +102,7 @@
{
ObjectName oname = ObjectNameFactory.create(Endpoint.SEPID_DOMAIN + ":" + Endpoint.SEPID_PROPERTY_CONTEXT
+ "=" + contextPath + "," + Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName);
- throw new WebServiceException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_ENDPOINT", oname));
+ throw Messages.MESSAGES.cannotObtainEndpoint(oname);
}
//Inject the EJB and JNDI resources if possible
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-09-24 14:42:59 UTC (rev 16757)
+++ stack/cxf/trunk/pom.xml 2012-09-24 15:40:38 UTC (rev 16758)
@@ -78,7 +78,8 @@
<cxf.xjcplugins.version>2.6.0</cxf.xjcplugins.version>
<fastinfoset.api.version>1.2.9</fastinfoset.api.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
- <jboss.logging.version>3.1.0.GA</jboss.logging.version>
+ <jboss-logging.version>3.1.2.GA</jboss-logging.version>
+ <jboss-logging-processor.version>1.0.3.Final</jboss-logging-processor.version>
<jboss.xb.version>2.0.3.GA</jboss.xb.version>
<picketbox.version>4.0.9.Final</picketbox.version>
<picketlink.version>2.1.4.Final</picketlink.version>
@@ -1159,6 +1160,12 @@
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>${jboss.common.core.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ </exclusion>
+ </exclusions>
<scope>provided</scope>
</dependency>
<dependency>
@@ -1219,9 +1226,14 @@
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
- <version>${jboss.logging.version}</version>
+ <version>${jboss-logging.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-processor</artifactId>
+ <version>${jboss-logging-processor.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.jboss.spec.javax.jms</groupId>
<artifactId>jboss-jms-api_1.1_spec</artifactId>
<version>${jms.api.version}</version>
12 years, 3 months
JBossWS SVN: r16757 - in stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf: transport and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-09-24 10:42:59 -0400 (Mon, 24 Sep 2012)
New Revision: 16757
Modified:
stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
Log:
[JBWS-3550] still support @PostConstruct & @PreDestroy due to BC reasons
Modified: stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
--- stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2012-09-24 13:08:04 UTC (rev 16756)
+++ stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2012-09-24 14:42:59 UTC (rev 16757)
@@ -91,6 +91,12 @@
}
@Override
+ public void destroy()
+ {
+ ServletHelper.callPreDestroy(endpoint);
+ }
+
+ @Override
public void doHead(HttpServletRequest request, HttpServletResponse response, ServletContext context)
throws ServletException, IOException
{
Modified: stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java
===================================================================
--- stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2012-09-24 13:08:04 UTC (rev 16756)
+++ stack/cxf/branches/ropalka_JBWS-3550/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/ServletHelper.java 2012-09-24 14:42:59 UTC (rev 16757)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.stack.cxf.transport;
+import static org.jboss.ws.common.integration.WSHelper.isJaxwsJseEndpoint;
+
import java.io.IOException;
import java.util.List;
import java.util.ResourceBundle;
@@ -45,6 +47,7 @@
import org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.ws.common.injection.InjectionHelper;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -124,11 +127,30 @@
for (Handler handler : chain)
{
final Reference handlerReference = endpoint.getInstanceProvider().getInstance(handler.getClass().getName());
+ if (!handlerReference.isInitialized()) {
+ final Object handlerInstance = handlerReference.getValue();
+ InjectionHelper.callPostConstructMethod(handlerInstance);
+ handlerReference.setInitialized();
+ }
}
}
}
}
+ public static void callPreDestroy(Endpoint endpoint)
+ {
+ ServerFactoryBean factory = endpoint.getAttachment(ServerFactoryBean.class);
+ if (factory != null)
+ {
+ if (isJaxwsJseEndpoint(endpoint) && factory.getServiceBean() != null)
+ {
+ final Reference epReference = endpoint.getInstanceProvider().getInstance(factory.getServiceBean().getClass().getName());
+ final Object epInstance = epReference.getValue();
+ InjectionHelper.callPreDestroyMethod(epInstance);
+ }
+ }
+ }
+
public static void callRequestHandler(HttpServletRequest req, HttpServletResponse res, ServletContext ctx, Bus bus,
Endpoint endpoint) throws ServletException
{
12 years, 3 months
JBossWS SVN: r16756 - in common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common: invocation and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-09-24 09:08:04 -0400 (Mon, 24 Sep 2012)
New Revision: 16756
Removed:
common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/DefaultResourceInjectorFactory.java
common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextAdapter.java
common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextInjector.java
common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/servlet/
Modified:
common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
Log:
[JBWS-3550] removing useless classes
Deleted: common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/DefaultResourceInjectorFactory.java
===================================================================
--- common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/DefaultResourceInjectorFactory.java 2012-09-24 12:58:26 UTC (rev 16755)
+++ common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/DefaultResourceInjectorFactory.java 2012-09-24 13:08:04 UTC (rev 16756)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- *
- * 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.invocation;
-
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 19, 2007
- */
-public class DefaultResourceInjectorFactory extends ResourceInjectorFactory
-{
- public ResourceInjector newResourceInjector()
- {
- return new WebServiceContextInjector();
- }
-}
Deleted: common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextAdapter.java
===================================================================
--- common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextAdapter.java 2012-09-24 12:58:26 UTC (rev 16755)
+++ common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextAdapter.java 2012-09-24 13:08:04 UTC (rev 16756)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.
- *
- * 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.invocation;
-
-import java.security.Principal;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.xml.ws.WebServiceContext;
-import javax.xml.ws.handler.MessageContext;
-
-import org.jboss.wsf.spi.invocation.WebServiceContextDelegate;
-
-/**
- * Web service context which security related methods delegate to servlet container.
- *
- * @author alessio.soldano(a)jboss.com
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class WebServiceContextAdapter extends WebServiceContextDelegate
-{
-
- private final HttpServletRequest httpRequest;
-
- public WebServiceContextAdapter(final WebServiceContext ctx)
- {
- super(ctx);
- httpRequest = (HttpServletRequest)ctx.getMessageContext().get(MessageContext.SERVLET_REQUEST);
- }
-
- @Override
- public Principal getUserPrincipal()
- {
- return httpRequest.getUserPrincipal();
- }
-
- @Override
- public boolean isUserInRole(String role)
- {
- return httpRequest.isUserInRole(role);
- }
-
-}
Deleted: common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextInjector.java
===================================================================
--- common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextInjector.java 2012-09-24 12:58:26 UTC (rev 16755)
+++ common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/invocation/WebServiceContextInjector.java 2012-09-24 13:08:04 UTC (rev 16756)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- *
- * 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.invocation;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.ws.common.injection.InjectionHelper;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-
-/**
- * Inject the JAXWS WebServiceContext
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author ropalka(a)redhat.com
- */
-public class WebServiceContextInjector extends ResourceInjector
-{
- public void inject(Object instance, WebServiceContext context)
- {
- InjectionHelper.injectWebServiceContext(instance, context);
- }
-}
Modified: common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java
===================================================================
--- common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2012-09-24 12:58:26 UTC (rev 16755)
+++ common/branches/ropalka_JBWS-3550/src/main/java/org/jboss/ws/common/spi/DefaultSPIProvider.java 2012-09-24 13:08:04 UTC (rev 16756)
@@ -25,7 +25,6 @@
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;
import org.jboss.ws.common.management.DefaultEndpointMetricsFactory;
import org.jboss.ws.common.management.DefaultEndpointRegistryFactory;
import org.jboss.ws.common.management.DefaultJMSEndpointResolver;
@@ -34,7 +33,6 @@
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
import org.jboss.wsf.spi.management.EndpointMetricsFactory;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
@@ -68,10 +66,6 @@
{
returnType = loadService(spiType, DefaultLifecycleHandlerFactory.class, loader);
}
- else if (ResourceInjectorFactory.class.equals(spiType))
- {
- returnType = loadService(spiType, DefaultResourceInjectorFactory.class, loader);
- }
else if (ServiceRefHandlerFactory.class.equals(spiType))
{
returnType = loadService(spiType, DefaultServiceRefHandlerFactory.class, loader);
12 years, 3 months
JBossWS SVN: r16755 - common/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-09-24 08:58:26 -0400 (Mon, 24 Sep 2012)
New Revision: 16755
Added:
common/branches/ropalka_JBWS-3550/
Log:
creating user branch
12 years, 3 months
JBossWS SVN: r16754 - common/branches.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-09-24 08:57:50 -0400 (Mon, 24 Sep 2012)
New Revision: 16754
Removed:
common/branches/ropalka_JBWS-3550/
Log:
removing wrong branch
12 years, 3 months
JBossWS SVN: r16753 - in stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss: wsf/stack/jbws and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-09-24 08:27:59 -0400 (Mon, 24 Sep 2012)
New Revision: 16753
Removed:
stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
Modified:
stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
Log:
removing last remaining JAXWS bits
Deleted: stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java
===================================================================
--- stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2012-09-21 15:48:32 UTC (rev 16752)
+++ stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/HandlerMetaDataJAXWS.java 2012-09-24 12:27:59 UTC (rev 16753)
@@ -1,111 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- *
- * 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.metadata.umdm;
-
-import javax.xml.namespace.QName;
-
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
-
-/**
- * The JAXWS metdata data for a handler element
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-May-2006
- */
-public class HandlerMetaDataJAXWS extends HandlerMetaData
-{
- private static final long serialVersionUID = 7631133188974299826L;
-
- // The JAXWS service name pattern
- private QName serviceNamePattern;
- // The JAXWS port name pattern
- private QName portNamePattern;
- // The JAXWS protocol bindings
- private String protocolBindings;
-
- public static HandlerMetaDataJAXWS newInstance(UnifiedHandlerMetaData uhmd, HandlerType type)
- {
- HandlerMetaDataJAXWS hmd = new HandlerMetaDataJAXWS(type);
- hmd.setHandlerName(uhmd.getHandlerName());
- hmd.setHandlerClassName(uhmd.getHandlerClass());
- hmd.setInitParams(uhmd.getInitParams());
- UnifiedHandlerChainMetaData handlerChain = uhmd.getHandlerChain();
- if (handlerChain != null)
- {
- hmd.setProtocolBindings(handlerChain.getProtocolBindings());
- hmd.setServiceNamePattern(handlerChain.getServiceNamePattern());
- hmd.setPortNamePattern(handlerChain.getPortNamePattern());
- }
- return hmd;
- }
-
- public HandlerMetaDataJAXWS(HandlerType type)
- {
- super(type);
- }
-
- public QName getPortNamePattern()
- {
- return portNamePattern;
- }
-
- public void setPortNamePattern(QName portNamePattern)
- {
- this.portNamePattern = portNamePattern;
- }
-
- public String getProtocolBindings()
- {
- return protocolBindings;
- }
-
- public void setProtocolBindings(String protocolBindings)
- {
- this.protocolBindings = protocolBindings;
- }
-
- public QName getServiceNamePattern()
- {
- return serviceNamePattern;
- }
-
- public void setServiceNamePattern(QName serviceNamePattern)
- {
- this.serviceNamePattern = serviceNamePattern;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nHandlerMetaDataJAXWS:");
- buffer.append("\n type=" + getHandlerType());
- buffer.append("\n name=" + getHandlerName());
- buffer.append("\n class=" + getHandlerClass());
- buffer.append("\n params=" + getInitParams());
- buffer.append("\n protocols=" + getProtocolBindings());
- buffer.append("\n services=" + getServiceNamePattern());
- buffer.append("\n ports=" + getPortNamePattern());
- return buffer.toString();
- }
-
-}
Modified: stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-09-21 15:48:32 UTC (rev 16752)
+++ stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-09-24 12:27:59 UTC (rev 16753)
@@ -78,9 +78,6 @@
private String wsdlFile;
private URL mappingLocation;
private String wsdlPublishLocation;
-
- // The optional service handlers
- private List<HandlerMetaDataJAXWS> handlers = new ArrayList<HandlerMetaDataJAXWS>();
// The type mapping that is maintained by this service
private TypesMetaData types;
@@ -183,16 +180,6 @@
return types;
}
- public void addHandler(HandlerMetaDataJAXWS handler)
- {
- handlers.add(handler);
- }
-
- public List<HandlerMetaDataJAXWS> getHandlerMetaData()
- {
- return Collections.unmodifiableList(handlers);
- }
-
public List<EndpointMetaData> getEndpoints()
{
return new ArrayList<EndpointMetaData>(endpoints.values());
Modified: stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
===================================================================
--- stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2012-09-21 15:48:32 UTC (rev 16752)
+++ stack/native/branches/ropalka_JBWS-3550/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2012-09-24 12:27:59 UTC (rev 16753)
@@ -23,7 +23,7 @@
import static org.jboss.ws.common.integration.WSHelper.isJaxrpcEjbDeployment;
import static org.jboss.ws.common.integration.WSHelper.isJaxrpcJseDeployment;
-import static org.jboss.ws.common.integration.WSHelper.isJaxwsDeployment;
+import static org.jboss.ws.common.integration.WSHelper.isJaxrpcDeployment;
import java.util.ResourceBundle;
@@ -50,15 +50,16 @@
@Override
public void start(Deployment dep)
{
+ if (!isJaxrpcDeployment(dep)) return;
UnifiedMetaData umd = dep.getAttachment(UnifiedMetaData.class);
if (umd == null)
{
- if (isJaxrpcJseDeployment(dep) && !isJaxwsDeployment(dep))
+ if (isJaxrpcJseDeployment(dep))
{
JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
umd = builder.buildMetaData((ArchiveDeployment)dep);
}
- else if (isJaxrpcEjbDeployment(dep) && !isJaxwsDeployment(dep))
+ else if (isJaxrpcEjbDeployment(dep))
{
JAXRPCServerMetaDataBuilder builder = new JAXRPCServerMetaDataBuilder();
umd = builder.buildMetaData((ArchiveDeployment)dep);
12 years, 3 months