Author: alessio.soldano(a)jboss.com
Date: 2012-10-10 13:36:19 -0400 (Wed, 10 Oct 2012)
New Revision: 16833
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties
Modified:
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
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/JavaToXSD.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/SecurityActions.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/BufferedStreamSource.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/AbstractEndpointServlet.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EagerInitializeDeploymentAspect.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeInstanceProvider.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/SecurityActions.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
Log:
[JBWS-3509] WIP on convertin native messages to new logging...
Modified: 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 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeLoggers.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -28,6 +28,8 @@
import static org.jboss.logging.Logger.Level.WARN;
import java.net.URL;
+import java.util.Collection;
+import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.rpc.handler.HandlerInfo;
@@ -72,4 +74,40 @@
@Message(id = 25017, value = "SOAP request exception")
void soapRequestException(@Cause Throwable cause);
+ @LogMessage(level = WARN)
+ @Message(id = 25022, value = "Failed to create inputstream from systemId:
%s")
+ void failedToCreateInputStreamFromSystemID(String systemId);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25027, value = "JAX-RPC schema mapping does not allow collection
types, skipping field: %s.%s")
+ void jaxrpcNotAllowCollectionSkippingFieldInSchemaMapping(String type, String
field);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25028, value = "Indexed properties without non-indexed accessors
are not supported, skipping: %s.%s")
+ void indexedPropNotSupportedSkippingInSchemaMapping(String type, String field);
+
+ @LogMessage(level = ERROR)
+ @Message(id = 25043, value = "%s is not a valid url")
+ void notAValidUrl(String s);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25059, value = "WSDL parsing, unsupported fault message part in
message: %s")
+ void unsupportedFaultMessagePartInMessage(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25060, value = "WSDL parsing, unsupported binding: %s")
+ void unsupportedBinding(QName qname);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25061, value = "WSDL parsing, encoding style %s not supported for:
%s")
+ void encodingStyleNotSupported(String s, QName q);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25062, value = "WSDL parsing, multiple encoding styles not
supported: %s")
+ void multipleEncodingStyleNotSupported(Collection<?> list);
+
+ @LogMessage(level = WARN)
+ @Message(id = 25063, value = "WSDL parsing, unprocessed extension element:
%s")
+ void unprocessedWSDLExtensionElement(QName el);
+
}
Modified: 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 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/NativeMessages.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -22,16 +22,19 @@
package org.jboss.ws;
import java.io.File;
+import java.net.URL;
+import java.util.Collection;
import javax.management.ObjectName;
+import javax.wsdl.Part;
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.ws.metadata.wsdl.WSDLException;
import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
/**
* JBossWS-CXF exception messages
@@ -53,7 +56,7 @@
IllegalStateException deploymentHasNoClassLoaderAssociated(Deployment dep);
@Message(id = 25003, value = "Cannot obtain endpoint meta data for endpoint
%s")
- IllegalStateException cannotObtainEndpointMetaData(ObjectName epName);
+ IllegalStateException cannotObtainEndpointMetaData(Object epName);
@Message(id = 25004, value = "Cannot obtain SOAPPart from response
message")
SOAPException cannotObtainSoapPart();
@@ -79,4 +82,124 @@
@Message(id = 25014, value = "Invalid wsdlFile %s, expected in: %s")
RuntimeException invalidWsdlFile(String wsdlLocation, String expLocation);
+ @Message(id = 25018, value = "Cannot obtain unified meta data for deployment:
%s")
+ IllegalStateException cannotObtainUnifiedMetaData(Deployment dep);
+
+ @Message(id = 25019, value = "Missing runtime classloader for deployment:
%s")
+ IllegalStateException missingRuntimeClassLoader(Deployment dep);
+
+ @Message(id = 25020, value = "Cannot load class: %s")
+ WSException cannotLoadClass(String className, @Cause Throwable cause);
+
+ @Message(id = 25021, value = "Cannot obtain endpoint for: %s")
+ WSException cannotObtainEndpoint(ObjectName oname);
+
+ @Message(id = 25023, value = "Schema mapping, %s argument is null")
+ IllegalArgumentException illegalNullArgumentInSchemaMapping(String argument);
+
+ @Message(id = 25024, value = "Schema mapping, unsupported type %s")
+ IllegalArgumentException unsupportedTypeInSchemaMapping(QName type);
+
+ @Message(id = 25025, value = "Schema mapping, problem in introspection of the
Java Type during type generation")
+ WSException introspectionProblemInSchemaMapping(@Cause Throwable cause);
+
+ @Message(id = 25026, value = "Schema mapping, JAX-RPC Enumeration type did not
conform to expectations")
+ WSException notConformToExpectationInSchemaMapping(@Cause Throwable cause);
+
+ @Message(id = 25029, value = "Schema mapping, class %s has a public field &
property %s")
+ WSException classHasPublicFieldPropertyInSchemaMapping(String clazz, String field);
+
+ @Message(id = 25030, value = "Schema mapping, cannot determine namespace, class
%s has no package")
+ WSException cannotDeterminNamespaceInSchemaMapping(Class<?> clazz);
+
+ @Message(id = 25031, value = "Schema mapping, type %s is not an
exception")
+ IllegalArgumentException typeIsNotAnExceptionInSchemaMapping(Class<?> clazz);
+
+ @Message(id = 25032, value = "Schema mapping, JAXRPC violation, exception %s
cannot extend RuntimeException")
+ IllegalArgumentException
jaxrpcExceptionExtendingRuntimeExcViolationInSchemaMapping(Class<?> clazz);
+
+ @Message(id = 25033, value = "Schema mapping, could not locate a constructor
with the following types: %s %s")
+ IllegalArgumentException couldNotLocateConstructorInSchemaMapping(Class<?>
clazz, Collection<Class<?>> types);
+
+ @Message(id = 25034, value = "Cannot load schema: %s")
+ WSException cannotLoadSchema(URL url);
+
+ @Message(id = 25035, value = "Cannot load grammar: %s")
+ IllegalStateException cannotLoadGrammar(URL url);
+
+ @Message(id = 25036, value = "Java to XSD, missing schema location map")
+ IllegalArgumentException javaToXSDMissingSchemaLocationMap();
+
+ @Message(id = 25037, value = "WSDL definitions is null")
+ IllegalArgumentException wsdlDefinitionIsNull();
+
+ @Message(id = 25038, value = "WSDL file argument cannot be null")
+ IllegalArgumentException wsdlFileArgumentCannotBeNull();
+
+ @Message(id = 25039, value = "Cannot obtain wsdl from %s")
+ IllegalArgumentException cannotObtainWsdlFrom(URL location);
+
+ @Message(id = 25040, value = "Cannot access wsdl from %s")
+ RuntimeException cannotAccessWsdlFrom(URL location, @Cause Throwable cause);
+
+ @Message(id = 25041, value = "Cannot resolve imported resource: %s")
+ IllegalArgumentException cannotResolveImportedResource(String res);
+
+ @Message(id = 25042, value = "Cannot access imported wsdl: %s")
+ WSException cannotAccessImportedWsdl(String wsdl, @Cause Throwable cause);
+
+ @Message(id = 25044, value = "Cannot parse WSDL with null url")
+ IllegalArgumentException cannotParsedWsdlWithNullURL();
+
+ @Message(id = 25045, value = "Cannot parse wsdl from %s")
+ WSDLException cannotParseWsdlFrom(URL location, @Cause Throwable cause);
+
+ @Message(id = 25046, value = "Invalid default WSDL namespace: %s")
+ WSDLException invalidDefaultWSDLNamespace(String ns);
+
+ @Message(id = 25047, value = "Prefix not bound for namespace: %s")
+ WSException prefixNotBound(String namespaceURI);
+
+ @Message(id = 25048, value = "WSDL 1.1 only supports In-Only, and In-Out MEPS,
more than one reference input found")
+ IllegalArgumentException wsd11MultipleRefInput();
+
+ @Message(id = 25049, value = "WSDL Style is null (should be rpc or
document)")
+ IllegalArgumentException wsdlStyleNull();
+
+ @Message(id = 25051, value = "WSDL interface is null")
+ IllegalArgumentException wsdlInterfaceNull();
+
+ @Message(id = 25052, value = "WSDl 1.1 only supports In-Only, and In-Out
MEPS")
+ WSException wsd11UnsupportedMEP();
+
+ @Message(id = 25053, value = "Unsuported schema element in %s: %s")
+ IllegalArgumentException unsupportedSchemaElement(URL location, String el);
+
+ @Message(id = 25054, value = "Cannot process wsdl import, parent location not
set")
+ IllegalArgumentException cannotProcessImportParentLocationSetToNull();
+
+ @Message(id = 25055, value = "schemaLocation is null for xsd:import")
+ IllegalArgumentException xsdImportNullSchemaLocation();
+
+ @Message(id = 25056, value = "Cannot process include, parent location not
set")
+ IllegalArgumentException cannotProcessIncludeParentLocationSetToNull();
+
+ @Message(id = 25057, value = "schemaLocation is null for xsd:include")
+ IllegalArgumentException xsdIncludeNullSchemaLocation();
+
+ @Message(id = 25058, value = "Cannot name for wsdl part: %s")
+ IllegalStateException cannotFindNameForWSDLPart(Part part);
+
+ @Message(id = 25064, value = "Feature name must not be null")
+ IllegalArgumentException featureNameMustNotBeNull();
+
+ @Message(id = 25065, value = "Feature name not recognized: %s")
+ IllegalArgumentException featureNameNotRecognized(String name);
+
+ @Message(id = 25066, value = "Java to XSD, %s is null")
+ IllegalArgumentException javaToXSDIsNull(String name);
+
+ @Message(id = 25067, value = "Unsupported WSDL version: %s")
+ WSException unsupportedWSDLVersion(String version);
+
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/JavaToXSD.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/JavaToXSD.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -27,7 +27,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
@@ -37,8 +36,7 @@
import org.apache.xerces.xni.parser.XMLInputSource;
import org.apache.xerces.xs.XSModel;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.common.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
@@ -73,7 +71,6 @@
*/
public class JavaToXSD implements JavaToXSDIntf
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(JavaToXSD.class);
// provide logging
private static final Logger log = Logger.getLogger(JavaToXSD.class);
@@ -98,14 +95,14 @@
/*
* @see org.jboss.ws.tools.interfaces.JavaToXSDIntf#generateForSingleType()
*/
- public JBossXSModel generateForSingleType(QName xmlType, Class javaType) throws
IOException
+ public JBossXSModel generateForSingleType(QName xmlType,
@SuppressWarnings("rawtypes") Class javaType) throws IOException
{
SchemaCreatorIntf creator = helper.getSchemaCreator();
creator.generateType(xmlType, javaType);
return creator.getXSModel();
}
- public JBossXSModel generateForSingleType(QName xmlType, Class javaType,
Map<String, QName> elementNames) throws IOException
+ public JBossXSModel generateForSingleType(QName xmlType,
@SuppressWarnings("rawtypes") Class javaType, Map<String, QName>
elementNames) throws IOException
{
SchemaCreatorIntf creator = helper.getSchemaCreator();
creator.generateType(xmlType, javaType, elementNames);
@@ -134,7 +131,7 @@
XSModel xsmodel = loader.loadURI(xsdURL.toExternalForm());
if (xsmodel == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_SCHEMA", xsdURL));
+ throw NativeMessages.MESSAGES.cannotLoadSchema(xsdURL);
WSSchemaUtils sutils = WSSchemaUtils.getInstance(null, null);
JBossXSModel jbxs = new JBossXSModel();
@@ -150,7 +147,7 @@
public JBossXSModel parseSchema(Map<String, URL> locs)
{
if (locs == null || locs.size() == 0)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ILLEGAL_SCHEMA_LOCATION_MAP"));
+ throw NativeMessages.MESSAGES.javaToXSDMissingSchemaLocationMap();
JBossXSErrorHandler xserr = new JBossXSErrorHandler();
JBossWSEntityResolver resolver = new JBossWSEntityResolver();
@@ -168,7 +165,7 @@
{
String nsURI = it.next();
URL orgURL = locs.get(nsURI);
- URL resURL = resolveNamespaceURI(resolver, nsURI);
+ URL resURL = resolveNamespaceURI(nsURI);
URL url = resURL != null ? resURL : orgURL;
if (debugEnabled)
@@ -181,7 +178,7 @@
SchemaGrammar grammar = (SchemaGrammar)loader.loadGrammar(inputSource);
if (grammar == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_GRAMMAR", url));
+ throw NativeMessages.MESSAGES.cannotLoadGrammar(url);
gs[index++] = grammar;
}
@@ -191,7 +188,7 @@
}
catch (Exception ex)
{
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_PARSE_SCHEMA"), ex);
+ throw new IllegalStateException(ex);
}
finally
{
@@ -218,11 +215,11 @@
return jbxs;
}
- private URL resolveNamespaceURI(JBossWSEntityResolver resolver, String nsURI)
+ private URL resolveNamespaceURI(String nsURI)
{
URL url = null;
- String resource = (String)resolver.getEntityMap().get(nsURI);
+ String resource = (String)JBossWSEntityResolver.getEntityMap().get(nsURI);
if (resource != null)
{
ClassLoader loader = SecurityActions.getContextClassLoader();
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/Message.properties 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1,55 +0,0 @@
-ILLEGAL_NULL_ARGUMENT=Illegal null argument:{0}
-FEATURE_NOT_RECOGNIZED=Feature:{0} not recognized
-INTERFACE_NO_OPERATIONS=Interface {0} doesn't have operations
-JAXRPC_CAN_NOT_UNWRAP_MUTLIPLE_INPUTS=[JAX-RPC - 2.3.1.2] Can not unwrap parameters for
operation with mutliple inputs. inputs={0}
-WRAPPER_ELEMENT_MUST_MATCH=wrapper element name must match operation name.
operationName={0} elementName={1}
-COMPLEX_TYPE_CONTAINS_ATTRIBUTES=[JAX-RPC 2.3.1.2] Can not unwrap, complex type contains
attributes.
-INTERFACES_CANNOT_BE_ZERO=Interfaces cannot be zero
-TYPEMAPPING_HAS_NOT_BEEN_SET=TypeMapping has not been set
-
-ERROR_SETTING_CONTEXT_CLASSLOADER=Error setting context classloader
-ERROR_RUNNING_PRIVILEGED_ACTION=Error running privileged action
-UNSUPPORTED_WSDL_VERSION=Unsupported wsdl version: {0}
-FEATURE_VALUE_NOT_AVAILABLE=Feature value not available: {0}
-TYPEMAPPING_HAS_NOT_BEEN_GENERATED=TypeMapping has not been generated
-CANNOT_GENERATE_WSDL_DEFINITIONS=Cannot generate WSDL definitions
-CANNOT_GENERATE_WSDL=Cannot generate WSDL
-CANNOT_GENERATE_WSDL_FROM=Cannot generate wsdl from: {0}
-COULD_NOT_UNMARSHAL_DESCRIPTOR=Could not unmarshal existing webservices descriptor: {0}
-
-SERVICENAME_IS_NULL=serviceName is null
-WSDLFILE_IS_NULL=wsdlFile is null
-MAPPINGFILE_IS_NULL=mappingFile is null
-TARGETNAMESPACE_IS_NULL=targetNamespace is null
-PORTNAME_IS_NULL=portName is null
-SEINAME_IS_NULL=seiName is null
-EITHER_SERVLETLINK_OR_EJBLINK_SHOULD_NOT_BE_NULL=Either servletLink or ejbLink should not
be null
-ONE_OF_SERVLETLINK_OR_EJBLINK_SHOULD_BE_NULL=One of servletLink or ejbLink should be
null
-
-TYPEMAPPING_HAS_NOT_BEEN_SET=TypeMapping has not been set
-FILE_NAME_IS_NULL=File Name is null
-TYPEMAPPING_HAS_NOT_BEEN_SET=TypeMapping has not been set
-UNHANDLED_TYPE=Unhandled Type
-CONFIGURATION_IS_NULL=Configuration is null
-CONFIGURATION_ERROR=Nothing done, Configuration source must have JavaToWSDL or WSDLToJava
specified
-CANNOT_INSTANTIATE_TOOLSUTILS=Cannot instantiate ToolsUtils.
-METHOD_PARAM_SHOULDN_NOT_EXTEND_REMOTE=JAXWS-2.0 Assertion:Method param shouldn't
extend Remote
-
-
-
-STRING_PASSED_IS_NULL=String passed is null
-XMLNAME_IS_NULL=xmlName is null
-ILLEGAL_JAVABEAN_ARGUMENT=Illegal JavaBean argument
-STR_IS_NULL=Str is null
-TARGETNS_SHOULD_START_WITH=TargetNS should start with http:// / https:// / urn:
-FEATURE_UNRECOGNIZED=Feature unrecognized
-TYPEMAPPING_HAS_NOT_BEEN_GENERATED=TypeMapping has not been generated
-ERROR_DURING_GENERATION=Error during Java->WSDL generation:
-UNIFIED_META_DATA_MODEL_IS_NULL=Unified Meta Data Model is null
-UNABLE_TO_CREATE_JAX_RPC_HOLDER=Unable to create JAX-RPC holder.
-CANNOT_LOAD_SCHEMA=Cannot load schema: {0}
-ILLEGAL_SCHEMA_LOCATION_MAP=Illegal schema location map
-CANNOT_LOAD_GRAMMAR=Cannot load grammar: {0}
-CANNOT_PARSE_SCHEMA=Cannot parse schema
-=
-FEATURE_UNRECOGNIZED=Feature unrecognized
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/SecurityActions.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/SecurityActions.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/SecurityActions.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -26,10 +26,7 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-
/**
* Security actions for this package
*
@@ -39,7 +36,6 @@
*/
class SecurityActions
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SecurityActions.class);
/**
* Get context classloader.
*
@@ -103,14 +99,14 @@
}
catch (Throwable e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"ERROR_SETTING_CONTEXT_CLASSLOADER"), e);
+ throw new RuntimeException(e);
}
}
});
}
catch (PrivilegedActionException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"ERROR_RUNNING_PRIVILEGED_ACTION"), e);
+ throw new RuntimeException(e);
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/JavaToXSDHelper.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -22,12 +22,11 @@
package org.jboss.ws.tools.helpers;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.apache.xerces.xs.XSModel;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.metadata.wsdl.WSDLUtils;
import org.jboss.ws.metadata.wsdl.xmlschema.JBossXSModel;
@@ -42,7 +41,6 @@
*/
public class JavaToXSDHelper
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JavaToXSDHelper.class);
protected WSDLUtils utils = WSDLUtils.getInstance();
protected SchemaUtils schemautils = SchemaUtils.getInstance();
private SchemaCreatorIntf creator = null;
@@ -68,7 +66,7 @@
String targetNamespace)
{
if(targetNamespace == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"IS_NULL", "targetNamespace"));
+ throw NativeMessages.MESSAGES.javaToXSDIsNull("targetNamespace");
XSModel xsmodel = creator.getXSModel();
if(xsmodel == null) creator.setXSModel(new JBossXSModel());
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/Message.properties 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/helpers/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1,16 +0,0 @@
-IS_NULL = {0} is null
-UNRECOGNIZED_STYLE=Unrecognized Style:{0}
-UNRECOGNIZED_PARAMETER_STYLE=Unrecognized Parameter Style:{0}
-ENDPOINT_CANNOT_BE_LOADED=Endpoint {0} cannot be loaded
-COULD_NOT_FIND_ENDPOINT_IN_METADATA=Could not find endpoint in metadata: {0}
-MISSING_A_WRAPPER_TYPE=JAX-RPC mapping metadata is missing a wrapper type: {0}
-CANNOT_LOAD_WSDL=Cannot load wsdl: {0}
-CANNOT_LOAD_ENDPOINT=Cannot load endpoint:{0}
-RPC_ENDPOINTS_REQUIRE_INPUT_MESSAGE=RPC endpoints require an input message
-TRIED_TO_UNWRAP=Tried to unwrap a non-complex type.
-TYPEMAPPING_IS_NULL=typeMapping is null
-SPECIFY_A_FILENAME=Please specify a filename
-UNWRAP_NON_COMPLEX_TYPE=[JAX-RPC 2.3.1.2] Tried to unwrap a non-complex type.
-CAN_NOT_UNWRAP=[JAX-RPC 2.3.1.2] Can not unwrap, complex type contains attributes.
-EXPECTED_MODEL_GROUP=[JAX-RPC 2.3.1.2] Expected model group, could not unwrap
-UNABLE_TO_UNWRAP_MODEL=[JAX-RPC 2.3.1.2] Unable to unwrap model group with multiple
particles.
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/Message.properties 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1,12 +0,0 @@
-ILLEGAL_NULL_ARGUMENT=Illegal Null Argument:{0}
-UNSUPPORTED_TYPE=Unsupported type: {0}
-PROBLEM_IN_INTROSPECTION=Problem in introspection of the Java Type during type
generation
-NOT_CONFORM_TO_EXPECTATIONS=JAX-RPC Enumeration type did not conform to expectations
-JAX_RPC_NOT_ALLOW_SKIPPING_FIELD=JAX-RPC does not allow collection types skipping field:
{0} {1}
-NOT_SUPPORTED_SKIPPING=Indexed Properties without non-indexed accessors are not supported
skipping: {0}{1}
-JAX-RPC_NOT_ALLOW_TYPES_SKIPPING=JAX-RPC does not allow collection types skipping:
{0}{1}
-CLASS_HAS_PUBLIC_FIELD_PROPERTY=Class {0} has a public field & property :{1}
-CANNOT_DETERMINE_NAMESPACE=Cannot determine namespace, Class had no package
-TYPE_IS_NOT_AN_EXCPETION=Type is not an excpetion
-JAX_RPC_VIOLATION=JAX-RPC violation, the following exception extends RuntimeException:
{0}
-COULD_NOT_LOCATE_CONSTRUCTOR=Could not locate a constructor with the following types:
{0}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/schema/SchemaTypeCreator.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.tools.schema;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.beans.BeanInfo;
import java.beans.IndexedPropertyDescriptor;
import java.beans.IntrospectionException;
@@ -37,7 +39,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.TreeMap;
import javax.ejb.SessionBean;
@@ -52,8 +53,7 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
@@ -82,7 +82,6 @@
*/
public class SchemaTypeCreator implements SchemaCreatorIntf
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SchemaTypeCreator.class);
protected Logger log = Logger.getLogger(SchemaTypeCreator.class);
protected WSDLUtils utils = WSDLUtils.getInstance();
@@ -98,8 +97,6 @@
protected String xsNS = Constants.NS_SCHEMA_XSD;
- private int maxPrefix = 1;
-
protected JBossXSModel xsModel = null;
//A Map of custom package->namespace mapping provided by the user
@@ -119,24 +116,24 @@
public void addPackageNamespaceMapping(String pkgname, String ns)
{
if (pkgname == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ILLEGAL_NULL_ARGUMENT", "pkgname"));
+ throw MESSAGES.illegalNullArgumentInSchemaMapping("pkgname");
if (ns == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ILLEGAL_NULL_ARGUMENT", "ns"));
+ throw MESSAGES.illegalNullArgumentInSchemaMapping("ns");
packageNamespaceMap.put(pkgname, ns);
}
- public JBossXSTypeDefinition generateType(QName xmlType, Class javaType)
+ public JBossXSTypeDefinition generateType(QName xmlType,
@SuppressWarnings("rawtypes") Class javaType)
{
return generateType(xmlType, javaType, null);
}
- public JBossXSTypeDefinition generateType(QName xmlType, Class javaType,
Map<String, QName> elementNames)
+ public JBossXSTypeDefinition generateType(QName xmlType,
@SuppressWarnings("rawtypes") Class javaType, Map<String, QName>
elementNames)
{
return getType(xmlType, javaType, elementNames);
}
- public QName getXMLSchemaType(Class javaType)
+ public QName getXMLSchemaType(@SuppressWarnings("rawtypes") Class javaType)
{
QName xmlt = schemautils.getToolsOverrideInTypeMapping(javaType);
//Check if it is already registered
@@ -161,12 +158,12 @@
/* (non-Javadoc)
* @see org.jboss.ws.tools.schema.SchemaCreatorIntf#getCustomNamespaceMap()
*/
- public HashMap getCustomNamespaceMap()
+ public HashMap<String,String> getCustomNamespaceMap()
{
HashMap<String, String> map = null;
if (namespaces != null)
{
- Iterator iter = namespaces.getRegisteredPrefixes();
+ Iterator<?> iter = namespaces.getRegisteredPrefixes();
while (iter != null && iter.hasNext())
{
String prefix = (String)iter.next();
@@ -200,11 +197,11 @@
/* (non-Javadoc)
* @see
org.jboss.ws.tools.schema.SchemaCreatorIntf#getJavaType(javax.xml.namespace.QName)
*/
- public Class getJavaType(QName xmlType)
+ public Class<?> getJavaType(QName xmlType)
{
- Class retType = typeMapping.getJavaType(xmlType);
+ Class<?> retType = typeMapping.getJavaType(xmlType);
if (retType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_TYPE", xmlType));
+ throw MESSAGES.unsupportedTypeInSchemaMapping(xmlType);
return retType;
}
@@ -245,7 +242,7 @@
return ct;
}
- private JBossXSTypeDefinition getType(QName xmlType, Class javaType, Map<String,
QName> elementNames)
+ private JBossXSTypeDefinition getType(QName xmlType, Class<?> javaType,
Map<String, QName> elementNames)
{
JBossXSTypeDefinition ct = null;
boolean registered = false;
@@ -284,10 +281,10 @@
return (JBossXSTypeDefinition)xsModel.getTypeDefinition(qname.getLocalPart(),
qname.getNamespaceURI());
}
- private JBossXSTypeDefinition generateNewType(QName xmlType, Class javaType,
Map<String, QName> elementNames)
+ private JBossXSTypeDefinition generateNewType(QName xmlType, Class<?> javaType,
Map<String, QName> elementNames)
{
//Step 1: Take care of superclass (if any)::Generate Type for the base class, if
any
- Class superclass = javaType.getSuperclass();
+ Class<?> superclass = javaType.getSuperclass();
JBossXSTypeDefinition baseType = null;
List<XSParticle> particles = new ArrayList<XSParticle>();
if (superclass != null && !utils.checkIgnoreClass(superclass))
@@ -316,7 +313,7 @@
}
// Check if it is a JAX-RPC enumeration
- Class valueType = getEnumerationValueType(javaType);
+ Class<?> valueType = getEnumerationValueType(javaType);
if (valueType != null)
return handleJAXRPCEnumeration(name, namespace, javaType, valueType);
@@ -337,8 +334,7 @@
}
catch (IntrospectionException e)
{
- log.error(BundleUtils.getMessage(bundle, "PROBLEM_IN_INTROSPECTION"),
e);
- throw new WSException(e);
+ throw MESSAGES.introspectionProblemInSchemaMapping(e);
}
if (elementNames instanceof LinkedHashMap)
@@ -377,7 +373,7 @@
}
catch (Exception e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"NOT_CONFORM_TO_EXPECTATIONS"));
+ throw MESSAGES.notConformToExpectationInSchemaMapping(e);
}
xsModel.addXSTypeDefinition(simpleType);
@@ -386,7 +382,7 @@
return simpleType;
}
- private Class<?> getEnumerationValueType(Class javaType)
+ private Class<?> getEnumerationValueType(Class<?> javaType)
{
try
{
@@ -438,7 +434,7 @@
return newList;
}
- private void registerJavaTypeMapping(QName registerQName, Class javaType, String
scope, List<XSParticle> particles, Map<String, QName> elementNames)
+ private void registerJavaTypeMapping(QName registerQName, Class<?> javaType,
String scope, List<XSParticle> particles, Map<String, QName> elementNames)
{
QName qname = new QName(registerQName.getNamespaceURI(),
registerQName.getLocalPart(), "typeNS");
@@ -471,7 +467,7 @@
javaWsdlMapping.addJavaXmlTypeMappings(javaXmlTypeMapping);
}
- private void addVariableMappings(Class javaType, JavaXmlTypeMapping
javaXmlTypeMapping, List<XSParticle> particles, Map<String, String>
reversedNames)
+ private void addVariableMappings(Class<?> javaType, JavaXmlTypeMapping
javaXmlTypeMapping, List<XSParticle> particles, Map<String, String>
reversedNames)
{
for (XSParticle particle : particles)
{
@@ -536,7 +532,7 @@
return false;
}
- private List<XSParticle> getXSParticlesForPublicFields(String typeNamespace,
Class javaType, Map<String, QName> elementNames)
+ private List<XSParticle> getXSParticlesForPublicFields(String typeNamespace,
Class<?> javaType, Map<String, QName> elementNames)
{
List<XSParticle> particles = new ArrayList<XSParticle>();
@@ -545,7 +541,7 @@
// Skip collections
if (Collection.class.isAssignableFrom(field.getType()))
{
- log.warn(BundleUtils.getMessage(bundle,
"JAX_RPC_NOT_ALLOW_SKIPPING_FIELD", new Object[]{ javaType.getName(),
field.getName()}));
+
NativeLoggers.ROOT_LOGGER.jaxrpcNotAllowCollectionSkippingFieldInSchemaMapping(javaType.getName(),
field.getName());
continue;
}
@@ -556,9 +552,9 @@
return particles;
}
- private JBossXSTypeDefinition handleArray(QName xmlType, Class javaType)
+ private JBossXSTypeDefinition handleArray(QName xmlType, Class<?> javaType)
{
- Class componentType = javaType.getComponentType();
+ Class<?> componentType = javaType.getComponentType();
boolean isComponentArray = componentType.isArray();
// Do not allow overrides i.e. byte[][] should not be base64Binary[]
@@ -576,7 +572,7 @@
{
if (isComponentArray == false)
{
- name = utils.getJustClassName(componentType.getName()) + ".Array";
+ name = WSDLUtils.getJustClassName(componentType.getName()) +
".Array";
namespace = getNamespace(componentType, null);
}
else
@@ -599,11 +595,11 @@
return complex;
}
- private List<XSParticle> introspectJavaProperties(String typeNamespace, Class
javaType, Map<String, QName> elementNames) throws IntrospectionException
+ private List<XSParticle> introspectJavaProperties(String typeNamespace,
Class<?> javaType, Map<String, QName> elementNames) throws
IntrospectionException
{
List<XSParticle> xsparts = new ArrayList<XSParticle>();
- Class superClass = javaType.getSuperclass();
+ Class<?> superClass = javaType.getSuperclass();
BeanInfo beanInfo = Introspector.getBeanInfo(javaType, superClass);
PropertyDescriptor[] props = beanInfo.getPropertyDescriptors();
int len = props != null ? props.length : 0;
@@ -612,11 +608,11 @@
{
PropertyDescriptor prop = props[i];
String fieldname = prop.getName();
- Class fieldType = prop.getPropertyType();
+ Class<?> fieldType = prop.getPropertyType();
if (prop instanceof IndexedPropertyDescriptor && fieldType == null)
{
- log.warn(BundleUtils.getMessage(bundle, "NOT_SUPPORTED_SKIPPING",
new Object[]{ javaType.getName(), fieldname}));
+
NativeLoggers.ROOT_LOGGER.indexedPropNotSupportedSkippingInSchemaMapping(javaType.getName(),
fieldname);
continue;
}
@@ -627,13 +623,13 @@
// Skip collections
if (Collection.class.isAssignableFrom(fieldType))
{
- log.warn(BundleUtils.getMessage(bundle,
"JAX-RPC_NOT_ALLOW_TYPES_SKIPPING", new Object[]{ javaType.getName(),
fieldname}));
+
NativeLoggers.ROOT_LOGGER.jaxrpcNotAllowCollectionSkippingFieldInSchemaMapping(javaType.getName(),
fieldname);
continue;
}
//Check if the property conflicts with a public member variable
if (utils.doesPublicFieldExist(javaType, fieldname))
- throw new WSException(BundleUtils.getMessage(bundle,
"CLASS_HAS_PUBLIC_FIELD_PROPERTY", new Object[]{javaType.getName(),
fieldname}));
+ throw MESSAGES.classHasPublicFieldPropertyInSchemaMapping(javaType.getName(),
fieldname);
JBossXSParticle particle = createFieldParticle(typeNamespace, fieldname,
fieldType, elementNames);
xsparts.add(particle);
@@ -642,7 +638,7 @@
return xsparts;
}
- private JBossXSParticle createFieldParticle(String typeNamespace, String fieldName,
Class fieldType, Map<String, QName> elementNames)
+ private JBossXSParticle createFieldParticle(String typeNamespace, String fieldName,
Class<?> fieldType, Map<String, QName> elementNames)
{
// There should be some override mechanism, but we want byte[] to resolve to
base64binary (the default)
boolean isArray = fieldType.isArray() && fieldType != byte[].class;
@@ -683,10 +679,10 @@
return particle;
}
- private void addBaseTypeParts(XSTypeDefinition baseType, List xsparts)
+ private void addBaseTypeParts(XSTypeDefinition baseType, List<XSParticle>
xsparts)
{
if (baseType == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"ILLEGAL_NULL_ARGUMENT", "baseType"));
+ throw MESSAGES.illegalNullArgumentInSchemaMapping("baseType");
if (XSTypeDefinition.COMPLEX_TYPE == baseType.getTypeCategory())
{
XSTypeDefinition btype = baseType.getBaseType();
@@ -704,7 +700,7 @@
}
}
- private String getNamespace(Class javaType, String defaultNS)
+ private String getNamespace(Class<?> javaType, String defaultNS)
{
String retNS = defaultNS;
if (javaType.isPrimitive() && retNS == null)
@@ -729,25 +725,25 @@
}
else if (retNS == null)
{
- retNS = utils.getTypeNamespace(packageName);
+ retNS = WSDLUtils.getTypeNamespace(packageName);
}
allocatePrefix(retNS);
}
else if (retNS == null)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_DETERMINE_NAMESPACE"));
+ throw MESSAGES.cannotDeterminNamespaceInSchemaMapping(javaType);
}
}
return retNS;
}
- private JBossXSComplexTypeDefinition getComplexTypeForJavaException(QName xmlType,
Class javaType)
+ private JBossXSComplexTypeDefinition getComplexTypeForJavaException(QName xmlType,
Class<?> javaType)
{
if (!Exception.class.isAssignableFrom(javaType))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"TYPE_IS_NOT_AN_EXCPETION"));
+ throw MESSAGES.typeIsNotAnExceptionInSchemaMapping(javaType);
if (RuntimeException.class.isAssignableFrom(javaType))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"JAX_RPC_VIOLATION", javaType.getName()));
+ throw
MESSAGES.jaxrpcExceptionExtendingRuntimeExcViolationInSchemaMapping(javaType);
String name;
String namespace;
@@ -763,7 +759,7 @@
}
List<XSParticle> particles = new ArrayList<XSParticle>(0);
- List<Class> types = new ArrayList<Class>(0);
+ List<Class<?>> types = new ArrayList<Class<?>>(0);
JBossXSComplexTypeDefinition complexType = new JBossXSComplexTypeDefinition();
complexType.setName(name);
complexType.setNamespace(namespace);
@@ -775,7 +771,7 @@
registerJavaTypeMapping(new QName(namespace, name), javaType,
"complexType", particles, null);
- Class superClass = javaType.getSuperclass();
+ Class<?> superClass = javaType.getSuperclass();
if (!Exception.class.equals(superClass) || Throwable.class.equals(superClass))
{
JBossXSTypeDefinition baseType = generateType(null, superClass);
@@ -790,7 +786,7 @@
{
// Look for a message constructor if a matching constructor could not be found.
// We also prefer message constructors over a noarg constructor
- ArrayList<Class> newTypes = new ArrayList<Class>(types);
+ ArrayList<Class<?>> newTypes = new
ArrayList<Class<?>>(types);
newTypes.add(0, String.class);
found = hasConstructor(javaType, newTypes);
if (found)
@@ -801,7 +797,7 @@
{
// If we have a default (0 argument) constructor, fall back to it
if (!noarg)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"COULD_NOT_LOCATE_CONSTRUCTOR", javaType));
+ throw MESSAGES.couldNotLocateConstructorInSchemaMapping(javaType, types);
}
}
@@ -810,7 +806,7 @@
return complexType;
}
- private void insertBaseParticle(List<XSParticle> particles, String name, Class
type, String targetNS)
+ private void insertBaseParticle(List<XSParticle> particles, String name,
Class<?> type, String targetNS)
{
if (particles.size() == 0)
{
@@ -839,7 +835,7 @@
}
}
- private boolean hasConstructor(Class javaType, List<Class> types)
+ private boolean hasConstructor(Class<?> javaType, List<Class<?>>
types)
{
boolean found = true;
@@ -855,7 +851,7 @@
return found;
}
- private void generateExceptionParticles(String typeNamespace, Class javaType,
List<Class> types, List<XSParticle> particles)
+ private void generateExceptionParticles(String typeNamespace, Class<?> javaType,
List<Class<?>> types, List<XSParticle> particles)
{
/*
* JAX-RPC 1.1 states that properties of an exception are determined by
@@ -874,7 +870,7 @@
if (Exception.class.equals(javaType))
return;
- Class superClass = javaType.getSuperclass();
+ Class<?> superClass = javaType.getSuperclass();
if (!Exception.class.equals(superClass))
{
List<XSParticle> superParticles = new ArrayList<XSParticle>(0);
@@ -882,7 +878,7 @@
particles.add(createGroupParticle(typeNamespace, superParticles));
}
- TreeMap<String, Class> sortedGetters = new TreeMap<String, Class>();
+ TreeMap<String, Class<?>> sortedGetters = new TreeMap<String,
Class<?>>();
for (Method method : javaType.getDeclaredMethods())
{
int modifiers = method.getModifiers();
@@ -890,7 +886,7 @@
continue;
String name = method.getName();
- Class returnType = method.getReturnType();
+ Class<?> returnType = method.getReturnType();
if (name.startsWith("get") && returnType != void.class)
{
name = Introspector.decapitalize(name.substring(3));
@@ -900,7 +896,7 @@
for (String name : sortedGetters.keySet())
{
- Class type = sortedGetters.get(name);
+ Class<?> type = sortedGetters.get(name);
types.add(type);
JBossXSParticle particle = createFieldParticle(typeNamespace, name, type,
null);
particles.add(particle);
@@ -917,7 +913,7 @@
return groupParticle;
}
- private JBossXSParticle getXSParticle(String name, Class fieldType, String targetNS)
+ private JBossXSParticle getXSParticle(String name, Class<?> fieldType, String
targetNS)
{
XSTypeDefinition xstype = null;
boolean isArray = fieldType.isArray();
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -31,7 +31,6 @@
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Vector;
import javax.wsdl.Binding;
@@ -67,7 +66,7 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -91,7 +90,6 @@
*/
public class JBossWSDLReaderImpl implements WSDLReader
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(JBossWSDLReaderImpl.class);
// Used for determining the style of operations.
private static final List STYLE_ONE_WAY =
Arrays.asList(new String[]{Constants.ELEM_INPUT});
@@ -154,7 +152,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"FEATURE_NAME_MUST_NOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.featureNameMustNotBeNull();
}
if (name.equals(Constants.FEATURE_VERBOSE))
@@ -167,7 +165,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"FEATURE_NAME_NOT_RECOGNIZED", name ));
+ throw NativeMessages.MESSAGES.featureNameNotRecognized(name);
}
}
@@ -183,7 +181,7 @@
{
if (name == null)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"FEATURE_NAME_MUST_NOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.featureNameMustNotBeNull();
}
if (name.equals(Constants.FEATURE_VERBOSE))
@@ -196,7 +194,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"FEATURE_NAME_NOT_RECOGNIZED", name ));
+ throw NativeMessages.MESSAGES.featureNameNotRecognized(name);
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/Message.properties 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1,35 +0,0 @@
-URL_CANNOT_BE_NULL=URL cannot be null
-INVALID_DEFAULT_NAMESPACE=Invalid default namespace: {0}
-CANNOT_CONNECT_TO=Cannot connect to: {0}
-CANNOT_PARSE_WSDLLOCATION=Cannot parse wsdlLocation: {0}
-
-PREFIX_NOT_BOUND=Prefix not bound for namespace: {0}
-WSDL_1.1_ONLY_SUPPORTS_MEPS_BINDING_REF=WSDl 1.1 only supports In-Only, and In-Out MEPS,
more than reference input found
-WSDL_STYLE_IS_NULL=WSDL Style is null (should be rpc or document
-WSDL_INTERFACE_SHOULD_NOT_BE_NULL=WSDL Interface should not be null
-WSDL11_SUPPORT_MEPS=WSDl 1.1 only supports In-Only, and In-Out MEPS.
-FEATURE_NAME_MUST_NOT_BE_NULL=Feature name must not be null.
-FEATURE_NAME_NOT_RECOGNIZED=Feature name is not recognized {0}
-A_SERVICE_MUST_HAVE_AN_ENDPOINT=A service must have an endpoint
-COULD_NOT_GENERATE_SCHEMA=Could not generate schema: {0}
-WSDL_FILE_ARGUMENT_CANNOT_BE_NULL=WSDL file argument cannot be null
-CANNOT_OBTAIN_WSDL=Cannot obtain wsdl from [{0}]
-CANNOT_ACCESS_WSDL=Cannot access wsdl from [{0}], {1}
-NOT_A_VALID_URL=Not a valid URL: {0}
-CANNOT_RESOLVE_IMPORTED_RESOURCE=Cannot resolve imported resource: {0}
-CANNOT_ACCESS_IMPORTED_WSDL=Cannot access imported wsdl [{0}], {1}
-UNSUPORTED_SCHEMA_ELEMENT=Unsuported schema element: {0}
-
-SCHEMALOCATION_IS_NULL_FOR_IMPORT=schemaLocation is null for xsd:import
-CANNOT_PROCESS_INCLUDE=Cannot process include, parent location not set
-SCHEMALOCATION_IS_NULL_FOR_INCLUDE=schemaLocation is null for xsd:include
-CANNOT_PROCESS_IMPORT=Cannot process import, parent location not set
-UNSUPPORTED_FAULT_MESSAGE_PART_IN_MESSAGE=Unsupported fault message part in message: {0}
-CANNOT_NAME_FOR_WSDL_PART=Cannot name for wsdl part: {0}
-UNSUPPORTED_BINDING=Unsupported binding: {0}
-MULTIPLE_ENCODING_STYLES_NOT_SUPPORTED=Multiple encoding styles not supported: {0}
-ENCODING_STYLE_NOT_SUPPORTED=Encoding style {0} not supported for: {1}
-UNPROCESSED_EXTENSION_ELEMENT=Unprocessed extension element: {0}
-WSDL_DEFINITIONS_IS_NULL=WSDL definitions is NULL
-UNSUPPORTED_WSDL_VERSION=Unsupported wsdl version: {0}
-URL_CANNOT_BE_NULL=URL cannot be null
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,6 +21,8 @@
*/
package org.jboss.ws.tools.wsdl;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
@@ -34,7 +36,6 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.ResourceBundle;
import java.util.Set;
import javax.wsdl.Binding;
@@ -75,7 +76,8 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
@@ -128,7 +130,6 @@
*/
public class WSDL11Reader
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WSDL11Reader.class);
// provide logging
private static final Logger log = Logger.getLogger(WSDL11Reader.class);
@@ -191,6 +192,7 @@
return destWsdl;
}
+ @SuppressWarnings("unchecked")
private void processTopLevelElements(Definition srcWsdl)
{
String targetNS = srcWsdl.getTargetNamespace();
@@ -279,7 +281,7 @@
{
log.trace("processUnreachableBindings");
- Iterator it = getAllDefinedBindings(srcWsdl).values().iterator();
+ Iterator<?> it = getAllDefinedBindings(srcWsdl).values().iterator();
while (it.hasNext())
{
Binding srcBinding = (Binding)it.next();
@@ -379,7 +381,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"UNSUPORTED_SCHEMA_ELEMENT", localname));
+ throw NativeMessages.MESSAGES.unsupportedSchemaElement(wsdlLoc,
localname);
}
}
catch (IOException e)
@@ -476,13 +478,13 @@
private void processSchemaImport(WSDLTypes types, URL wsdlLoc, Element importEl,
Map<URL, URL> publishedLocations) throws IOException, WSDLException
{
if (wsdlLoc == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_PROCESS_IMPORT"));
+ throw MESSAGES.cannotProcessImportParentLocationSetToNull();
log.trace("processSchemaImport: " + wsdlLoc);
String location = getOptionalAttribute(importEl, "schemaLocation");
if (location == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SCHEMALOCATION_IS_NULL_FOR_IMPORT"));
+ throw MESSAGES.xsdImportNullSchemaLocation();
URL locationURL = getLocationURL(wsdlLoc, location);
if (!publishedLocations.containsKey(locationURL))
@@ -498,7 +500,7 @@
private void processSchemaInclude(WSDLTypes types, URL wsdlLoc, Element schemaEl,
Map<URL, URL> publishedLocations) throws IOException, WSDLException
{
if (wsdlLoc == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_PROCESS_INCLUDE"));
+ throw MESSAGES.cannotProcessIncludeParentLocationSetToNull();
log.trace("processSchemaInclude: " + wsdlLoc);
@@ -543,7 +545,7 @@
Element includeEl = (Element)it.next();
String location = getOptionalAttribute(includeEl, "schemaLocation");
if (location == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"SCHEMALOCATION_IS_NULL_FOR_INCLUDE"));
+ throw MESSAGES.xsdIncludeNullSchemaLocation();
URL locationURL = getLocationURL(wsdlLoc, location);
Element rootElement = DOMUtils.parse(new
ResourceURL(locationURL).openStream());
@@ -582,7 +584,7 @@
private void handleSchemaImports(Element schemaEl, URL parentURL) throws
WSDLException, IOException
{
if (parentURL == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_PROCESS_IMPORT"));
+ throw MESSAGES.cannotProcessImportParentLocationSetToNull();
Iterator it = DOMUtils.getChildElements(schemaEl, new
QName(Constants.NS_SCHEMA_XSD, "import"));
while (it.hasNext())
@@ -611,7 +613,7 @@
}
catch (SAXException se)
{
- log.error(BundleUtils.getMessage(bundle, ""), se);
+ log.error("", se);
}
}
if (importedSchema == null)
@@ -918,7 +920,7 @@
else
{
umdmFault.setElement(messageName);
- log.warn(BundleUtils.getMessage(bundle,
"UNSUPPORTED_FAULT_MESSAGE_PART_IN_MESSAGE", messageName));
+ NativeLoggers.ROOT_LOGGER.unsupportedFaultMessagePartInMessage(messageName);
}
// Add the fault to the interface
@@ -975,7 +977,7 @@
}
if (xmlName == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_NAME_FOR_WSDL_PART", srcPart));
+ throw MESSAGES.cannotFindNameForWSDLPart(srcPart);
xmlName = destWsdl.registerQName(xmlName);
String key = srcMessage.getQName() + "->" + srcPart.getName();
@@ -1070,7 +1072,7 @@
}
else if ("binding".equals(elementType.getLocalPart()))
{
- log.warn(BundleUtils.getMessage(bundle, "UNSUPPORTED_BINDING",
elementType));
+ NativeLoggers.ROOT_LOGGER.unsupportedBinding(elementType);
bindingType = elementType.getNamespaceURI();
}
}
@@ -1526,7 +1528,7 @@
if (encStyleList != null)
{
if (encStyleList.size() > 1)
- log.warn(BundleUtils.getMessage(bundle,
"MULTIPLE_ENCODING_STYLES_NOT_SUPPORTED", encStyleList));
+
NativeLoggers.ROOT_LOGGER.multipleEncodingStyleNotSupported(encStyleList);
if (encStyleList.size() > 0)
{
@@ -1544,7 +1546,7 @@
{
String setStyle = destBindingOperation.getEncodingStyle();
if (encStyle.equals(setStyle) == false)
- log.warn(BundleUtils.getMessage(bundle,
"ENCODING_STYLE_NOT_SUPPORTED", new Object[]{ encStyle ,
destBindingOperation.getRef()}));
+ NativeLoggers.ROOT_LOGGER.encodingStyleNotSupported(encStyle,
destBindingOperation.getRef());
destBindingOperation.setEncodingStyle(encStyle);
}
@@ -1643,7 +1645,7 @@
}
else if ("address".equals(elementType.getLocalPart()))
{
- log.warn(BundleUtils.getMessage(bundle,
"UNPROCESSED_EXTENSION_ELEMENT", elementType));
+ NativeLoggers.ROOT_LOGGER.unprocessedWSDLExtensionElement(elementType);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,19 +21,18 @@
*/
package org.jboss.ws.tools.wsdl;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.IOException;
import java.io.Writer;
import java.util.Arrays;
import java.util.HashSet;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
import javax.xml.namespace.QName;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
@@ -65,7 +64,6 @@
*/
public class WSDL11Writer extends WSDLWriter
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WSDL11Writer.class);
//Used Internally
private String wsdlStyle = Constants.RPC_LITERAL;
@@ -248,7 +246,7 @@
String namespaceURI = name.getNamespaceURI();
String prefix = wsdl.getPrefix(namespaceURI);
if (prefix == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"PREFIX_NOT_BOUND", namespaceURI));
+ throw MESSAGES.prefixNotBound(namespaceURI);
return prefix + ":" + name.getLocalPart();
}
@@ -303,7 +301,7 @@
bindingReferences = bindingOperation.getOutputs();
if (bindingReferences.length > 1)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"WSDL_1.1_ONLY_SUPPORTS_MEPS_BINDING_REF"));
+ throw MESSAGES.wsd11MultipleRefInput();
if (bindingReferences.length == 1)
return bindingReferences[0];
@@ -409,7 +407,7 @@
buffer.append("<binding name='" +
binding.getName().getLocalPart() + "' type='" +
getQNameRef(binding.getInterfaceName()) + "'>");
//TODO:Need to derive the WSDLStyle from the Style attribute of
InterfaceOperation
if (wsdlStyle == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"WSDL_STYLE_IS_NULL"));
+ throw MESSAGES.wsdlStyleNull();
String style = "rpc";
if (wsdlStyle.equals(Constants.DOCUMENT_LITERAL))
style = "document";
@@ -436,7 +434,7 @@
WSDLInterface wsdlInterface = wsdl.getInterface(interfaceName);
if (wsdlInterface == null)
- throw new WSException(BundleUtils.getMessage(bundle,
"WSDL_INTERFACE_SHOULD_NOT_BE_NULL"));
+ throw MESSAGES.wsdlInterfaceNull();
WSDLInterfaceOperation interfaceOperation =
wsdlInterface.getOperation(operation.getRef());
buffer.append("<operation name='" +
interfaceOperation.getName().getLocalPart() + "'>");
@@ -445,7 +443,7 @@
WSDLBindingOperationInput[] inputs = operation.getInputs();
if (inputs.length != 1)
- throw new WSException(BundleUtils.getMessage(bundle,
"WSDL11_SUPPORT_MEPS"));
+ throw MESSAGES.wsd11UnsupportedMEP();
buffer.append("<input>");
appendSOAPBinding(buffer, wsdlInterface, operation, inputs);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -28,7 +28,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.ResourceBundle;
import javax.wsdl.Definition;
import javax.wsdl.factory.WSDLFactory;
@@ -38,7 +37,7 @@
import javax.xml.parsers.DocumentBuilderFactory;
import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.common.utils.ResourceURL;
@@ -61,7 +60,6 @@
*/
public class WSDLDefinitionsFactory
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WSDLDefinitionsFactory.class);
// provide logging
private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
@@ -100,7 +98,7 @@
public WSDLDefinitions parse(URL wsdlLocation) throws WSDLException
{
if (wsdlLocation == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"URL_CANNOT_BE_NULL"));
+ throw NativeMessages.MESSAGES.cannotParsedWsdlWithNullURL();
if (log.isDebugEnabled())
log.debug("parse: " + wsdlLocation.toExternalForm());
@@ -118,11 +116,11 @@
wsdlReader.setFeature("javax.wsdl.verbose", false);
// Setup reader features
- Iterator it = features.entrySet().iterator();
+ Iterator<?> it = features.entrySet().iterator();
while (it.hasNext())
{
- Map.Entry entry = (Map.Entry)it.next();
+ Map.Entry<?,?> entry = (Map.Entry<?, ?>)it.next();
String key = (String)entry.getKey();
Boolean flag = (Boolean)entry.getValue();
wsdlReader.setFeature(key, flag.booleanValue());
@@ -134,7 +132,7 @@
}
else
{
- throw new WSDLException(BundleUtils.getMessage(bundle,
"INVALID_DEFAULT_NAMESPACE", defaultNamespace));
+ throw NativeMessages.MESSAGES.invalidDefaultWSDLNamespace(defaultNamespace);
}
if (log.isTraceEnabled())
@@ -187,11 +185,11 @@
}
catch (ConnectException ex)
{
- throw new WSDLException(BundleUtils.getMessage(bundle,
"CANNOT_CONNECT_TO", wsdlLocation));
+ throw NativeMessages.MESSAGES.cannotParseWsdlFrom(wsdlLocation, ex);
}
catch (Exception ex)
{
- throw new WSDLException(BundleUtils.getMessage(bundle,
"CANNOT_PARSE_WSDLLOCATION", wsdlLocation), ex);
+ throw NativeMessages.MESSAGES.cannotParseWsdlFrom(wsdlLocation, ex);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLLocatorImpl.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,18 +21,18 @@
*/
package org.jboss.ws.tools.wsdl;
+import static org.jboss.ws.NativeMessages.MESSAGES;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
-import java.util.ResourceBundle;
import javax.wsdl.xml.WSDLLocator;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeLoggers;
import org.jboss.ws.common.utils.ResourceURL;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
@@ -41,7 +41,6 @@
*/
class WSDLLocatorImpl implements WSDLLocator
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(WSDLLocatorImpl.class);
// provide logging
private static final Logger log = Logger.getLogger(WSDLDefinitionsFactory.class);
@@ -52,7 +51,7 @@
public WSDLLocatorImpl(EntityResolver entityResolver, URL wsdlLocation)
{
if (wsdlLocation == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"WSDL_FILE_ARGUMENT_CANNOT_BE_NULL"));
+ throw MESSAGES.wsdlFileArgumentCannotBeNull();
this.entityResolver = entityResolver;
this.wsdlLocation = wsdlLocation;
@@ -65,13 +64,13 @@
{
InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
if (inputStream == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_WSDL", wsdlLocation ));
+ throw MESSAGES.cannotObtainWsdlFrom(wsdlLocation);
return new InputSource(inputStream);
}
catch (IOException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"CANNOT_ACCESS_WSDL", new Object[]{ wsdlLocation , e.getMessage()}));
+ throw MESSAGES.cannotAccessWsdlFrom(wsdlLocation, e);
}
}
@@ -91,7 +90,7 @@
}
catch (MalformedURLException e)
{
- log.error(BundleUtils.getMessage(bundle, "NOT_A_VALID_URL",
parent));
+ NativeLoggers.ROOT_LOGGER.notAValidUrl(parent);
return null;
}
@@ -111,7 +110,7 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_RESOLVE_IMPORTED_RESOURCE", resource));
+ throw MESSAGES.cannotResolveImportedResource(resource);
}
final String path = uri.getPath();
final String query = uri.getQuery() != null ? "?" + uri.getQuery()
: "";
@@ -159,7 +158,7 @@
}
else
{
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"CANNOT_RESOLVE_IMPORTED_RESOURCE", wsdlImport));
+ throw MESSAGES.cannotResolveImportedResource(wsdlImport);
}
return inputSource;
@@ -170,7 +169,7 @@
}
catch (Exception e)
{
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_ACCESS_IMPORTED_WSDL", new Object[]{ wsdlImport , e.getMessage()}));
+ throw MESSAGES.cannotAccessImportedWsdl(wsdlImport, e);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLWriter.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -24,13 +24,11 @@
import java.io.IOException;
import java.io.Writer;
import java.util.Iterator;
-import java.util.ResourceBundle;
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
@@ -52,7 +50,6 @@
*/
public class WSDLWriter
{
- private static final ResourceBundle bundle = BundleUtils.getBundle(WSDLWriter.class);
// provide logging
protected static final Logger log = Logger.getLogger(WSDLWriter.class);
@@ -70,7 +67,7 @@
public WSDLWriter(WSDLDefinitions wsdl)
{
if (wsdl == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"WSDL_DEFINITIONS_IS_NULL"));
+ throw NativeMessages.MESSAGES.wsdlDefinitionIsNull();
this.wsdl = wsdl;
}
@@ -91,7 +88,7 @@
}
else
{
- throw new WSException(BundleUtils.getMessage(bundle,
"UNSUPPORTED_WSDL_VERSION", wsdlNamespace));
+ throw NativeMessages.MESSAGES.unsupportedWSDLVersion(wsdlNamespace);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/BufferedStreamSource.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/BufferedStreamSource.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/BufferedStreamSource.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -30,13 +30,11 @@
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.net.URL;
-import java.util.ResourceBundle;
import javax.xml.transform.stream.StreamSource;
-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.IOUtils;
/**
@@ -47,8 +45,6 @@
*/
public final class BufferedStreamSource extends StreamSource
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(BufferedStreamSource.class);
- private static final Logger log = Logger.getLogger(BufferedStreamSource.class);
private byte[] bytes;
private char[] chars;
@@ -90,7 +86,7 @@
}
catch (Exception e)
{
- log.warn(BundleUtils.getMessage(bundle,
"FAILED_TO_CREATE_INPUTSTREAM"));
+
NativeLoggers.ROOT_LOGGER.failedToCreateInputStreamFromSystemID(systemId);
}
}
}
Deleted:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/Message.properties
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/Message.properties 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/util/xml/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1 +0,0 @@
-FAILED_TO_CREATE_INPUTSTREAM=Failed to create inputstream from systemId of StreamSource
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/AbstractEndpointServlet.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/AbstractEndpointServlet.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/AbstractEndpointServlet.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.ResourceBundle;
import javax.management.ObjectName;
import javax.servlet.ServletConfig;
@@ -35,8 +34,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
@@ -57,8 +55,6 @@
*/
public abstract class AbstractEndpointServlet extends HttpServlet
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(AbstractEndpointServlet.class);
-
protected Endpoint endpoint;
private EndpointRegistry epRegistry;
@@ -158,7 +154,7 @@
Endpoint.SEPID_PROPERTY_CONTEXT + "=" + contextPath + ","
+
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + servletName
);
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_ENDPOINT_FOR", oname));
+ throw NativeMessages.MESSAGES.cannotObtainEndpoint(oname);
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EagerInitializeDeploymentAspect.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EagerInitializeDeploymentAspect.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/EagerInitializeDeploymentAspect.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,9 +21,7 @@
*/
package org.jboss.wsf.stack.jbws;
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.common.utils.DelegateClassLoader;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
@@ -37,17 +35,16 @@
*/
public class EagerInitializeDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(EagerInitializeDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
UnifiedMetaData umd = dep.getAttachment(UnifiedMetaData.class);
if (umd == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_UNIFIEDMD"));
+ throw NativeMessages.MESSAGES.cannotObtainUnifiedMetaData(dep);
ClassLoader runtimeClassLoader = dep.getRuntimeClassLoader();
if(null == runtimeClassLoader)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle,
"NULL_RUNTIME_CLASSLOADER"));
+ throw NativeMessages.MESSAGES.missingRuntimeClassLoader(dep);
umd.setClassLoader(new DelegateClassLoader(runtimeClassLoader,
SecurityActions.getContextClassLoader()));
umd.eagerInitialize();
Deleted:
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-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/Message.properties 2012-10-10
17:36:19 UTC (rev 16833)
@@ -1,12 +0,0 @@
-INVALID_DEPLOYMENT_TYPE=Invalid deployment type: {0}
-CANNOT_FIND_ENDPOINTMD=Cannot find endpoint meta data for: {0}
-
-ERROR_SETTING_CONTEXT_CLASSLOADER=Error setting context classloader
-ERROR_RUNNING_PRIVILEGED_ACTION=Error running privileged action
-
-CANNOT_OBTAIN_UNIFIEDMD=Cannot obtain unified meta data
-NULL_RUNTIME_CLASSLOADER=Runtime classloader may not be null
-
-CANNOT_GET_EPR=Cannot get epr when using the XML/HTTP binding
-CANNOT_LOAD_CLASS=Cannot load class: {0}
-CANNOT_OBTAIN_ENDPOINT_FOR=Cannot obtain endpoint for: {0}
\ No newline at end of file
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeInstanceProvider.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeInstanceProvider.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/NativeInstanceProvider.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -24,10 +24,8 @@
import java.util.HashMap;
import java.util.Map;
-import java.util.ResourceBundle;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.deployment.ReferenceFactory;
import org.jboss.wsf.spi.deployment.InstanceProvider;
import org.jboss.wsf.spi.deployment.Reference;
@@ -39,7 +37,6 @@
*/
final class NativeInstanceProvider implements InstanceProvider {
- private static final ResourceBundle bundle =
BundleUtils.getBundle(NativeInstanceProvider.class);
private final ClassLoader loader;
private final Map<String, Reference> cache = new HashMap<String,
Reference>();
@@ -55,7 +52,7 @@
instance =
ReferenceFactory.newUninitializedReference(loader.loadClass(className).newInstance());
cache.put(className, instance);
} catch (Exception e) {
- throw new WSException(BundleUtils.getMessage(bundle,
"CANNOT_LOAD_CLASS", className), e);
+ throw NativeMessages.MESSAGES.cannotLoadClass(className, e);
}
}
return instance;
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/PublishContractDeploymentAspect.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -22,9 +22,8 @@
package org.jboss.wsf.stack.jbws;
import java.io.IOException;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.metadata.umdm.UnifiedMetaData;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -39,13 +38,12 @@
*/
public class PublishContractDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(PublishContractDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
UnifiedMetaData umd = dep.getAttachment(UnifiedMetaData.class);
if (umd == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_OBTAIN_UNIFIEDMD"));
+ throw NativeMessages.MESSAGES.cannotObtainUnifiedMetaData(dep);
try
{
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/SecurityActions.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/SecurityActions.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/SecurityActions.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -25,10 +25,7 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
-import java.util.ResourceBundle;
-import org.jboss.ws.api.util.BundleUtils;
-
/**
* Security actions for this package
*
@@ -38,7 +35,6 @@
*/
class SecurityActions
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(SecurityActions.class);
/**
* Get context classloader.
*
@@ -102,14 +98,14 @@
}
catch (Throwable e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"ERROR_SETTING_CONTEXT_CLASSLOADER"), e);
+ throw new RuntimeException(e);
}
}
});
}
catch (PrivilegedActionException e)
{
- throw new RuntimeException(BundleUtils.getMessage(bundle,
"ERROR_RUNNING_PRIVILEGED_ACTION"), e.getCause());
+ throw new RuntimeException(e.getCause());
}
}
}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2012-10-10
16:53:58 UTC (rev 16832)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/UnifiedMetaDataDeploymentAspect.java 2012-10-10
17:36:19 UTC (rev 16833)
@@ -21,13 +21,11 @@
*/
package org.jboss.wsf.stack.jbws;
+import static org.jboss.ws.NativeMessages.MESSAGES;
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.isJaxrpcDeployment;
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -46,7 +44,6 @@
*/
public class UnifiedMetaDataDeploymentAspect extends AbstractDeploymentAspect
{
- private static final ResourceBundle bundle =
BundleUtils.getBundle(UnifiedMetaDataDeploymentAspect.class);
@Override
public void start(Deployment dep)
{
@@ -104,7 +101,7 @@
}
if (epMetaData == null)
- throw new IllegalStateException(BundleUtils.getMessage(bundle,
"CANNOT_FIND_ENDPOINTMD", epName));
+ throw MESSAGES.cannotObtainEndpointMetaData(epName);
return epMetaData;
}