JBossWS SVN: r11354 - in common/branches/jbossws-common-1.1.0/src: test/java/org/jboss/test/ws/common/utils and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-12-23 08:39:00 -0500 (Wed, 23 Dec 2009)
New Revision: 11354
Added:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/SecurityActions.java
common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java
common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java
Modified:
common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
[JBPAPP-3303] Porting changes from trunk + adding SecurityActions utility class
Modified: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-12-23 13:20:16 UTC (rev 11353)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-12-23 13:39:00 UTC (rev 11354)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -80,7 +80,7 @@
DocumentBuilderFactory factory = null;
try
{
- factory = DocumentBuilderFactory.newInstance();
+ factory = JBossWSDocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
Copied: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java (from rev 11350, common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java)
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java (rev 0)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java 2009-12-23 13:39:00 UTC (rev 11354)
@@ -0,0 +1,492 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.WeakHashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.validation.Schema;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A thread-safe {@link DocumentBuilderFactory} that also adds a caching system
+ * for preventing useless access to the filesystem due to the Service API when
+ * the same context classloader is in place.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Dec-2009
+ *
+ */
+public class JBossWSDocumentBuilderFactory extends DocumentBuilderFactory
+{
+ private static Logger log = Logger.getLogger(JBossWSDocumentBuilderFactory.class);
+ private static final String PROPERTY_NAME = "javax.xml.parsers.DocumentBuilderFactory";
+ private static final boolean useJaxpProperty;
+ /**
+ * A weak hash map that keeps DocumentBuilderFactory instances for each classloader.
+ * Weak keys are used to remove entries when classloaders are garbage collected.
+ *
+ * No need for a synchronized map as this accessed from the
+ * static synchronized newInstance newInstance method.
+ */
+ private static Map<ClassLoader, JBossWSDocumentBuilderFactory> factoryMap = new WeakHashMap<ClassLoader, JBossWSDocumentBuilderFactory>();
+
+ private final DocumentBuilderFactory delegate;
+
+ //ThreadLocal attributes and features maps required to achieve thread safety
+ private ThreadLocal<DocumentBuilderFactoryFields> fields = new ThreadLocal<DocumentBuilderFactoryFields>() {
+ @Override
+ protected DocumentBuilderFactoryFields initialValue()
+ {
+ return new DocumentBuilderFactoryFields();
+ }
+ };
+
+ static
+ {
+ // Use the properties file "lib/jaxp.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully
+ // qualified name of the implementation class with the key being the system property defined above.
+ PrivilegedAction<Object> action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxp.properties");
+ if ((Boolean)AccessController.doPrivileged(new PropertyFileExistAction(jaxmFile)))
+ {
+ String factoryName = null;
+ boolean error = false;
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(PROPERTY_NAME);
+ }
+ catch (IOException e)
+ {
+ log.warn("Can't read " + jaxmFile);
+ error = true;
+ }
+ finally
+ {
+ useJaxpProperty = (error || (factoryName != null));
+ }
+ }
+ else
+ {
+ useJaxpProperty = false;
+ }
+ }
+
+ private JBossWSDocumentBuilderFactory(DocumentBuilderFactory delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return fields.get().getAttribute(name);
+ }
+
+ @Override
+ public boolean getFeature(String name) throws ParserConfigurationException
+ {
+ return fields.get().getFeature(name);
+ }
+
+ /**
+ * The creation method for the document builder; it's synchronized to allow us configuring the underlying
+ * DocumentBuilderFactory and delegate to it in a thread safe way.
+ *
+ */
+ @Override
+ public synchronized DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
+ {
+ DocumentBuilderFactoryFields currentFields = fields.get();
+ currentFields.copyTo(delegate);
+ return delegate.newDocumentBuilder();
+ }
+
+ @Override
+ public void setAttribute(String name, Object value) throws IllegalArgumentException
+ {
+ fields.get().setAttribute(name, value);
+ }
+
+ @Override
+ public void setFeature(String name, boolean value) throws ParserConfigurationException
+ {
+ fields.get().setFeature(name, value);
+ }
+
+ @Override
+ public boolean isCoalescing()
+ {
+ return fields.get().isCoalescing();
+ }
+
+ @Override
+ public void setCoalescing(boolean coalescing)
+ {
+ fields.get().setCoalescing(coalescing);
+ }
+
+ @Override
+ public boolean isExpandEntityReferences()
+ {
+ return fields.get().isExpandEntityReferences();
+ }
+
+ @Override
+ public void setExpandEntityReferences(boolean expandEntityReferences)
+ {
+ fields.get().setExpandEntityReferences(expandEntityReferences);
+ }
+
+ @Override
+ public boolean isIgnoringComments()
+ {
+ return fields.get().isIgnoringComments();
+ }
+
+ @Override
+ public void setIgnoringComments(boolean ignoringComments)
+ {
+ fields.get().setIgnoringComments(ignoringComments);
+ }
+
+ @Override
+ public boolean isIgnoringElementContentWhitespace()
+ {
+ return fields.get().isIgnoringElementContentWhitespace();
+ }
+
+ @Override
+ public void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
+ {
+ fields.get().setIgnoringElementContentWhitespace(ignoringElementContentWhitespace);
+ }
+
+ @Override
+ public boolean isNamespaceAware()
+ {
+ return fields.get().isNamespaceAware();
+ }
+
+ @Override
+ public void setNamespaceAware(boolean namespaceAware)
+ {
+ fields.get().setNamespaceAware(namespaceAware);
+ }
+
+ @Override
+ public Schema getSchema()
+ {
+ return fields.get().getSchema();
+ }
+
+ @Override
+ public void setSchema(Schema schema)
+ {
+ fields.get().setSchema(schema);
+ }
+
+ @Override
+ public boolean isValidating()
+ {
+ return fields.get().isValidating();
+ }
+
+ @Override
+ public void setValidating(boolean validating)
+ {
+ fields.get().setValidating(validating);
+ }
+
+ @Override
+ public boolean isXIncludeAware()
+ {
+ return fields.get().isXIncludeAware();
+ }
+
+ @Override
+ public void setXIncludeAware(boolean includeAware)
+ {
+ fields.get().setXIncludeAware(includeAware);
+ }
+
+ /**
+ * The {@link DocumentBuilderFactory#newInstance()} documentation defines the retrieval algorithm:
+ *
+ * 1) Use the javax.xml.parsers.DocumentBuilderFactory system property.
+ * 2) Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format
+ * and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties
+ * file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first
+ * attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any
+ * property in jaxp.properties after it has been read for the first time.
+ * 3) Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a
+ * classname in the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars available to the runtime.
+ * 4) Platform default DocumentBuilderFactory instance.
+ *
+ * So we basically check if 1) or 2) applies: if yes, we simply delegate to the DocumentBuilderFactory, otherwise we first try using our classloader
+ * cache and delegate to the DocumentBuilderFactory only in case of a miss in the cache. Then we wrap up the result into a JBossWSDocumentBuilderFactory
+ * instance.
+ *
+ * @return a DocumentBuilderFactoryInstance
+ */
+ public static synchronized JBossWSDocumentBuilderFactory newInstance()
+ {
+ if (useJaxpProperty || getFactoryNameFromSystemProperty() != null)
+ {
+ return new JBossWSDocumentBuilderFactory(DocumentBuilderFactory.newInstance());
+ }
+ ClassLoader classLoader = SecurityActions.getContextClassLoader();
+ JBossWSDocumentBuilderFactory factory = factoryMap.get(classLoader);
+ if (factory == null)
+ {
+ factory = new JBossWSDocumentBuilderFactory(DocumentBuilderFactory.newInstance());
+ factoryMap.put(classLoader, factory);
+ }
+ return factory;
+ }
+
+ private static String getFactoryNameFromSystemProperty()
+ {
+ PrivilegedAction<Object> action = new PropertyAccessAction(PROPERTY_NAME);
+ return (String)AccessController.doPrivileged(action);
+ }
+
+
+ //--------------------------------- Utility privileged actions
+
+ private static class PropertyAccessAction implements PrivilegedAction<Object>
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction<Object>
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ InputStream inStream = null;
+ try
+ {
+ inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ finally
+ {
+ try
+ {
+ inStream.close();
+ }
+ catch (Exception e) {} //ignore
+ }
+ }
+ }
+
+ private static class PropertyFileExistAction implements PrivilegedAction<Object>
+ {
+ private File file;
+
+ PropertyFileExistAction(File file)
+ {
+ this.file = file;
+ }
+
+ public Object run()
+ {
+ return file.exists();
+ }
+ }
+
+ /**
+ * A utility class for storing the document builder factory fields in the ThreadLocal
+ */
+ private static class DocumentBuilderFactoryFields {
+ private boolean coalescing = false;
+ private boolean expandEntityReferences = true;
+ private boolean ignoringComments = false;
+ private boolean ignoringElementContentWhitespace = false;
+ private boolean namespaceAware = false;
+ private Schema schema = null;
+ private boolean validating = false;
+ private boolean XIncludeAware = false;
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+ private Map<String, Boolean> features = new HashMap<String, Boolean>();
+
+ public void copyTo(DocumentBuilderFactory target) throws ParserConfigurationException
+ {
+ target.setCoalescing(coalescing);
+ target.setExpandEntityReferences(expandEntityReferences);
+ target.setIgnoringComments(ignoringComments);
+ target.setIgnoringElementContentWhitespace(ignoringElementContentWhitespace);
+ target.setNamespaceAware(namespaceAware);
+ target.setSchema(schema);
+ target.setValidating(validating);
+ target.setXIncludeAware(XIncludeAware);
+ for (String key : attributes.keySet())
+ {
+ target.setAttribute(key, attributes.get(key));
+ }
+ for (String key : features.keySet())
+ {
+ target.setFeature(key, features.get(key));
+ }
+ }
+
+ public Object getAttribute(String name)
+ {
+ return attributes.get(name);
+ }
+
+ public Boolean getFeature(String name)
+ {
+ return features.get(name);
+ }
+
+ public void setAttribute(String key, Object value)
+ {
+ this.attributes.put(key, value);
+ }
+
+ public void setFeature(String key, Boolean value)
+ {
+ this.features.put(key, value);
+ }
+
+ public boolean isCoalescing()
+ {
+ return coalescing;
+ }
+
+ public void setCoalescing(boolean coalescing)
+ {
+ this.coalescing = coalescing;
+ }
+
+ public boolean isExpandEntityReferences()
+ {
+ return expandEntityReferences;
+ }
+
+ public void setExpandEntityReferences(boolean expandEntityReferences)
+ {
+ this.expandEntityReferences = expandEntityReferences;
+ }
+
+ public boolean isIgnoringComments()
+ {
+ return ignoringComments;
+ }
+
+ public void setIgnoringComments(boolean ignoringComments)
+ {
+ this.ignoringComments = ignoringComments;
+ }
+
+ public boolean isIgnoringElementContentWhitespace()
+ {
+ return ignoringElementContentWhitespace;
+ }
+
+ public void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
+ {
+ this.ignoringElementContentWhitespace = ignoringElementContentWhitespace;
+ }
+
+ public boolean isNamespaceAware()
+ {
+ return namespaceAware;
+ }
+
+ public void setNamespaceAware(boolean namespaceAware)
+ {
+ this.namespaceAware = namespaceAware;
+ }
+
+ public Schema getSchema()
+ {
+ return schema;
+ }
+
+ public void setSchema(Schema schema)
+ {
+ this.schema = schema;
+ }
+
+ public boolean isValidating()
+ {
+ return validating;
+ }
+
+ public void setValidating(boolean validating)
+ {
+ this.validating = validating;
+ }
+
+ public boolean isXIncludeAware()
+ {
+ return XIncludeAware;
+ }
+
+ public void setXIncludeAware(boolean includeAware)
+ {
+ XIncludeAware = includeAware;
+ }
+ }
+
+}
Added: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/SecurityActions.java
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/SecurityActions.java (rev 0)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/SecurityActions.java 2009-12-23 13:39:00 UTC (rev 11354)
@@ -0,0 +1,92 @@
+/*
+ * 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.wsf.common;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+/**
+ * Security actions for this package
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Jun-2009
+ *
+ */
+class SecurityActions
+{
+ /**
+ * Get context classloader.
+ *
+ * @return the current context classloader
+ */
+ static ClassLoader getContextClassLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+ }
+
+ /**
+ * Load a class using the provided classloader
+ *
+ * @param name
+ * @return
+ * @throws PrivilegedActionException
+ */
+ static Class<?> loadClass(final ClassLoader cl, final String name) throws PrivilegedActionException, ClassNotFoundException
+ {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm == null)
+ {
+ return cl.loadClass(name);
+ }
+ else
+ {
+ return AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
+ public Class<?> run() throws PrivilegedActionException
+ {
+ try
+ {
+ return cl.loadClass(name);
+ }
+ catch (Exception e)
+ {
+ throw new PrivilegedActionException(e);
+ }
+ }
+ });
+ }
+ }
+}
\ No newline at end of file
Property changes on: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/SecurityActions.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Copied: common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java (from rev 11350, common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java)
===================================================================
--- common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java (rev 0)
+++ common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java 2009-12-23 13:39:00 UTC (rev 11354)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.test.ws.common.utils;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * A dummy document builder factory just for testing in {@link JBossWSDocumentBuilderFactoryTestCase}.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dec-2009
+ *
+ */
+public class DummyDocumentBuilderFactory extends DocumentBuilderFactory
+{
+ @Override
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return null;
+ }
+
+ @Override
+ public boolean getFeature(String name) throws ParserConfigurationException
+ {
+ return false;
+ }
+
+ @Override
+ public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
+ {
+ return null;
+ }
+
+ @Override
+ public void setAttribute(String name, Object value) throws IllegalArgumentException
+ {
+ }
+
+ @Override
+ public void setFeature(String name, boolean value) throws ParserConfigurationException
+ {
+ }
+}
Copied: common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java (from rev 11350, common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java)
===================================================================
--- common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java (rev 0)
+++ common/branches/jbossws-common-1.1.0/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java 2009-12-23 13:39:00 UTC (rev 11354)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.test.ws.common.utils;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.jboss.wsf.common.JBossWSDocumentBuilderFactory;
+
+/**
+ * Tests for the JBossWSDocumentBuilderFactory
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dec-2009
+ *
+ */
+public class JBossWSDocumentBuilderFactoryTestCase extends TestCase
+{
+ public void testCaching() throws Exception
+ {
+ final String propName = "javax.xml.parsers.DocumentBuilderFactory";
+ String origValue = System.getProperty(propName);
+ try
+ {
+ //remove system prop if any, to get the same factory for a given classloader
+ System.getProperties().remove(propName);
+ DocumentBuilderFactory factory1 = JBossWSDocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory2 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory1.equals(factory2));
+
+ //set the system prop, we should get different factories every time as the classloader based cache is by-passed
+ System.setProperty(propName, DummyDocumentBuilderFactory.class.getCanonicalName());
+ DocumentBuilderFactory factory3 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory3.equals(factory1));
+ assertTrue("Expected different factories", !factory3.equals(factory2));
+ DocumentBuilderFactory factory4 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory4.equals(factory1));
+ assertTrue("Expected different factories", !factory4.equals(factory2));
+ assertTrue("Expected different factories", !factory4.equals(factory3));
+
+ //remove the prop again, we should get the first factory
+ System.getProperties().remove(propName);
+ DocumentBuilderFactory factory5 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory5.equals(factory1));
+
+ ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ //change context classloader
+ Thread.currentThread().setContextClassLoader(new TestClassLoader(origLoader));
+ DocumentBuilderFactory factory6 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory6.equals(factory1));
+ DocumentBuilderFactory factory7 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory7.equals(factory6));
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(origLoader);
+ }
+ }
+ finally
+ {
+ if (origValue == null)
+ {
+ System.getProperties().remove(propName);
+ }
+ else
+ {
+ System.setProperty(propName, origValue);
+ }
+ }
+ }
+
+ public void testThreadSafety() throws Exception
+ {
+ DocumentBuilderFactory factory = JBossWSDocumentBuilderFactory.newInstance();
+ List<Callable<Boolean>> callables = new LinkedList<Callable<Boolean>>();
+ for (int j = 0; j < 3; j++)
+ {
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, true, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, true, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, false, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, false, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, false, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, true, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, true, false));
+ }
+ }
+ ExecutorService es = Executors.newFixedThreadPool(210);
+ List<Future<Boolean>> futures = es.invokeAll(callables);
+ for (Future<Boolean> f : futures)
+ {
+ assertTrue(f.get());
+ }
+ }
+
+ /**
+ * A Callable that use the provided thread safe factory to create a document builder and verifies it has the required configuration
+ */
+ public static class TestCallable implements Callable<Boolean>
+ {
+ private final DocumentBuilderFactory factory;
+ private final Boolean namespaceAware;
+ private final Boolean validating;
+ private final Boolean XIncludeAware;
+
+ public TestCallable(DocumentBuilderFactory factory, boolean namespaceAware, boolean validating, boolean includeAware)
+ {
+ this.factory = factory;
+ this.namespaceAware = namespaceAware;
+ this.validating = validating;
+ this.XIncludeAware = includeAware;
+ }
+
+ public Boolean call() throws Exception
+ {
+ factory.setNamespaceAware(namespaceAware);
+ factory.setValidating(validating);
+ factory.setXIncludeAware(XIncludeAware);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ if (!namespaceAware.equals(builder.isNamespaceAware()))
+ return false;
+ if (!validating.equals(builder.isValidating()))
+ return false;
+ if (!XIncludeAware.equals(builder.isXIncludeAware()))
+ return false;
+ return true;
+ }
+
+ }
+
+ /**
+ * A ClassLoader doing nothing except falling back to its parent
+ */
+ public static class TestClassLoader extends ClassLoader
+ {
+ public TestClassLoader(ClassLoader parent)
+ {
+ super(parent);
+ }
+ }
+
+}
14 years, 9 months
JBossWS SVN: r11353 - stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2651.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-12-23 08:20:16 -0500 (Wed, 23 Dec 2009)
New Revision: 11353
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2651/EnvelopBuilderTestCase.java
Log:
Fixing testsuite build after removal of stax based envelope builder
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2651/EnvelopBuilderTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2651/EnvelopBuilderTestCase.java 2009-12-23 10:51:05 UTC (rev 11352)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2651/EnvelopBuilderTestCase.java 2009-12-23 13:20:16 UTC (rev 11353)
@@ -22,24 +22,18 @@
package org.jboss.test.ws.jaxws.jbws2651;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
import java.io.InputStream;
-import javax.xml.soap.SOAPException;
+import junit.framework.TestCase;
-
import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.core.soap.EnvelopeBuilderDOM;
-import org.jboss.ws.core.soap.EnvelopeBuilderStax;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
-import junit.framework.TestCase;
-
public class EnvelopBuilderTestCase extends TestCase {
EnvelopeBuilderDOM domBuilder = new EnvelopeBuilderDOM();
- EnvelopeBuilderStax staxBuilder = new EnvelopeBuilderStax();
MessageFactoryImpl factory = new MessageFactoryImpl();
public void testEmptyInputStream() throws Exception {
@@ -63,22 +57,6 @@
}
- public void testStaxInputStream() throws Exception {
- String soapMsg =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:addItemResponse xmlns:ns1='http://org.jboss.ws/addressing/replyto'>" +
- " <result>Mars Bar</result>" +
- " </ns1:addItemResponse>" +
- " </env:Body>" +
- "</env:Envelope>";
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)factory.createMessage();
- InputStream ins = new ByteArrayInputStream(soapMsg.getBytes());
- assertNotNull(staxBuilder.build(soapMessage, ins, false));
- }
-
-
public void testDomErroStream(){
String soapMsg =
"<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
@@ -101,25 +79,4 @@
}
- public void testStaxErroStream(){
- String soapMsg =
- "<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
- " <env:Header/>" +
- " <env:Body>" +
- " <ns1:addItemResponse xmlns:ns1='http://org.jboss.ws/addressing/replyto'>" +
- " <result>Mars Bar</result>" +
- " </ns1:addItemResponse>" +
- " </env:Body>" +
- "</env:Envelope";
-
- try {
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)factory.createMessage();
- InputStream ins = new ByteArrayInputStream(soapMsg.getBytes());
- staxBuilder.build(soapMessage, ins, false);
- fail("expected IOException");
- } catch (Exception e) {
- assertTrue(e instanceof IOException);
- }
- }
-
}
14 years, 9 months
JBossWS SVN: r11352 - framework/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-12-23 05:51:05 -0500 (Wed, 23 Dec 2009)
New Revision: 11352
Modified:
framework/trunk/pom.xml
Log:
Moving to jbossws-common snapshot
Modified: framework/trunk/pom.xml
===================================================================
--- framework/trunk/pom.xml 2009-12-23 10:35:39 UTC (rev 11351)
+++ framework/trunk/pom.xml 2009-12-23 10:51:05 UTC (rev 11352)
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
<jbossws.spi.version>1.2.2.GA</jbossws.spi.version>
- <jbossws.common.version>1.2.2.GA</jbossws.common.version>
+ <jbossws.common.version>1.3.0-SNAPSHOT</jbossws.common.version>
<jaxrpc.api.version>1.1</jaxrpc.api.version>
<jaxws.api.version>2.1</jaxws.api.version>
<jboss.web.version>2.1.3.GA</jboss.web.version>
14 years, 9 months
JBossWS SVN: r11351 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-12-23 05:35:39 -0500 (Wed, 23 Dec 2009)
New Revision: 11351
Modified:
stack/native/trunk/pom.xml
Log:
Moving to jbossws-common snapshot and using latest jbossws-spi
Modified: stack/native/trunk/pom.xml
===================================================================
--- stack/native/trunk/pom.xml 2009-12-23 10:28:15 UTC (rev 11350)
+++ stack/native/trunk/pom.xml 2009-12-23 10:35:39 UTC (rev 11351)
@@ -47,9 +47,9 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.2.2-SNAPSHOT</jbossws.common.version>
+ <jbossws.common.version>1.3.0-SNAPSHOT</jbossws.common.version>
<jbossws.framework.version>3.3.0-SNAPSHOT</jbossws.framework.version>
- <jbossws.spi.version>1.2.2-SNAPSHOT</jbossws.spi.version>
+ <jbossws.spi.version>1.2.2.GA</jbossws.spi.version>
<jbossws.jboss501.version>3.2.1.GA</jbossws.jboss501.version>
<jbossws.jboss510.version>3.2.1.GA</jbossws.jboss510.version>
<!-- [JBWS-2505] -->
14 years, 9 months
JBossWS SVN: r11350 - in common/trunk/src: test/java/org/jboss/test/ws/common/utils and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2009-12-23 05:28:15 -0500 (Wed, 23 Dec 2009)
New Revision: 11350
Added:
common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java
common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java
common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
Log:
[JBWS-2881] Providing a thread-safe DocumentBuilderFactory that also adds a caching system for preventing useless access to the filesystem due to the Service API when the same context classloader is in place.
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-12-22 14:22:46 UTC (rev 11349)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2009-12-23 10:28:15 UTC (rev 11350)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2009, 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.
*
@@ -80,7 +80,7 @@
DocumentBuilderFactory factory = null;
try
{
- factory = DocumentBuilderFactory.newInstance();
+ factory = JBossWSDocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setNamespaceAware(true);
Added: common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java (rev 0)
+++ common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java 2009-12-23 10:28:15 UTC (rev 11350)
@@ -0,0 +1,492 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.wsf.common;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.WeakHashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.validation.Schema;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A thread-safe {@link DocumentBuilderFactory} that also adds a caching system
+ * for preventing useless access to the filesystem due to the Service API when
+ * the same context classloader is in place.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 22-Dec-2009
+ *
+ */
+public class JBossWSDocumentBuilderFactory extends DocumentBuilderFactory
+{
+ private static Logger log = Logger.getLogger(JBossWSDocumentBuilderFactory.class);
+ private static final String PROPERTY_NAME = "javax.xml.parsers.DocumentBuilderFactory";
+ private static final boolean useJaxpProperty;
+ /**
+ * A weak hash map that keeps DocumentBuilderFactory instances for each classloader.
+ * Weak keys are used to remove entries when classloaders are garbage collected.
+ *
+ * No need for a synchronized map as this accessed from the
+ * static synchronized newInstance newInstance method.
+ */
+ private static Map<ClassLoader, JBossWSDocumentBuilderFactory> factoryMap = new WeakHashMap<ClassLoader, JBossWSDocumentBuilderFactory>();
+
+ private final DocumentBuilderFactory delegate;
+
+ //ThreadLocal attributes and features maps required to achieve thread safety
+ private ThreadLocal<DocumentBuilderFactoryFields> fields = new ThreadLocal<DocumentBuilderFactoryFields>() {
+ @Override
+ protected DocumentBuilderFactoryFields initialValue()
+ {
+ return new DocumentBuilderFactoryFields();
+ }
+ };
+
+ static
+ {
+ // Use the properties file "lib/jaxp.properties" in the JRE directory.
+ // This configuration file is in standard java.util.Properties format and contains the fully
+ // qualified name of the implementation class with the key being the system property defined above.
+ PrivilegedAction<Object> action = new PropertyAccessAction("java.home");
+ String javaHome = (String)AccessController.doPrivileged(action);
+ File jaxmFile = new File(javaHome + "/lib/jaxp.properties");
+ if ((Boolean)AccessController.doPrivileged(new PropertyFileExistAction(jaxmFile)))
+ {
+ String factoryName = null;
+ boolean error = false;
+ try
+ {
+ action = new PropertyFileAccessAction(jaxmFile.getCanonicalPath());
+ Properties jaxmProperties = (Properties)AccessController.doPrivileged(action);
+ factoryName = jaxmProperties.getProperty(PROPERTY_NAME);
+ }
+ catch (IOException e)
+ {
+ log.warn("Can't read " + jaxmFile);
+ error = true;
+ }
+ finally
+ {
+ useJaxpProperty = (error || (factoryName != null));
+ }
+ }
+ else
+ {
+ useJaxpProperty = false;
+ }
+ }
+
+ private JBossWSDocumentBuilderFactory(DocumentBuilderFactory delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return fields.get().getAttribute(name);
+ }
+
+ @Override
+ public boolean getFeature(String name) throws ParserConfigurationException
+ {
+ return fields.get().getFeature(name);
+ }
+
+ /**
+ * The creation method for the document builder; it's synchronized to allow us configuring the underlying
+ * DocumentBuilderFactory and delegate to it in a thread safe way.
+ *
+ */
+ @Override
+ public synchronized DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
+ {
+ DocumentBuilderFactoryFields currentFields = fields.get();
+ currentFields.copyTo(delegate);
+ return delegate.newDocumentBuilder();
+ }
+
+ @Override
+ public void setAttribute(String name, Object value) throws IllegalArgumentException
+ {
+ fields.get().setAttribute(name, value);
+ }
+
+ @Override
+ public void setFeature(String name, boolean value) throws ParserConfigurationException
+ {
+ fields.get().setFeature(name, value);
+ }
+
+ @Override
+ public boolean isCoalescing()
+ {
+ return fields.get().isCoalescing();
+ }
+
+ @Override
+ public void setCoalescing(boolean coalescing)
+ {
+ fields.get().setCoalescing(coalescing);
+ }
+
+ @Override
+ public boolean isExpandEntityReferences()
+ {
+ return fields.get().isExpandEntityReferences();
+ }
+
+ @Override
+ public void setExpandEntityReferences(boolean expandEntityReferences)
+ {
+ fields.get().setExpandEntityReferences(expandEntityReferences);
+ }
+
+ @Override
+ public boolean isIgnoringComments()
+ {
+ return fields.get().isIgnoringComments();
+ }
+
+ @Override
+ public void setIgnoringComments(boolean ignoringComments)
+ {
+ fields.get().setIgnoringComments(ignoringComments);
+ }
+
+ @Override
+ public boolean isIgnoringElementContentWhitespace()
+ {
+ return fields.get().isIgnoringElementContentWhitespace();
+ }
+
+ @Override
+ public void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
+ {
+ fields.get().setIgnoringElementContentWhitespace(ignoringElementContentWhitespace);
+ }
+
+ @Override
+ public boolean isNamespaceAware()
+ {
+ return fields.get().isNamespaceAware();
+ }
+
+ @Override
+ public void setNamespaceAware(boolean namespaceAware)
+ {
+ fields.get().setNamespaceAware(namespaceAware);
+ }
+
+ @Override
+ public Schema getSchema()
+ {
+ return fields.get().getSchema();
+ }
+
+ @Override
+ public void setSchema(Schema schema)
+ {
+ fields.get().setSchema(schema);
+ }
+
+ @Override
+ public boolean isValidating()
+ {
+ return fields.get().isValidating();
+ }
+
+ @Override
+ public void setValidating(boolean validating)
+ {
+ fields.get().setValidating(validating);
+ }
+
+ @Override
+ public boolean isXIncludeAware()
+ {
+ return fields.get().isXIncludeAware();
+ }
+
+ @Override
+ public void setXIncludeAware(boolean includeAware)
+ {
+ fields.get().setXIncludeAware(includeAware);
+ }
+
+ /**
+ * The {@link DocumentBuilderFactory#newInstance()} documentation defines the retrieval algorithm:
+ *
+ * 1) Use the javax.xml.parsers.DocumentBuilderFactory system property.
+ * 2) Use the properties file "lib/jaxp.properties" in the JRE directory. This configuration file is in standard java.util.Properties format
+ * and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties
+ * file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first
+ * attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any
+ * property in jaxp.properties after it has been read for the first time.
+ * 3) Use the Services API (as detailed in the JAR specification), if available, to determine the classname. The Services API will look for a
+ * classname in the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory in jars available to the runtime.
+ * 4) Platform default DocumentBuilderFactory instance.
+ *
+ * So we basically check if 1) or 2) applies: if yes, we simply delegate to the DocumentBuilderFactory, otherwise we first try using our classloader
+ * cache and delegate to the DocumentBuilderFactory only in case of a miss in the cache. Then we wrap up the result into a JBossWSDocumentBuilderFactory
+ * instance.
+ *
+ * @return a DocumentBuilderFactoryInstance
+ */
+ public static synchronized JBossWSDocumentBuilderFactory newInstance()
+ {
+ if (useJaxpProperty || getFactoryNameFromSystemProperty() != null)
+ {
+ return new JBossWSDocumentBuilderFactory(DocumentBuilderFactory.newInstance());
+ }
+ ClassLoader classLoader = SecurityActions.getContextClassLoader();
+ JBossWSDocumentBuilderFactory factory = factoryMap.get(classLoader);
+ if (factory == null)
+ {
+ factory = new JBossWSDocumentBuilderFactory(DocumentBuilderFactory.newInstance());
+ factoryMap.put(classLoader, factory);
+ }
+ return factory;
+ }
+
+ private static String getFactoryNameFromSystemProperty()
+ {
+ PrivilegedAction<Object> action = new PropertyAccessAction(PROPERTY_NAME);
+ return (String)AccessController.doPrivileged(action);
+ }
+
+
+ //--------------------------------- Utility privileged actions
+
+ private static class PropertyAccessAction implements PrivilegedAction<Object>
+ {
+ private String name;
+
+ PropertyAccessAction(String name)
+ {
+ this.name = name;
+ }
+
+ public Object run()
+ {
+ return System.getProperty(name);
+ }
+ }
+
+ private static class PropertyFileAccessAction implements PrivilegedAction<Object>
+ {
+ private String filename;
+
+ PropertyFileAccessAction(String filename)
+ {
+ this.filename = filename;
+ }
+
+ public Object run()
+ {
+ InputStream inStream = null;
+ try
+ {
+ inStream = new FileInputStream(filename);
+ Properties props = new Properties();
+ props.load(inStream);
+ return props;
+ }
+ catch (IOException ex)
+ {
+ throw new SecurityException("Cannot load properties: " + filename, ex);
+ }
+ finally
+ {
+ try
+ {
+ inStream.close();
+ }
+ catch (Exception e) {} //ignore
+ }
+ }
+ }
+
+ private static class PropertyFileExistAction implements PrivilegedAction<Object>
+ {
+ private File file;
+
+ PropertyFileExistAction(File file)
+ {
+ this.file = file;
+ }
+
+ public Object run()
+ {
+ return file.exists();
+ }
+ }
+
+ /**
+ * A utility class for storing the document builder factory fields in the ThreadLocal
+ */
+ private static class DocumentBuilderFactoryFields {
+ private boolean coalescing = false;
+ private boolean expandEntityReferences = true;
+ private boolean ignoringComments = false;
+ private boolean ignoringElementContentWhitespace = false;
+ private boolean namespaceAware = false;
+ private Schema schema = null;
+ private boolean validating = false;
+ private boolean XIncludeAware = false;
+ private Map<String, Object> attributes = new HashMap<String, Object>();
+ private Map<String, Boolean> features = new HashMap<String, Boolean>();
+
+ public void copyTo(DocumentBuilderFactory target) throws ParserConfigurationException
+ {
+ target.setCoalescing(coalescing);
+ target.setExpandEntityReferences(expandEntityReferences);
+ target.setIgnoringComments(ignoringComments);
+ target.setIgnoringElementContentWhitespace(ignoringElementContentWhitespace);
+ target.setNamespaceAware(namespaceAware);
+ target.setSchema(schema);
+ target.setValidating(validating);
+ target.setXIncludeAware(XIncludeAware);
+ for (String key : attributes.keySet())
+ {
+ target.setAttribute(key, attributes.get(key));
+ }
+ for (String key : features.keySet())
+ {
+ target.setFeature(key, features.get(key));
+ }
+ }
+
+ public Object getAttribute(String name)
+ {
+ return attributes.get(name);
+ }
+
+ public Boolean getFeature(String name)
+ {
+ return features.get(name);
+ }
+
+ public void setAttribute(String key, Object value)
+ {
+ this.attributes.put(key, value);
+ }
+
+ public void setFeature(String key, Boolean value)
+ {
+ this.features.put(key, value);
+ }
+
+ public boolean isCoalescing()
+ {
+ return coalescing;
+ }
+
+ public void setCoalescing(boolean coalescing)
+ {
+ this.coalescing = coalescing;
+ }
+
+ public boolean isExpandEntityReferences()
+ {
+ return expandEntityReferences;
+ }
+
+ public void setExpandEntityReferences(boolean expandEntityReferences)
+ {
+ this.expandEntityReferences = expandEntityReferences;
+ }
+
+ public boolean isIgnoringComments()
+ {
+ return ignoringComments;
+ }
+
+ public void setIgnoringComments(boolean ignoringComments)
+ {
+ this.ignoringComments = ignoringComments;
+ }
+
+ public boolean isIgnoringElementContentWhitespace()
+ {
+ return ignoringElementContentWhitespace;
+ }
+
+ public void setIgnoringElementContentWhitespace(boolean ignoringElementContentWhitespace)
+ {
+ this.ignoringElementContentWhitespace = ignoringElementContentWhitespace;
+ }
+
+ public boolean isNamespaceAware()
+ {
+ return namespaceAware;
+ }
+
+ public void setNamespaceAware(boolean namespaceAware)
+ {
+ this.namespaceAware = namespaceAware;
+ }
+
+ public Schema getSchema()
+ {
+ return schema;
+ }
+
+ public void setSchema(Schema schema)
+ {
+ this.schema = schema;
+ }
+
+ public boolean isValidating()
+ {
+ return validating;
+ }
+
+ public void setValidating(boolean validating)
+ {
+ this.validating = validating;
+ }
+
+ public boolean isXIncludeAware()
+ {
+ return XIncludeAware;
+ }
+
+ public void setXIncludeAware(boolean includeAware)
+ {
+ XIncludeAware = includeAware;
+ }
+ }
+
+}
Property changes on: common/trunk/src/main/java/org/jboss/wsf/common/JBossWSDocumentBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java 2009-12-23 10:28:15 UTC (rev 11350)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.test.ws.common.utils;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * A dummy document builder factory just for testing in {@link JBossWSDocumentBuilderFactoryTestCase}.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dec-2009
+ *
+ */
+public class DummyDocumentBuilderFactory extends DocumentBuilderFactory
+{
+ @Override
+ public Object getAttribute(String name) throws IllegalArgumentException
+ {
+ return null;
+ }
+
+ @Override
+ public boolean getFeature(String name) throws ParserConfigurationException
+ {
+ return false;
+ }
+
+ @Override
+ public DocumentBuilder newDocumentBuilder() throws ParserConfigurationException
+ {
+ return null;
+ }
+
+ @Override
+ public void setAttribute(String name, Object value) throws IllegalArgumentException
+ {
+ }
+
+ @Override
+ public void setFeature(String name, boolean value) throws ParserConfigurationException
+ {
+ }
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/utils/DummyDocumentBuilderFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java
===================================================================
--- common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java (rev 0)
+++ common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java 2009-12-23 10:28:15 UTC (rev 11350)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.test.ws.common.utils;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.jboss.wsf.common.JBossWSDocumentBuilderFactory;
+
+/**
+ * Tests for the JBossWSDocumentBuilderFactory
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 23-Dec-2009
+ *
+ */
+public class JBossWSDocumentBuilderFactoryTestCase extends TestCase
+{
+ public void testCaching() throws Exception
+ {
+ final String propName = "javax.xml.parsers.DocumentBuilderFactory";
+ String origValue = System.getProperty(propName);
+ try
+ {
+ //remove system prop if any, to get the same factory for a given classloader
+ System.getProperties().remove(propName);
+ DocumentBuilderFactory factory1 = JBossWSDocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory2 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory1.equals(factory2));
+
+ //set the system prop, we should get different factories every time as the classloader based cache is by-passed
+ System.setProperty(propName, DummyDocumentBuilderFactory.class.getCanonicalName());
+ DocumentBuilderFactory factory3 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory3.equals(factory1));
+ assertTrue("Expected different factories", !factory3.equals(factory2));
+ DocumentBuilderFactory factory4 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory4.equals(factory1));
+ assertTrue("Expected different factories", !factory4.equals(factory2));
+ assertTrue("Expected different factories", !factory4.equals(factory3));
+
+ //remove the prop again, we should get the first factory
+ System.getProperties().remove(propName);
+ DocumentBuilderFactory factory5 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory5.equals(factory1));
+
+ ClassLoader origLoader = Thread.currentThread().getContextClassLoader();
+ try
+ {
+ //change context classloader
+ Thread.currentThread().setContextClassLoader(new TestClassLoader(origLoader));
+ DocumentBuilderFactory factory6 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected different factories", !factory6.equals(factory1));
+ DocumentBuilderFactory factory7 = JBossWSDocumentBuilderFactory.newInstance();
+ assertTrue("Expected the same factory", factory7.equals(factory6));
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(origLoader);
+ }
+ }
+ finally
+ {
+ if (origValue == null)
+ {
+ System.getProperties().remove(propName);
+ }
+ else
+ {
+ System.setProperty(propName, origValue);
+ }
+ }
+ }
+
+ public void testThreadSafety() throws Exception
+ {
+ DocumentBuilderFactory factory = JBossWSDocumentBuilderFactory.newInstance();
+ List<Callable<Boolean>> callables = new LinkedList<Callable<Boolean>>();
+ for (int j = 0; j < 3; j++)
+ {
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, true, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, true, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, true, false, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, false, false));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, false, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, true, true));
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ callables.add(new TestCallable(factory, false, true, false));
+ }
+ }
+ ExecutorService es = Executors.newFixedThreadPool(210);
+ List<Future<Boolean>> futures = es.invokeAll(callables);
+ for (Future<Boolean> f : futures)
+ {
+ assertTrue(f.get());
+ }
+ }
+
+ /**
+ * A Callable that use the provided thread safe factory to create a document builder and verifies it has the required configuration
+ */
+ public static class TestCallable implements Callable<Boolean>
+ {
+ private final DocumentBuilderFactory factory;
+ private final Boolean namespaceAware;
+ private final Boolean validating;
+ private final Boolean XIncludeAware;
+
+ public TestCallable(DocumentBuilderFactory factory, boolean namespaceAware, boolean validating, boolean includeAware)
+ {
+ this.factory = factory;
+ this.namespaceAware = namespaceAware;
+ this.validating = validating;
+ this.XIncludeAware = includeAware;
+ }
+
+ public Boolean call() throws Exception
+ {
+ factory.setNamespaceAware(namespaceAware);
+ factory.setValidating(validating);
+ factory.setXIncludeAware(XIncludeAware);
+ DocumentBuilder builder = factory.newDocumentBuilder();
+ if (!namespaceAware.equals(builder.isNamespaceAware()))
+ return false;
+ if (!validating.equals(builder.isValidating()))
+ return false;
+ if (!XIncludeAware.equals(builder.isXIncludeAware()))
+ return false;
+ return true;
+ }
+
+ }
+
+ /**
+ * A ClassLoader doing nothing except falling back to its parent
+ */
+ public static class TestClassLoader extends ClassLoader
+ {
+ public TestClassLoader(ClassLoader parent)
+ {
+ super(parent);
+ }
+ }
+
+}
Property changes on: common/trunk/src/test/java/org/jboss/test/ws/common/utils/JBossWSDocumentBuilderFactoryTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 9 months
JBossWS SVN: r11349 - stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-12-22 09:22:46 -0500 (Tue, 22 Dec 2009)
New Revision: 11349
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
Log:
[JBPAPP-3300] fixing issue
Modified: stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-12-22 14:16:55 UTC (rev 11348)
+++ stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-12-22 14:22:46 UTC (rev 11349)
@@ -22,16 +22,19 @@
package org.jboss.ws.core.utils;
import java.awt.image.BufferedImage;
-import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
import javax.mail.internet.ContentType;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.ParseException;
@@ -43,10 +46,6 @@
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.common.JavaUtils;
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageDecoder;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-
/**
* Generic mime utility class.
*
@@ -221,15 +220,18 @@
{
public Object readFrom(InputStream in) {
Object converted = null;
+
try
{
- JPEGImageDecoder dec = JPEGCodec.createJPEGDecoder(in);
- BufferedImage bim = dec.decodeAsBufferedImage();
+ ImageReader decoder = ImageIO.getImageReadersByFormatName("JPEG").next();
+ ImageInputStream iis = ImageIO.createImageInputStream(in);
+ decoder.setInput(iis);
+ BufferedImage bim = decoder.read(0);
converted = bim;
}
catch (Exception e)
{
- // ignore
+ e.printStackTrace();
}
return converted;
@@ -238,10 +240,12 @@
public void writeTo(Object obj, OutputStream out) {
if(obj instanceof BufferedImage)
{
- JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(out);
+ ImageWriter encoder = ImageIO.getImageWritersByFormatName("JPEG").next();
try
{
- enc.encode((BufferedImage)obj);
+ ImageOutputStream ios = ImageIO.createImageOutputStream(out);
+ encoder.setOutput(ios);
+ encoder.write((BufferedImage)obj);
}
catch (IOException e)
{
14 years, 9 months
JBossWS SVN: r11348 - stack/native/branches/jbossws-native-3.1.2.SP4/modules/core/src/main/java/org/jboss/ws/core/utils.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-12-22 09:16:55 -0500 (Tue, 22 Dec 2009)
New Revision: 11348
Modified:
stack/native/branches/jbossws-native-3.1.2.SP4/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
Log:
[JBPAPP-3300] fixing issue
Modified: stack/native/branches/jbossws-native-3.1.2.SP4/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java
===================================================================
--- stack/native/branches/jbossws-native-3.1.2.SP4/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-12-22 13:23:39 UTC (rev 11347)
+++ stack/native/branches/jbossws-native-3.1.2.SP4/modules/core/src/main/java/org/jboss/ws/core/utils/MimeUtils.java 2009-12-22 14:16:55 UTC (rev 11348)
@@ -22,15 +22,18 @@
package org.jboss.ws.core.utils;
import java.awt.image.BufferedImage;
-import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
import javax.mail.internet.ContentType;
import javax.mail.internet.MimeMultipart;
import javax.mail.internet.ParseException;
@@ -42,10 +45,6 @@
import org.jboss.wsf.common.IOUtils;
import org.jboss.wsf.common.JavaUtils;
-import com.sun.image.codec.jpeg.JPEGCodec;
-import com.sun.image.codec.jpeg.JPEGImageDecoder;
-import com.sun.image.codec.jpeg.JPEGImageEncoder;
-
/**
* Generic mime utility class.
*
@@ -218,15 +217,18 @@
{
public Object readFrom(InputStream in) {
Object converted = null;
+
try
{
- JPEGImageDecoder dec = JPEGCodec.createJPEGDecoder(in);
- BufferedImage bim = dec.decodeAsBufferedImage();
+ ImageReader decoder = ImageIO.getImageReadersByFormatName("JPEG").next();
+ ImageInputStream iis = ImageIO.createImageInputStream(in);
+ decoder.setInput(iis);
+ BufferedImage bim = decoder.read(0);
converted = bim;
}
catch (Exception e)
{
- // ignore
+ e.printStackTrace();
}
return converted;
@@ -235,10 +237,12 @@
public void writeTo(Object obj, OutputStream out) {
if(obj instanceof BufferedImage)
{
- JPEGImageEncoder enc = JPEGCodec.createJPEGEncoder(out);
+ ImageWriter encoder = ImageIO.getImageWritersByFormatName("JPEG").next();
try
{
- enc.encode((BufferedImage)obj);
+ ImageOutputStream ios = ImageIO.createImageOutputStream(out);
+ encoder.setOutput(ios);
+ encoder.write((BufferedImage)obj);
}
catch (IOException e)
{
14 years, 9 months
JBossWS SVN: r11347 - stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-12-22 08:23:39 -0500 (Tue, 22 Dec 2009)
New Revision: 11347
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
Log:
[JBWS-2861] removing obsolete class
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2009-12-21 08:34:06 UTC (rev 11346)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2009-12-22 13:23:39 UTC (rev 11347)
@@ -1,451 +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.core.soap;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPBodyElement;
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-import javax.xml.soap.SOAPHeader;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.util.NotImplementedException;
-import org.jboss.wsf.common.Normalizer;
-import org.w3c.dom.Element;
-
-/**
- * A SOAPEnvelope builder for JAXRPC based on Stax
- *
- * @author Heiko Braun, <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 15-Apr-2006
- */
-public class EnvelopeBuilderStax implements EnvelopeBuilder
-{
- private static final String END_ELEMENT_BRACKET = "</";
- private static final String EMPTY_STRING = "";
- private static final String CLOSING_BRACKET = ">";
- private static final String START_ELEMENT_BRACKET = "<";
- private static final String HEADER_ELEMENT_NAME = "Header";
- private static final String BODY_ELEMENT_NAME = "Body";
- private static final String FAULT_ELEMENT_NAME = "Fault";
-
- private static enum Part
- {
- ENVELOPE, HEADER, BODY, FAULT, RPC_PAYLOAD, DOC_PAYLOAD, BARE_PAYLOAD
- }
-
- private Part currentPart = Part.ENVELOPE;
- private Part previousPart = null;
-
- // saaj
- private SOAPPartImpl soapPart;
- private SOAPEnvelopeImpl soapEnv;
-
- private StringBuffer fragmentBuffer;
- private QName fragmentRootCursor = null;
- private QName currentRootElement = null;
- private XMLStreamReader reader;
-
- private static XMLInputFactory factory;
-
- public EnvelopeBuilderStax()
- {
- resetFragmentBuffer();
- }
-
- private void resetFragmentBuffer()
- {
- this.fragmentBuffer = new StringBuffer();
- this.fragmentBuffer.ensureCapacity(2048);
- }
-
- public SOAPEnvelope build(SOAPMessage soapMessage, InputStream in, boolean ignoreParseError) throws IOException, SOAPException
- {
- try
- {
- reader = getFactoryInstance().createXMLStreamReader(in);
- }
- catch (XMLStreamException e)
- {
- throw new IOException("Failed to create stream reader:" + e.getMessage());
- }
-
- try
- {
- soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
-
- while (reader.hasNext())
- {
-
- if (reader.isStartElement())
- {
- processStartElement();
- }
- else if (reader.isCharacters())
- {
- processCharacters();
- }
- else if (reader.isEndElement())
- {
- processEndElement();
- }
-
- reader.next();
- }
-
- }
- catch (XMLStreamException e)
- {
- if (!ignoreParseError)
- throw new IOException("Failed to parse stream: " + e.getMessage());
- }
- finally
- {
- try
- {
- if (reader != null)
- reader.close();
- }
- catch (XMLStreamException e)
- {
- // ignore
- }
- }
- return soapEnv;
- }
-
- private static synchronized XMLInputFactory getFactoryInstance()
- {
- if (null == factory)
- {
- System.setProperty("javax.xml.stream.XMLInputFactory", "com.ctc.wstx.stax.WstxInputFactory");
- factory = XMLInputFactory.newInstance();
- factory.setProperty(XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
- }
- return factory;
-
- }
-
- private void processCharacters() throws SOAPException
- {
- if (fragmentRootCursor != null)
- consumeCharacters();
- }
-
- private void consumeCharacters() throws SOAPException
- {
-
- String text = Normalizer.normalize(reader.getText());
-
- if (!atPartMargin() && !reader.isWhiteSpace())
- {
-
- fragmentBuffer.append(text);
-
- if (Part.FAULT == currentPart)
- {
- String localName = currentRootElement.getLocalPart();
- SOAPFault fault = soapEnv.getBody().getFault();
- if ("faultcode".equalsIgnoreCase(localName))
- fault.setFaultCode(text);
- else if ("faultactor".equalsIgnoreCase(localName))
- fault.setFaultActor(text);
- else if ("faultstring".equalsIgnoreCase(localName))
- fault.setFaultString(text);
- }
- }
- }
-
- private void processEndElement() throws SOAPException
- {
- if (fragmentRootCursor != null)
- consumeEndElement();
- }
-
- private void consumeEndElement() throws SOAPException
- {
-
- QName qName = reader.getName();
-
- fragmentBuffer.append(END_ELEMENT_BRACKET);
- fragmentBuffer.append(getFQElementName(qName));
- fragmentBuffer.append(CLOSING_BRACKET);
-
- if (fragmentRootCursor != null && fragmentRootCursor.equals(qName))
- {
- flushBuffer();
- fragmentRootCursor = null;
- }
- }
-
- private void flushBuffer() throws SOAPException
- {
- if (Part.HEADER == currentPart)
- {
- SOAPHeader soapHeader = soapEnv.getHeader();
- SOAPContentElement lastHeaderElement = (SOAPContentElement)soapHeader.getChildNodes().item(soapHeader.getChildNodes().getLength() - 1);
- lastHeaderElement.setXMLFragment(bufferToFragment(fragmentBuffer));
- }
- else if (Part.BODY == currentPart)
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPContentElement lastBodyElement = (SOAPContentElement)soapBody.getChildNodes().item(soapBody.getChildNodes().getLength() - 1);
- lastBodyElement.setXMLFragment(bufferToFragment(fragmentBuffer));
- }
- else if (Part.FAULT == currentPart)
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPContentElement faultElement = (SOAPContentElement)soapBody.getFault();
- faultElement.setXMLFragment(bufferToFragment(fragmentBuffer));
- }
-
- resetFragmentBuffer();
- }
-
- // TODO: this is rubbish. Use Source internally instead...
- private XMLFragment bufferToFragment(StringBuffer fragmentBuffer) {
- StreamSource source = new StreamSource(new ByteArrayInputStream(fragmentBuffer.toString().getBytes()));
- return new XMLFragment(source);
- }
-
- private void processStartElement() throws SOAPException
- {
-
- QName qName = reader.getName();
- currentRootElement = qName;
-
- // identify current envelope part
- togglePartMargin(qName);
-
- // toggle current element
- Element destElement = null;
- if (Part.ENVELOPE == currentPart)
- {
- // setup envelope impl
- soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI(), false);
- destElement = soapEnv; // soapEnv becomes current
- }
- else if (Part.HEADER == currentPart)
- {
- if (atPartMargin())
- {
- // the env:Header element itself
- SOAPHeader soapHeader = soapEnv.getHeader();
- destElement = soapHeader; // header becomes current
- previousPart = Part.HEADER;
- }
- else
- {
- // child element of env:Header
- if (fragmentRootCursor == null)
- {
- Name name = new NameImpl(qName.getLocalPart(), qName.getPrefix(), qName.getNamespaceURI());
- SOAPContentElement headerElement = new SOAPHeaderElementImpl(name);
- soapEnv.getHeader().addChildElement(headerElement);
-
- destElement = headerElement; // headerElement becomes current
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
- }
- else if (Part.BODY == currentPart)
- {
-
- SOAPBody soapBody = soapEnv.getBody();
- if (soapBody == null) {
- soapBody = soapEnv.addBody();
- }
- if (atPartMargin())
- {
- // the env:Body element
- destElement = soapBody;
- previousPart = Part.BODY;
- }
- else
- {
- // payload not fault
- Name bodyElementName = new NameImpl(qName.getLocalPart(), qName.getPrefix(), qName.getNamespaceURI());
-
- if (fragmentRootCursor == null)
- {
- SOAPBodyElementDoc docBodyElement = new SOAPBodyElementDoc(bodyElementName);
- docBodyElement = (SOAPBodyElementDoc)soapBody.addChildElement(docBodyElement);
-
- destElement = docBodyElement;
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
- }
- else if (Part.FAULT == currentPart)
- {
- // payload is fault
- if (atPartMargin())
- {
- SOAPBody soapBody = soapEnv.getBody();
- SOAPFaultImpl soapFault = new SOAPFaultImpl(soapEnv.getPrefix(), soapEnv.getNamespaceURI());
- soapBody.addChildElement(soapFault);
- destElement = soapFault;
- previousPart = Part.FAULT;
- }
-
- if (fragmentRootCursor == null)
- {
- fragmentRootCursor = qName;
- }
-
- consumeStartElement();
- }
-
- if (fragmentRootCursor == null) // constructing soap elements
- {
- copyAttributes(destElement);
- }
- }
-
- private void togglePartMargin(QName qName)
- {
- // identify the current part
- if (qName.getLocalPart().equalsIgnoreCase(HEADER_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.HEADER;
- }
- else if (qName.getLocalPart().equalsIgnoreCase(BODY_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.BODY;
- }
- else if (qName.getLocalPart().equalsIgnoreCase(FAULT_ELEMENT_NAME))
- {
- previousPart = currentPart;
- currentPart = Part.FAULT;
- }
- }
-
- private void consumeStartElement()
- {
-
- QName qName = reader.getName();
-
- // element
- fragmentBuffer.append(START_ELEMENT_BRACKET);
- fragmentBuffer.append(getFQElementName(qName));
-
- // local namespaces
- for (int x = 0; x < reader.getNamespaceCount(); x++)
- {
- if (reader.getNamespacePrefix(x) != null)
- {
- fragmentBuffer.append(" xmlns:");
- fragmentBuffer.append(reader.getNamespacePrefix(x)).append("='");
- fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
- }
- else if (reader.getNamespaceURI(x) != null)
- {
- fragmentBuffer.append(" xmlns='");
- fragmentBuffer.append(reader.getNamespaceURI(x)).append("'");
- }
- }
-
- // attributes
- if (reader.getAttributeCount() > 0)
- {
- for (int i = 0; i < reader.getAttributeCount(); i++)
- {
- QName attQName = reader.getAttributeName(i);
- fragmentBuffer.append(" ").append(getFQElementName(attQName));
- fragmentBuffer.append("='").append(reader.getAttributeValue(i)).append("'");
- }
- }
-
- fragmentBuffer.append(CLOSING_BRACKET);
- }
-
- private String getFQElementName(QName qName)
- {
- return !qName.getPrefix().equals(EMPTY_STRING) ? qName.getPrefix() + ":" + qName.getLocalPart() : qName.getLocalPart();
- }
-
- private void copyAttributes(Element destElement)
- {
-
- if (reader.getAttributeCount() == 0)
- return;
-
- for (int i = 0; i < reader.getAttributeCount(); i++)
- {
- destElement.setAttributeNS(reader.getAttributeNamespace(i), reader.getAttributeLocalName(i), reader.getAttributeValue(i));
- }
- }
-
- private boolean atPartMargin()
- {
- return previousPart != currentPart;
- }
-
- public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean ignoreParseError) throws IOException, SOAPException
- {
- throw new NotImplementedException();
- }
-
- public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws SOAPException
- {
- throw new NotImplementedException();
- }
-
- public SOAPBodyElement buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
- {
- throw new NotImplementedException();
- }
-
- public SOAPBodyElement buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
- {
- throw new NotImplementedException();
- }
-
- public Style getStyle()
- {
- throw new NotImplementedException();
- }
-
- public void setStyle(Style style)
- {
- throw new NotImplementedException();
- }
-}
14 years, 9 months
JBossWS SVN: r11346 - stack/cxf/trunk/modules/resources/src/main/resources/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-12-21 03:34:06 -0500 (Mon, 21 Dec 2009)
New Revision: 11346
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/resources/all-deploy.conf
stack/cxf/trunk/modules/resources/src/main/resources/resources/default-deploy.conf
stack/cxf/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf
Log:
updating config
Modified: stack/cxf/trunk/modules/resources/src/main/resources/resources/all-deploy.conf
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/resources/all-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
+++ stack/cxf/trunk/modules/resources/src/main/resources/resources/all-deploy.conf 2009-12-21 08:34:06 UTC (rev 11346)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/all/deploy/jbossws.sar server/all/deploy/jbossws-console.war server/all/deploy/juddi-service.sar server/all/deployers/jbossws.deployer/FastInfoset.jar server/all/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/all/deployers/jbossws.deployer/jbossws-native-core.jar server/all/deployers/jbossws.deployer/jettison.jar server/all/deployers/jbossws.deployer/netty.jar server/all/deployers/jbossws.deployer/policy.jar server/all/deployers/jbossws.deployer/wsdl4j.jar server/all/deployers/jbossws.deployer/xmlsec.jar server/all/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/all/deploy/jbossws.sar server/all/deploy/jbossws-console.war server/all/deploy/juddi-service.sar server/all/deployers/jbossws.deployer/FastInfoset.jar server/all/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/all/deployers/jbossws.deployer/jbossws-native-core.jar server/all/deployers/jbossws.deployer/jettison.jar server/all/deployers/jbossws.deployer/netty.jar server/all/deployers/jbossws.deployer/policy.jar server/all/deployers/jbossws.deployer/wsdl4j.jar server/all/deployers/jbossws.deployer/xmlsec.jar server/all/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/standard-*-config.xml
Modified: stack/cxf/trunk/modules/resources/src/main/resources/resources/default-deploy.conf
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/resources/default-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
+++ stack/cxf/trunk/modules/resources/src/main/resources/resources/default-deploy.conf 2009-12-21 08:34:06 UTC (rev 11346)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/default/deploy/jbossws.sar server/default/deploy/jbossws-console.war server/default/deploy/juddi-service.sar server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/netty.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/default/deploy/jbossws.sar server/default/deploy/jbossws-console.war server/default/deploy/juddi-service.sar server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/netty.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/default/deployers/jbo!
ssws.deployer/META-INF/standard-*-config.xml
Modified: stack/cxf/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
+++ stack/cxf/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf 2009-12-21 08:34:06 UTC (rev 11346)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/standard/deploy/jbossws.sar server/standard/deploy/jbossws-console.war server/standard/deploy/juddi-service.sar server/standard/deployers/jbossws.deployer/FastInfoset.jar server/standard/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/standard/deployers/jbossws.deployer/jbossws-native-core.jar server/standard/deployers/jbossws.deployer/jettison.jar server/standard/deployers/jbossws.deployer/netty.jar server/standard/deployers/jbossws.deployer/policy.jar server/standard/deployers/jbossws.deployer/wsdl4j.jar server/standard/deployers/jbossws.deployer/xmlsec.jar server/standard/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/standard/deploy/jbossws.sar server/standard/deploy/jbossws-console.war server/standard/deploy/juddi-service.sar server/standard/deployers/jbossws.deployer/FastInfoset.jar server/standard/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/standard/deployers/jbossws.deployer/jbossws-native-core.jar server/standard/deployers/jbossws.deployer/jettison.jar server/standard/deployers/jbossws.deployer/netty.jar server/standard/deployers/jbossws.deployer/policy.jar server/standard/deployers/jbossws.deployer/wsdl4j.jar server/standard/deployers/jbossws.deployer/xmlsec.jar server/standard/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/standar!
d/deployers/jbossws.deployer/META-INF/standard-*-config.xml
14 years, 9 months
JBossWS SVN: r11345 - stack/metro/trunk/modules/resources/src/main/resources/resources.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2009-12-21 03:33:45 -0500 (Mon, 21 Dec 2009)
New Revision: 11345
Modified:
stack/metro/trunk/modules/resources/src/main/resources/resources/all-deploy.conf
stack/metro/trunk/modules/resources/src/main/resources/resources/default-deploy.conf
stack/metro/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf
Log:
updating config
Modified: stack/metro/trunk/modules/resources/src/main/resources/resources/all-deploy.conf
===================================================================
--- stack/metro/trunk/modules/resources/src/main/resources/resources/all-deploy.conf 2009-12-21 08:33:13 UTC (rev 11344)
+++ stack/metro/trunk/modules/resources/src/main/resources/resources/all-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/all/deploy/jbossws.sar server/all/deploy/jbossws-console.war server/all/deploy/juddi-service.sar server/all/deployers/jbossws.deployer/FastInfoset.jar server/all/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/all/deployers/jbossws.deployer/jbossws-native-core.jar server/all/deployers/jbossws.deployer/jettison.jar server/all/deployers/jbossws.deployer/netty.jar server/all/deployers/jbossws.deployer/policy.jar server/all/deployers/jbossws.deployer/wsdl4j.jar server/all/deployers/jbossws.deployer/xmlsec.jar server/all/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/all/deploy/jbossws.sar server/all/deploy/jbossws-console.war server/all/deploy/juddi-service.sar server/all/deployers/jbossws.deployer/FastInfoset.jar server/all/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/all/deployers/jbossws.deployer/jbossws-native-core.jar server/all/deployers/jbossws.deployer/jettison.jar server/all/deployers/jbossws.deployer/netty.jar server/all/deployers/jbossws.deployer/policy.jar server/all/deployers/jbossws.deployer/wsdl4j.jar server/all/deployers/jbossws.deployer/xmlsec.jar server/all/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/all/deployers/jbossws.deployer/META-INF/standard-*-config.xml
Modified: stack/metro/trunk/modules/resources/src/main/resources/resources/default-deploy.conf
===================================================================
--- stack/metro/trunk/modules/resources/src/main/resources/resources/default-deploy.conf 2009-12-21 08:33:13 UTC (rev 11344)
+++ stack/metro/trunk/modules/resources/src/main/resources/resources/default-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/default/deploy/jbossws.sar server/default/deploy/jbossws-console.war server/default/deploy/juddi-service.sar server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/netty.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/default/deploy/jbossws.sar server/default/deploy/jbossws-console.war server/default/deploy/juddi-service.sar server/default/deployers/jbossws.deployer/FastInfoset.jar server/default/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/default/deployers/jbossws.deployer/jbossws-native-core.jar server/default/deployers/jbossws.deployer/jettison.jar server/default/deployers/jbossws.deployer/netty.jar server/default/deployers/jbossws.deployer/policy.jar server/default/deployers/jbossws.deployer/wsdl4j.jar server/default/deployers/jbossws.deployer/xmlsec.jar server/default/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/default/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/default/deployers/jbo!
ssws.deployer/META-INF/standard-*-config.xml
Modified: stack/metro/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf
===================================================================
--- stack/metro/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf 2009-12-21 08:33:13 UTC (rev 11344)
+++ stack/metro/trunk/modules/resources/src/main/resources/resources/standard-deploy.conf 2009-12-21 08:33:45 UTC (rev 11345)
@@ -1 +1 @@
-bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common.jar common/lib/jbossws-framework.jar common/lib/jbo!
ssws-spi.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/standard/deploy/jbossws.sar server/standard/deploy/jbossws-console.war server/standard/deploy/juddi-service.sar server/standard/deployers/jbossws.deployer/FastInfoset.jar server/standard/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/standard/deployers/jbossws.deployer/jbossws-native-core.jar server/standard/deployers/jbossws.deployer/jettison.jar server/standard/deployers/jbossws.deployer/netty.jar server/standard/deployers/jbossws.deployer/policy.jar server/standard/deployers/jbossws.deployer/wsdl4j.jar server/standard/deployers/jbossws.deployer/xmlsec.jar server/standard/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/standard-*-config.xml
+bin/wsconsume.bat bin/wsconsume.sh bin/wsprovide.bat bin/wsprovide.sh bin/wsrunclient.bat bin/wsrunclient.sh bin/wstools.bat bin/wstools.sh client/jettison.jar client/jaxb-api.jar client/FastInfoset.jar client/commons-beanutils.jar client/jaxb-impl.jar client/jaxb-xjc.jar client/jaxws-rt.jar client/jaxws-tools.jar client/jbossws-native-jaxrpc.jar client/jbossws-native-jaxws-ext.jar client/jbossws-native-jaxws.jar client/jaxws-api.jar client/jsr181-api.jar client/jbossws-native-saaj.jar client/jbossws-native-client.jar client/jbossws-native-core.jar client/jbossws-common.jar client/jbossws-framework.jar client/jbossws-spi.jar client/netty.jar client/policy.jar client/stax-ex.jar client/streambuffer.jar client/wsdl4j.jar lib/jaxb-api.jar lib/jaxb-impl.jar common/lib/jbossws-native-jaxrpc.jar common/lib/jbossws-native-jaxws-ext.jar common/lib/jbossws-native-jaxws.jar common/lib/jaxws-api.jar common/lib/jsr181-api.jar common/lib/jbossws-native-saaj.jar common/lib/jbossws-common!
.jar common/lib/jbossws-framework.jar common/lib/jbossws-spi.jar common/lib/commons-beanutils.jar lib/endorsed/jbossws-native-* lib/endorsed/jaxb-api.jar server/standard/deploy/jbossws.sar server/standard/deploy/jbossws-console.war server/standard/deploy/juddi-service.sar server/standard/deployers/jbossws.deployer/FastInfoset.jar server/standard/deployers/jbossws.deployer/jboss-jaxb-intros.jar server/standard/deployers/jbossws.deployer/jbossws-native-core.jar server/standard/deployers/jbossws.deployer/jettison.jar server/standard/deployers/jbossws.deployer/netty.jar server/standard/deployers/jbossws.deployer/policy.jar server/standard/deployers/jbossws.deployer/wsdl4j.jar server/standard/deployers/jbossws.deployer/xmlsec.jar server/standard/deployers/jbossws.deployer/META-INF/jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-deployer-jboss-beans.xml server/standard/deployers/jbossws.deployer/META-INF/jbossws-container-jboss-beans.xml server/standar!
d/deployers/jbossws.deployer/META-INF/standard-*-config.xml
14 years, 9 months