You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/10/30 13:11:15 UTC
svn commit: r590048 [7/9] - in /webservices/axis2/branches/java/jaxws21:
legal/ modules/adb-codegen/ modules/adb-codegen/src/org/apache/axis2/schema/
modules/adb-codegen/src/org/apache/axis2/schema/template/
modules/adb-codegen/src/org/apache/axis2/sch...
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/JAXBBlockImpl.java Tue Oct 30 05:10:34 2007
@@ -23,6 +23,7 @@
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.message.Message;
import org.apache.axis2.jaxws.message.attachments.JAXBAttachmentMarshaller;
import org.apache.axis2.jaxws.message.attachments.JAXBAttachmentUnmarshaller;
@@ -33,6 +34,7 @@
import org.apache.axis2.jaxws.message.factory.BlockFactory;
import org.apache.axis2.jaxws.message.impl.BlockImpl;
import org.apache.axis2.jaxws.message.util.XMLStreamWriterWithOS;
+import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -102,9 +104,17 @@
throws XMLStreamException, WebServiceException {
// Get the JAXBBlockContext. All of the necessry information is recorded on it
JAXBBlockContext ctx = (JAXBBlockContext) busContext;
+
+ // retrieve the stored classloader if it is present
+ MessageContext msgContext = getParent() != null ? getParent().getMessageContext() : null;
+ ClassLoader cl = null;
+ if(msgContext != null) {
+ cl = (ClassLoader) msgContext.getProperty(Constants.CACHE_CLASSLOADER);
+ }
try {
// TODO Re-evaluate Unmarshall construction w/ MTOM
- Unmarshaller u = JAXBUtils.getJAXBUnmarshaller(ctx.getJAXBContext());
+
+ Unmarshaller u = JAXBUtils.getJAXBUnmarshaller(ctx.getJAXBContext(cl));
if (DEBUG_ENABLED) {
log.debug("Adding JAXBAttachmentUnmarshaller to Unmarshaller");
@@ -131,7 +141,7 @@
}
// Successfully unmarshalled the object
- JAXBUtils.releaseJAXBUnmarshaller(ctx.getJAXBContext(), u);
+ JAXBUtils.releaseJAXBUnmarshaller(ctx.getJAXBContext(cl), u);
// Don't close the reader. The reader is owned by the caller, and it
// may contain other xml instance data (other than this JAXB object)
@@ -140,7 +150,7 @@
} catch (JAXBException je) {
if (DEBUG_ENABLED) {
try {
- log.debug("JAXBContext for unmarshal failure:" + ctx.getJAXBContext());
+ log.debug("JAXBContext for unmarshal failure:" + ctx.getJAXBContext(cl));
} catch (Exception e) {
}
}
@@ -183,10 +193,17 @@
protected void _outputFromBO(Object busObject, Object busContext, XMLStreamWriter writer)
throws XMLStreamException, WebServiceException {
JAXBBlockContext ctx = (JAXBBlockContext) busContext;
+
+ // retrieve the stored classloader if it is present
+ MessageContext msgContext = getParent() != null ? getParent().getMessageContext() : null;
+ ClassLoader cl = null;
+ if(msgContext != null) {
+ cl = (ClassLoader) msgContext.getProperty(Constants.CACHE_CLASSLOADER);
+ }
try {
// Very easy, use the Context to get the Marshaller.
// Use the marshaller to write the object.
- Marshaller m = JAXBUtils.getJAXBMarshaller(ctx.getJAXBContext());
+ Marshaller m = JAXBUtils.getJAXBMarshaller(ctx.getJAXBContext(cl));
if (DEBUG_ENABLED) {
@@ -213,11 +230,11 @@
}
// Successfully marshalled the data
- JAXBUtils.releaseJAXBMarshaller(ctx.getJAXBContext(), m);
+ JAXBUtils.releaseJAXBMarshaller(ctx.getJAXBContext(cl), m);
} catch (JAXBException je) {
if (DEBUG_ENABLED) {
try {
- log.debug("JAXBContext for marshal failure:" + ctx.getJAXBContext());
+ log.debug("JAXBContext for marshal failure:" + ctx.getJAXBContext(cl));
} catch (Exception e) {
}
}
@@ -232,10 +249,18 @@
* @param jbc
* @throws WebServiceException
*/
- private static QName getQName(Object jaxb, JAXBBlockContext ctx) throws JAXBException {
- JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(ctx.getJAXBContext());
+ private static QName getQName(Object jaxb, JAXBBlockContext ctx, Message msg) throws JAXBException {
+
+ // retrieve the stored classloader if it is present
+ MessageContext msgContext = msg != null ? msg.getMessageContext() : null;
+ ClassLoader cl = null;
+ if(msgContext != null) {
+ cl = (ClassLoader) msgContext.getProperty(Constants.CACHE_CLASSLOADER);
+ }
+
+ JAXBIntrospector jbi = JAXBUtils.getJAXBIntrospector(ctx.getJAXBContext(cl));
QName qName = jbi.getElementName(jaxb);
- JAXBUtils.releaseJAXBIntrospector(ctx.getJAXBContext(), jbi);
+ JAXBUtils.releaseJAXBIntrospector(ctx.getJAXBContext(cl), jbi);
return qName;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/impl/SourceBlockImpl.java Tue Oct 30 05:10:34 2007
@@ -78,6 +78,10 @@
// Dynamically discover if StAXSource is available
staxSource = forName("javax.xml.transform.stax.StAXSource");
} catch (Exception e) {
+ if (log.isDebugEnabled()) {
+ log.debug("StAXSource is not present in the JDK. " +
+ "This is acceptable. Processing continues");
+ }
}
try {
// Woodstox does not work with StAXSource
@@ -106,6 +110,9 @@
(busObject.getClass().equals(staxSource)) ||
busObject instanceof JAXBSource) {
// Okay, these are supported Source objects
+ if (log.isDebugEnabled()) {
+ log.debug("data object is a " + busObject.getClass().getName());
+ }
} else {
throw ExceptionFactory.makeWebServiceException(
Messages.getMessage("SourceNotSupported", busObject.getClass().getName()));
@@ -199,9 +206,19 @@
/** Creates an XMLStreamReader from a Source using a slow but proven algorithm. */
private XMLStreamReader _slow_getReaderFromSource(Source src) throws XMLStreamException {
+ if (log.isDebugEnabled()) {
+ log.debug("Start _slow_getReaderFromSource");
+ }
byte[] bytes = (byte[]) ConvertUtils.convert(src, byte[].class);
+ if (log.isDebugEnabled()) {
+ log.debug("Successfully converted to ByteArray");
+ }
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
- return StAXUtils.createXMLStreamReader(bais);
+ XMLStreamReader reader = StAXUtils.createXMLStreamReader(bais);
+ if (log.isDebugEnabled()) {
+ log.debug("End _slow_getReaderFromSource =" + reader);
+ }
+ return reader;
}
@Override
@@ -209,8 +226,17 @@
throws XMLStreamException, WebServiceException {
// There is no fast way to output the Source to a writer, so get the reader
// and pass use the default reader->writer.
+ if (log.isDebugEnabled()) {
+ log.debug("Start _outputFromBO");
+ }
XMLStreamReader reader = _getReaderFromBO(busObject, busContext);
+ if (log.isDebugEnabled()) {
+ log.debug("Obtained reader=" + reader);
+ }
_outputFromReader(reader, writer);
+ if (log.isDebugEnabled()) {
+ log.debug("End _outputReaderFromBO");
+ }
// REVIEW Should we call close() on the Source ?
}
@@ -339,11 +365,19 @@
public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
+ if (log.isDebugEnabled()) {
+ log.debug("Start getXMLBytes");
+ }
+ byte[] bytes = null;
try {
- return (byte[])
+ bytes = (byte[])
ConvertUtils.convert(getBusinessObject(false), byte[].class);
} catch (XMLStreamException e) {
throw ExceptionFactory.makeWebServiceException(e);
}
+ if (log.isDebugEnabled()) {
+ log.debug("End getXMLBytes");
+ }
+ return bytes;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/BlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/BlockImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/BlockImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/impl/BlockImpl.java Tue Oct 30 05:10:34 2007
@@ -322,6 +322,9 @@
public void outputTo(XMLStreamWriter writer, boolean consume)
throws XMLStreamException, WebServiceException {
+ if (log.isDebugEnabled()) {
+ log.debug("Start outputTo");
+ }
if (consumed) {
// In some scenarios, the message is written out after the service instance is invoked.
// In these situations, it is preferable to simply ignore this block.
@@ -333,15 +336,27 @@
}
if (omElement != null) {
if (consume) {
+ if (log.isDebugEnabled()) {
+ log.debug("Write using OMElement.serializeAndConsume");
+ }
omElement.serializeAndConsume(writer);
} else {
+ if (log.isDebugEnabled()) {
+ log.debug("Write Using OMElement.serialize");
+ }
omElement.serialize(writer);
}
} else if (busObject != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Write business object");
+ }
busObject = _getBOFromBO(busObject, busContext, consume);
_outputFromBO(busObject, busContext, writer);
}
setConsumed(consume);
+ if (log.isDebugEnabled()) {
+ log.debug("End outputTo");
+ }
return;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/Reader.java Tue Oct 30 05:10:34 2007
@@ -28,6 +28,8 @@
import javax.xml.stream.XMLStreamReader;
import javax.xml.ws.WebServiceException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* Reader In many situations, you want the ability to reset an XMLStreamReader. (Or at least ask if
* the XMLStreamReader is resettable).
@@ -41,6 +43,8 @@
public abstract class Reader implements XMLStreamReader {
protected XMLStreamReader reader;
private final boolean resettable;
+ private static final Log log = LogFactory.getLog(Reader.class);
+ private static final boolean isDebug = log.isDebugEnabled();
/**
* @param reader
@@ -64,195 +68,338 @@
* @return true or false
*/
public boolean isResettable() {
+ debug("Entering isResettable....");
+ debug("resettable = "+resettable);
return resettable;
}
public void reset() throws WebServiceException {
+ debug("Entering reset....");
if (!resettable) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("resetReaderErr"));
}
reader = newReader();
+
+ debug("Exiting reset....");
}
public void close() throws XMLStreamException {
+ debug("Entering close....");
reader.close();
+ debug("Exiting close....");
}
public int getAttributeCount() {
- return reader.getAttributeCount();
+ debug("Entering getAttributeCount....");
+ int ac = reader.getAttributeCount();
+ debug("reader.getAttributeCount() = "+ac);
+ return ac;
}
public String getAttributeLocalName(int arg0) {
- return reader.getAttributeLocalName(arg0);
+ debug("Entering getAttributeLocalName....");
+ String aln = reader.getAttributeLocalName(arg0);
+ debug("reader.getAttributeLocalName(arg0) = "+aln);
+ return aln;
}
public QName getAttributeName(int arg0) {
- return reader.getAttributeName(arg0);
+ debug("Entering getAttributeName....");
+ QName q = reader.getAttributeName(arg0);
+ debug("reader.getAttributeName(arg0) = "+q);
+ return q;
}
public String getAttributeNamespace(int arg0) {
- return reader.getAttributeNamespace(arg0);
+ debug("Entering getAttributeNamespace....");
+ String an = reader.getAttributeNamespace(arg0);
+ debug("reader.getAttributeNamespace(arg0) = "+an);
+ return an;
}
public String getAttributePrefix(int arg0) {
- return reader.getAttributePrefix(arg0);
+ debug("Entering getAttributePrefix....");
+ String ap = reader.getAttributePrefix(arg0);
+ debug("reader.getAttributePrefix(arg0) = "+ap);
+ return ap;
}
public String getAttributeType(int arg0) {
- return reader.getAttributeType(arg0);
+ debug("Entering getAttributeType....");
+ String at = reader.getAttributeType(arg0);
+ debug("reader.getAttributeType(arg0) = "+at);
+ return at;
}
public String getAttributeValue(int arg0) {
- return reader.getAttributeValue(arg0);
+ debug("Entering getAttributeValue....");
+ String av = reader.getAttributeValue(arg0);
+ debug("reader.getAttributeValue(arg0) = "+av);
+ return av;
}
public String getAttributeValue(String arg0, String arg1) {
- return reader.getAttributeValue(arg0, arg1);
+ debug("Entering getAttributeValue....");
+ String av = reader.getAttributeValue(arg0, arg1);
+ debug("reader.getAttributeValue(arg0, arg1) = "+av);
+ return av;
}
public String getCharacterEncodingScheme() {
- return reader.getCharacterEncodingScheme();
+ debug("Entering getCharacterEncodingScheme....");
+ String ces = reader.getCharacterEncodingScheme();
+ debug("reader.getCharacterEncodingScheme = "+ces);
+ return ces;
}
public String getElementText() throws XMLStreamException {
- return reader.getElementText();
+ debug("Entering getElementText....");
+ String et = reader.getElementText();
+ debug("reader.getElementText = "+et);
+ return et;
}
public String getEncoding() {
- return reader.getEncoding();
+ debug("Entering getEncoding....");
+ String e = reader.getEncoding();
+ debug("reader.getEncoding() = "+e);
+ return e;
}
public int getEventType() {
- return reader.getEventType();
+ debug("Entering getEventType....");
+ int et = reader.getEventType();
+ debug("reader.getEventType() = "+et);
+ return et;
}
public String getLocalName() {
- return reader.getLocalName();
+ debug("Entering getLocation....");
+ String ln = reader.getLocalName();
+ debug("reader.getLocalName() = "+ln);
+ return ln;
}
public Location getLocation() {
- return reader.getLocation();
+ debug("Entering getLocation....");
+ Location l = reader.getLocation();
+ debug("reader.getLocation() = "+l);
+ return l;
}
public QName getName() {
- return reader.getName();
+ debug("Entering getName....");
+ QName qn = reader.getName();
+ debug("reader.getName() = "+qn);
+ return qn;
}
public NamespaceContext getNamespaceContext() {
- return reader.getNamespaceContext();
+ debug("Entering getNamespaceContext....");
+ NamespaceContext nsContext = reader.getNamespaceContext();
+ debug("reader.getNamespaceContext() = "+nsContext);
+ return nsContext;
}
public int getNamespaceCount() {
- return reader.getNamespaceCount();
+ debug("Entering getNamespaceCount....");
+ int nsCount = reader.getNamespaceCount();
+ debug("reader.getNamespaceCount() = "+nsCount);
+ return nsCount;
}
public String getNamespacePrefix(int arg0) {
- return reader.getNamespacePrefix(arg0);
+ debug("Entering getNamespacePrefix....");
+ String nsPrefix = reader.getNamespacePrefix(arg0);
+ debug("reader.getNamespacePrefix(arg0 = "+nsPrefix);
+ return nsPrefix;
}
public String getNamespaceURI() {
- return reader.getNamespaceURI();
+ debug("Entering getNamespaceURI....");
+ String nsUri = reader.getNamespaceURI();
+ debug("reader.getNamespaceURI() = "+nsUri);
+ return nsUri;
}
public String getNamespaceURI(int arg0) {
- return reader.getNamespaceURI(arg0);
+ debug("Entering getNamespaceURI....");
+ String nsUri = reader.getNamespaceURI(arg0);
+ debug("reader.getNamespaceURI(arg0) = "+nsUri);
+ return nsUri;
}
public String getNamespaceURI(String arg0) {
- return reader.getNamespaceURI(arg0);
+ debug("Entering getNamespaceURI....");
+ String nsUri = reader.getNamespaceURI(arg0);
+ debug("reader.getNamespaceURI(arg0) = "+nsUri);
+ return nsUri;
}
public String getPIData() {
- return reader.getPIData();
+ debug("Entering getPIData....");
+ String pid = reader.getPIData();
+ debug("reader.getPIData() = "+pid);
+ return pid;
}
public String getPITarget() {
- return reader.getPITarget();
+ debug("Entering getPITarget....");
+ String pit = reader.getPITarget();
+ debug("reader.getPITarget() = "+pit);
+ return pit;
}
public String getPrefix() {
- return reader.getPrefix();
+ debug("Entering getPrefix....");
+ String gpf = reader.getPrefix();
+ debug("reader.getPrefix() = "+gpf);
+ return gpf;
}
public Object getProperty(String arg0) throws IllegalArgumentException {
- return reader.getProperty(arg0);
+ debug("Entering getProperty....");
+ Object o = reader.getProperty(arg0);
+ debug("reader.getProperty(arg0) = "+o);
+ return o;
}
public String getText() {
- return reader.getText();
+ debug("Entering getText....");
+ String gt = reader.getText();
+ debug("reader.getText() = "+gt);
+ return gt;
}
public char[] getTextCharacters() {
- return reader.getTextCharacters();
+ debug("Entering getTextCharacters....");
+ char[] gtc = reader.getTextCharacters();
+ debug("reader.getTextCharacters() = "+gtc.toString());
+ return gtc;
}
- public int getTextCharacters(int arg0, char[] arg1, int arg2, int arg3)
- throws XMLStreamException {
- return reader.getTextCharacters(arg0, arg1, arg2, arg3);
+ public int getTextCharacters(int arg0, char[] arg1, int arg2, int arg3) throws XMLStreamException {
+ debug("Entering getTextCharacters....");
+ int gtc = reader.getTextCharacters(arg0, arg1, arg2, arg3);
+ debug("reader.getTextCharacters() = "+gtc);
+ return gtc;
}
public int getTextLength() {
- return reader.getTextLength();
+ debug("Entering getTextLength....");
+ int gtl = reader.getTextLength();
+ debug("reader.getTextLength() = "+gtl);
+ return gtl;
}
public int getTextStart() {
+ debug("Entering getTextStart....");
+ int gts = reader.getTextStart();
+ debug("reader.getTextStart() = "+gts);
return reader.getTextStart();
}
public String getVersion() {
- return reader.getVersion();
+ debug("Entering getVersion....");
+ String gv = reader.getVersion();
+ debug("reader.getVersion() = "+gv);
+ return gv;
}
public boolean hasName() {
- return reader.hasName();
+ debug("Entering hasName....");
+ boolean b = reader.hasName();
+ debug("reader.hasName() = "+b);
+ return b;
}
public boolean hasNext() throws XMLStreamException {
- return reader.hasNext();
+ debug("Entering hasNext....");
+ boolean b = reader.hasNext();
+ debug("reader.hasNext() = "+b);
+ return b;
}
public boolean hasText() {
- return reader.hasText();
+ debug("Entering hasText....");
+ boolean b = reader.hasText();
+ debug("reader.hasText() = "+b);
+ return b;
}
public boolean isAttributeSpecified(int arg0) {
- return reader.isAttributeSpecified(arg0);
+ debug("Entering isAttributeSpecified....");
+ boolean b = reader.isAttributeSpecified(arg0);
+ debug("Entering reader.isAttributeSpecified(arg0) "+b);
+ return b;
}
public boolean isCharacters() {
- return reader.isCharacters();
+ debug("Entering isCharacters....");
+ boolean b = reader.isCharacters();
+ debug("reader.isCharacters() = "+b);
+ return b;
}
public boolean isEndElement() {
- return reader.isEndElement();
+ debug("Entering isEndElement....");
+ boolean b = reader.isEndElement();
+ debug("reader.isEndElement() = "+b);
+ return b;
}
public boolean isStandalone() {
- return reader.isStandalone();
+ debug("Entering isStandalone....");
+ boolean b = reader.isStandalone();
+ debug("reader.isStandalone() = "+b);
+ return b;
}
public boolean isStartElement() {
- return reader.isStartElement();
+ debug("Entering isStartElement....");
+ boolean b = reader.isStartElement();
+ debug("reader.isStartElement() = "+b);
+ return b;
}
public boolean isWhiteSpace() {
- return reader.isWhiteSpace();
+ debug("Entering isWhiteSpace....");
+ boolean b = reader.isWhiteSpace();
+ debug("reader.isWhiteSpace() = "+b);
+ return b;
}
public int next() throws XMLStreamException {
- return reader.next();
+ debug("Entering next....");
+ int nxt = reader.next();
+ debug("reader.next() = "+nxt);
+ return nxt;
}
public int nextTag() throws XMLStreamException {
- return reader.nextTag();
+ debug("Entering nextTag....");
+ int tag = reader.nextTag();
+ debug("reader.nextTag() = "+tag);
+ return tag;
}
public void require(int arg0, String arg1, String arg2) throws XMLStreamException {
+ debug("Entering require....");
+ debug("reader.require -> arg0 = "+arg0+" ,arg1 = "+arg1+" ,arg2 = "+arg2);
reader.require(arg0, arg1, arg2);
}
public boolean standaloneSet() {
- return reader.standaloneSet();
+ debug("Entering standaloneSet....");
+ boolean b = reader.standaloneSet();
+ debug("reader.standaloneSet() = "+b);
+ return b;
+ }
+
+ public void debug(String str) {
+ if (isDebug) {
+ log.debug(str);
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/message/util/XMLFaultUtils.java Tue Oct 30 05:10:34 2007
@@ -591,7 +591,7 @@
try {
converter.toSAAJ(blocks[i].getOMElement(), detail);
} catch (XMLStreamException xse) {
- ExceptionFactory.makeWebServiceException(xse);
+ throw ExceptionFactory.makeWebServiceException(xse);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/registry/FactoryRegistry.java Tue Oct 30 05:10:34 2007
@@ -41,6 +41,8 @@
import org.apache.axis2.jaxws.message.impl.MessageFactoryImpl;
import org.apache.axis2.jaxws.message.impl.XMLPartFactoryImpl;
import org.apache.axis2.jaxws.message.util.impl.SAAJConverterFactoryImpl;
+import org.apache.axis2.jaxws.server.ServiceInstanceFactory;
+import org.apache.axis2.jaxws.server.ServiceInstanceFactoryImpl;
import org.apache.axis2.jaxws.server.dispatcher.factory.EndpointDispatcherFactory;
import org.apache.axis2.jaxws.server.dispatcher.factory.EndpointDispatcherFactoryImpl;
import org.apache.axis2.jaxws.server.endpoint.lifecycle.factory.EndpointLifecycleManagerFactory;
@@ -72,6 +74,7 @@
table.put(JAXWSEndpointReferenceFactory.class, new JAXWSEndpointReferenceFactoryImpl());
table.put(Axis2EndpointReferenceFactory.class, new Axis2EndpointReferenceFactoryImpl());
table.put(ExecutorFactory.class, new JAXWSExecutorFactory());
+ table.put(ServiceInstanceFactory.class, new ServiceInstanceFactoryImpl());
}
/** FactoryRegistry is currently a static singleton */
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/ArtifactProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/ArtifactProcessor.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/ArtifactProcessor.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/ArtifactProcessor.java Tue Oct 30 05:10:34 2007
@@ -181,7 +181,7 @@
faultBeanLocalName = aDesc.getXmlRootElementName();
}
} catch (Throwable t) {
- ExceptionFactory.makeWebServiceException(t);
+ throw ExceptionFactory.makeWebServiceException(t);
}
}
}
@@ -204,7 +204,7 @@
faultBeanNamespace = aDesc.getXmlRootElementNamespace();
}
} catch (Throwable t) {
- ExceptionFactory.makeWebServiceException(t);
+ throw ExceptionFactory.makeWebServiceException(t);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionBuilder.java Tue Oct 30 05:10:34 2007
@@ -68,7 +68,7 @@
try {
artifactProcessor.build();
} catch (Throwable t) {
- ExceptionFactory.makeWebServiceException(t);
+ throw ExceptionFactory.makeWebServiceException(t);
}
marshalDesc.setRequestWrapperMap(artifactProcessor.getRequestWrapperMap());
marshalDesc.setResponseWrapperMap(artifactProcessor.getResponseWrapperMap());
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/MarshalServiceRuntimeDescriptionImpl.java Tue Oct 30 05:10:34 2007
@@ -111,7 +111,7 @@
try {
pdMap = XMLRootElementUtil.createPropertyDescriptorMap(cls);
} catch (Throwable t) {
- ExceptionFactory.makeWebServiceException(t);
+ throw ExceptionFactory.makeWebServiceException(t);
}
return pdMap;
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java Tue Oct 30 05:10:34 2007
@@ -119,7 +119,7 @@
Set<String> pkgSet = sr.readPackagesFromSchema(wsdlDefinition);
set.addAll(pkgSet);
} catch (SchemaReaderException e) {
- ExceptionFactory.makeWebServiceException(e);
+ throw ExceptionFactory.makeWebServiceException(e);
}
}
}
@@ -454,7 +454,10 @@
}
});
} catch (PrivilegedActionException e) {
- ExceptionFactory.makeWebServiceException(e.getException());
+ // Swallow and continue
+ if (log.isDebugEnabled()) {
+ log.debug("Exception getting wsdlLocation: " +e.getException());
+ }
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PropertyDescriptorMapBuilder.java Tue Oct 30 05:10:34 2007
@@ -193,7 +193,7 @@
XMLRootElementUtil.createPropertyDescriptorMap(cls);
map.put(cls, pdMap);
} catch (Throwable t) {
- ExceptionFactory.makeWebServiceException(t);
+ throw ExceptionFactory.makeWebServiceException(t);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java Tue Oct 30 05:10:34 2007
@@ -210,8 +210,9 @@
try {
// Get the service instance. This will run the @PostConstruct code.
- EndpointLifecycleManager elm = createEndpointlifecycleManager();
- Object serviceInstance = elm.createServiceInstance(request, serviceEndpoint);
+ ServiceInstanceFactory instanceFactory = (ServiceInstanceFactory)
+ FactoryRegistry.getFactory(ServiceInstanceFactory.class);
+ Object serviceInstance = instanceFactory.createServiceInstance(request, serviceEndpoint);
// The application handlers and dispatcher invoke will
// modify/destroy parts of the message. Make sure to save
@@ -231,7 +232,7 @@
log.debug("JAX-WS inbound handler chain invocation complete.");
}
// Set the dispatcher.
- EndpointDispatcher dispatcher = getEndpointDispatcher(serviceEndpoint, serviceInstance);
+ EndpointDispatcher dispatcher = getEndpointDispatcher(request, serviceEndpoint, serviceInstance);
eic.setEndpointDispatcher(dispatcher);
return true;
} else { // the inbound handler chain must have had a problem, and we've reversed directions
@@ -295,9 +296,15 @@
*/
protected EndpointDispatcher getEndpointDispatcher(Class serviceImplClass, Object serviceInstance)
throws Exception {
+ return getEndpointDispatcher(null, serviceImplClass, serviceInstance);
+ }
+
+ protected EndpointDispatcher getEndpointDispatcher(MessageContext mc, Class serviceImplClass,
+ Object serviceInstance)
+ throws Exception {
EndpointDispatcherFactory factory =
(EndpointDispatcherFactory)FactoryRegistry.getFactory(EndpointDispatcherFactory.class);
- return factory.createEndpointDispatcher(serviceImplClass, serviceInstance);
+ return factory.createEndpointDispatcher(mc, serviceImplClass, serviceInstance);
}
private String getServiceImplClassName(MessageContext mc) {
@@ -335,7 +342,7 @@
//rather than just Exception.
} catch (Throwable cnf) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage(
- "EndpointControllerErr4", className));
+ "EndpointControllerErr4", className), cnf);
}
}
@@ -358,7 +365,8 @@
);
} catch (PrivilegedActionException e) {
if (log.isDebugEnabled()) {
- log.debug("Exception thrown from AccessController: " + e);
+ log.debug("PrivilegedActionException thrown from AccessController: " + e);
+ log.debug("Real Cause is " + e.getException().getCause());
}
throw (ClassNotFoundException)e.getException();
}
@@ -464,7 +472,7 @@
Message msg = mf.createFrom(xmlreader, protocol);
requestMsgContext.setMessage(msg);
} catch (Throwable e) {
- ExceptionFactory.makeWebServiceException(e);
+ throw ExceptionFactory.makeWebServiceException(e);
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/JAXWSMessageReceiver.java Tue Oct 30 05:10:34 2007
@@ -97,6 +97,7 @@
EndpointController endpointCtlr = new EndpointController();
MessageContext requestMsgCtx = new MessageContext(axisRequestMsgCtx);
+ requestMsgCtx.setServer(true);
requestMsgCtx.setMEPContext(new MEPContext(requestMsgCtx));
// The adapters need to be installed on the new request Message Context
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaBeanDispatcher.java Tue Oct 30 05:10:34 2007
@@ -33,8 +33,11 @@
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.server.EndpointCallback;
import org.apache.axis2.jaxws.server.EndpointInvocationContext;
+import org.apache.axis2.jaxws.server.ServerConstants;
import org.apache.axis2.jaxws.server.endpoint.Utils;
+import org.apache.axis2.jaxws.spi.Constants;
import org.apache.axis2.jaxws.utility.ExecutorFactory;
+import org.apache.axis2.jaxws.utility.SingleThreadedExecutor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -128,17 +131,32 @@
log.debug("JavaBeanDispatcher about to invoke using OperationDesc: "
+ operationDesc.toString());
}
-
- ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
- Executor executor = ef.getExecutorInstance();
EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
- AsyncInvocationWorker worker = new AsyncInvocationWorker(target, methodInputParams, cl, eic);
+ AsyncInvocationWorker worker = new AsyncInvocationWorker(target,
+ methodInputParams,
+ cl, eic);
FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
- executor.execute(task);
+ ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
+ Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
+
+ // If the property has been set to disable thread switching, then we can
+ // do so by using a SingleThreadedExecutor instance to continue processing
+ // work on the existing thread.
+ Boolean disable = (Boolean)
+ request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
+ if (disable != null && disable.booleanValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Server side thread switch disabled. " +
+ "Setting Executor to the SingleThreadedExecutor.");
+ }
+ executor = new SingleThreadedExecutor();
+ }
+
+ executor.execute(task);
return;
}
@@ -161,14 +179,25 @@
log.debug("JavaBeanDispatcher about to invoke using OperationDesc: "
+ operationDesc.toString());
}
- ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
- Executor executor = ef.getExecutorInstance();
EndpointInvocationContext eic = (EndpointInvocationContext) request.getInvocationContext();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
AsyncInvocationWorker worker = new AsyncInvocationWorker(target, methodInputParams, cl, eic);
FutureTask task = new FutureTask<AsyncInvocationWorker>(worker);
+
+ ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
+ Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
+ // If the property has been set to disable thread switching, then we can
+ // do so by using a SingleThreadedExecutor instance to continue processing
+ // work on the existing thread.
+ Boolean disable = (Boolean) request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
+ if (disable != null && disable.booleanValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Server side thread switch disabled. Setting Executor to the SingleThreadedExecutor.");
+ }
+ executor = new SingleThreadedExecutor();
+ }
executor.execute(task);
return;
@@ -198,14 +227,21 @@
}
private MethodMarshaller getMethodMarshaller(Protocol protocol,
- OperationDescription operationDesc) {
+ OperationDescription operationDesc,
+ MessageContext mc) {
javax.jws.soap.SOAPBinding.Style styleOnSEI =
endpointDesc.getEndpointInterfaceDescription().getSoapBindingStyle();
javax.jws.soap.SOAPBinding.Style styleOnMethod = operationDesc.getSoapBindingStyle();
if (styleOnMethod != null && styleOnSEI != styleOnMethod) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("proxyErr2"));
}
- return MethodMarshallerFactory.getMarshaller(operationDesc, false);
+
+ // check for a stored classloader to be used as the cache key
+ ClassLoader cl = null;
+ if(mc != null) {
+ cl = (ClassLoader) mc.getProperty(Constants.CACHE_CLASSLOADER);
+ }
+ return MethodMarshallerFactory.getMarshaller(operationDesc, false, cl);
}
protected Method getJavaMethod(MessageContext mc, Class serviceImplClass) {
@@ -230,7 +266,8 @@
// the "style" and "use" of the WSDL.
Protocol requestProtocol = request.getMessage().getProtocol();
MethodMarshaller methodMarshaller =
- getMethodMarshaller(requestProtocol, request.getOperationDescription());
+ getMethodMarshaller(requestProtocol, request.getOperationDescription(),
+ request);
// The MethodMarshaller will return the input parameters that are needed to
// invoke the target method.
@@ -257,7 +294,8 @@
// Create the appropriate response message, using the protocol from the
// request message.
- MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription());
+ MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
+ request);
Message m = null;
if (method.getReturnType().getName().equals("void")) {
m = marshaller.marshalResponse(null, params, operationDesc, p);
@@ -291,7 +329,9 @@
}
public MessageContext createFaultResponse(MessageContext request, Protocol p, Throwable t) {
- MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription());
+
+ MethodMarshaller marshaller = getMethodMarshaller(p, request.getOperationDescription(),
+ request);
Message m = marshaller.marshalFaultResponse(t, request.getOperationDescription(), p);
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaDispatcher.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaDispatcher.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/JavaDispatcher.java Tue Oct 30 05:10:34 2007
@@ -23,9 +23,12 @@
import org.apache.axis2.jaxws.server.EndpointCallback;
import org.apache.axis2.jaxws.server.EndpointInvocationContext;
import org.apache.axis2.jaxws.utility.ClassUtils;
+import org.apache.axis2.jaxws.utility.FailureLogger;
+import org.apache.axis2.transport.TransportUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.concurrent.Callable;
/**
@@ -59,15 +62,29 @@
return serviceImplClass;
}
- protected Object invokeTargetOperation(Method method, Object[] params) throws Exception {
+ protected Object invokeTargetOperation(Method method, Object[] params) throws Throwable {
Object output = null;
try {
output = method.invoke(serviceInstance, params);
- } catch (Exception t) {
+ } catch (Throwable t) {
+ Throwable rootT = null;
+ if (t instanceof InvocationTargetException) {
+ rootT = ((InvocationTargetException) t).getTargetException();
+ }
+
+ // Minimal Logging to aid servicability.
+ // Only the error and the stack is logged.
+ FailureLogger.logError((rootT != null) ? rootT : t,
+ false);
+
+ // Full logging if debug is enabled.
if (log.isDebugEnabled()) {
log.debug("Exception invoking a method of " + serviceImplClass.toString()
+ " of instance " + serviceInstance.toString());
log.debug("Exception type thrown: " + t.getClass().getName());
+ if (rootT != null) {
+ log.debug("Root Exception type thrown: " + rootT.getClass().getName());
+ }
log.debug("Method = " + method.toGenericString());
for (int i = 0; i < params.length; i++) {
String value =
@@ -99,79 +116,91 @@
}
public Object call() throws Exception {
- if (log.isDebugEnabled()) {
- log.debug("Invoking target endpoint via the async worker.");
- }
-
- // Set the proper class loader so that we can properly marshall the
- // outbound response.
- ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
- if (classLoader != null) {
- Thread.currentThread().setContextClassLoader(classLoader);
- if (log.isDebugEnabled()) {
- log.debug("Context ClassLoader set to:" + classLoader);
- }
- }
-
- // We have the method that is going to be invoked and the parameter data to invoke it
- // with, so just invoke the operation.
- Object output = null;
- boolean faultThrown = false;
- Throwable fault = null;
try {
- output = invokeTargetOperation(method, params);
- }
- catch (Exception e) {
- fault = ClassUtils.getRootCause(e);
- faultThrown = true;
- }
-
- // If this is a one way invocation, we are done and just need to return.
- if (eic.isOneWay()) {
if (log.isDebugEnabled()) {
- log.debug("Invocation pattern was one way, work complete.");
+ log.debug("Invoking target endpoint via the async worker.");
+ }
+
+ // Set the proper class loader so that we can properly marshall the
+ // outbound response.
+ ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
+ if (classLoader != null && (classLoader != currentLoader)) {
+ Thread.currentThread().setContextClassLoader(classLoader);
+ if (log.isDebugEnabled()) {
+ log.debug("Context ClassLoader set to:" + classLoader);
+ }
+ }
+
+ // We have the method that is going to be invoked and the parameter data to invoke it
+ // with, so just invoke the operation.
+ Object output = null;
+ boolean faultThrown = false;
+ Throwable fault = null;
+ try {
+ output = invokeTargetOperation(method, params);
+ }
+ catch (Exception e) {
+ fault = ClassUtils.getRootCause(e);
+ faultThrown = true;
+ }
+
+ // If this is a one way invocation, we are done and just need to return.
+ if (eic.isOneWay()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Invocation pattern was one way, work complete.");
+ }
return null;
}
- }
-
- // Create the response MessageContext
- MessageContext request = eic.getRequestMessageContext();
- MessageContext response = null;
- if (faultThrown) {
- // If a fault was thrown, we need to create a slightly different
- // MessageContext, than in the response path.
- response = createFaultResponse(request, fault);
- } else {
+
+ // Create the response MessageContext
+ MessageContext request = eic.getRequestMessageContext();
+ MessageContext response = null;
+ if (faultThrown) {
+ // If a fault was thrown, we need to create a slightly different
+ // MessageContext, than in the response path.
+ response = createFaultResponse(request, fault);
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Async invocation of the endpoint was successful. Creating response message.");
+ }
+ response = createResponse(request, params, output);
+ }
+
+ EndpointInvocationContext eic = null;
+ if (request.getInvocationContext() != null) {
+ eic = (EndpointInvocationContext) request.getInvocationContext();
+ eic.setResponseMessageContext(response);
+ }
+
+ EndpointCallback callback = eic.getCallback();
+ boolean handleFault = response.getMessage().isFault();
+ if (!handleFault) {
+ if (log.isDebugEnabled()) {
+ log.debug("No fault detected in response message, sending back application response.");
+ }
+ callback.handleResponse(eic);
+ }
+ else {
+ if (log.isDebugEnabled()) {
+ log.debug("A fault was detected. Sending back a fault response.");
+ }
+ callback.handleFaultResponse(eic);
+ }
+
+ // Set the thread's ClassLoader back to what it originally was.
+ Thread.currentThread().setContextClassLoader(currentLoader);
+
+ // Clean up the cached attachments from the request and the response.
+ TransportUtils.deleteAttachments(eic.getRequestMessageContext().getAxisMessageContext());
+ TransportUtils.deleteAttachments(eic.getResponseMessageContext().getAxisMessageContext());
+ } catch (Throwable e) {
+ // Exceptions are swallowed, there is no reason to rethrow them
if (log.isDebugEnabled()) {
- log.debug("Async invocation of the endpoint was successful. Creating response message.");
+ log.debug("AN UNEXPECTED ERROR OCCURRED IN THE ASYNC WORKER THREAD");
+ log.debug("Exception is:" + e, e);
}
- response = createResponse(request, params, output);
}
- EndpointInvocationContext eic = null;
- if (request.getInvocationContext() != null) {
- eic = (EndpointInvocationContext) request.getInvocationContext();
- eic.setResponseMessageContext(response);
- }
-
- EndpointCallback callback = eic.getCallback();
- boolean handleFault = response.getMessage().isFault();
- if (!handleFault) {
- if (log.isDebugEnabled()) {
- log.debug("No fault detected in response message, sending back application response.");
- }
- callback.handleResponse(eic);
- }
- else {
- if (log.isDebugEnabled()) {
- log.debug("A fault was detected. Sending back a fault response.");
- }
- callback.handleFaultResponse(eic);
- }
-
- // Set the thread's ClassLoader back to what it originally was.
- Thread.currentThread().setContextClassLoader(currentLoader);
-
return null;
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/dispatcher/ProviderDispatcher.java Tue Oct 30 05:10:34 2007
@@ -19,6 +19,7 @@
package org.apache.axis2.jaxws.server.dispatcher;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.context.utils.ContextUtils;
import org.apache.axis2.jaxws.core.MessageContext;
import org.apache.axis2.jaxws.core.util.MessageContextUtils;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -36,8 +37,10 @@
import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.server.EndpointCallback;
import org.apache.axis2.jaxws.server.EndpointInvocationContext;
+import org.apache.axis2.jaxws.server.ServerConstants;
import org.apache.axis2.jaxws.utility.ClassUtils;
import org.apache.axis2.jaxws.utility.ExecutorFactory;
+import org.apache.axis2.jaxws.utility.SingleThreadedExecutor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -71,14 +74,11 @@
private static Log log = LogFactory.getLog(ProviderDispatcher.class);
- private BlockFactory blockFactory = null;
- private Class providerType = null;
+ private BlockFactory _blockFactory = null; // Cache the block factory
+ private Class _providerType = null; // Cache the provider type
private Provider providerInstance = null;
- private Service.Mode providerServiceMode = null;
private Message message = null;
- private Protocol messageProtocol;
-
- private EndpointDescription endpointDesc;
+ private EndpointDescription endpointDesc = null;
/**
* Constructor
@@ -99,11 +99,14 @@
log.debug("Invocation pattern: two way, sync");
}
+ initialize(request);
+
providerInstance = getProviderInstance();
Object param = createRequestParameters(request);
if (log.isDebugEnabled()) {
+ Class providerType = getProviderType();
final Object input = providerType.cast(param);
log.debug("Invoking Provider<" + providerType.getName() + ">");
if (input != null) {
@@ -125,9 +128,6 @@
fault = ClassUtils.getRootCause(e);
faultThrown = true;
}
-
- // TODO (NLG): Need to find a better way to sync this across both Dispatchers.
- endpointDesc = request.getEndpointDescription();
// Create the response MessageContext
MessageContext responseMsgCtx = null;
@@ -148,11 +148,14 @@
log.debug("Invocation pattern: one way");
}
+ initialize(request);
+
providerInstance = getProviderInstance();
Object param = createRequestParameters(request);
if (log.isDebugEnabled()) {
+ Class providerType = getProviderType();
final Object input = providerType.cast(param);
log.debug("Invoking Provider<" + providerType.getName() + ">");
if (input != null) {
@@ -164,7 +167,18 @@
}
ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
- Executor executor = ef.getExecutorInstance();
+ Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
+
+ // If the property has been set to disable thread switching, then we can
+ // do so by using a SingleThreadedExecutor instance to continue processing
+ // work on the existing thread.
+ Boolean disable = (Boolean) request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
+ if (disable != null && disable.booleanValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Server side thread switch disabled. Setting Executor to the SingleThreadedExecutor.");
+ }
+ executor = new SingleThreadedExecutor();
+ }
Method m = getJavaMethod();
Object[] params = new Object[] {param};
@@ -185,11 +199,14 @@
log.debug("Invocation pattern: two way, async");
}
+ initialize(request);
+
providerInstance = getProviderInstance();
Object param = createRequestParameters(request);
if (log.isDebugEnabled()) {
+ Class providerType = getProviderType();
final Object input = providerType.cast(param);
log.debug("Invoking Provider<" + providerType.getName() + ">");
if (input != null) {
@@ -201,7 +218,18 @@
}
ExecutorFactory ef = (ExecutorFactory) FactoryRegistry.getFactory(ExecutorFactory.class);
- Executor executor = ef.getExecutorInstance();
+ Executor executor = ef.getExecutorInstance(ExecutorFactory.SERVER_EXECUTOR);
+
+ // If the property has been set to disable thread switching, then we can
+ // do so by using a SingleThreadedExecutor instance to continue processing
+ // work on the existing thread.
+ Boolean disable = (Boolean) request.getProperty(ServerConstants.SERVER_DISABLE_THREAD_SWITCH);
+ if (disable != null && disable.booleanValue()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Server side thread switch disabled. Setting Executor to the SingleThreadedExecutor.");
+ }
+ executor = new SingleThreadedExecutor();
+ }
Method m = getJavaMethod();
Object[] params = new Object[] {param};
@@ -219,7 +247,7 @@
public Object createRequestParameters(MessageContext request) {
// First we need to know what kind of Provider instance we're going
// to be invoking against
- providerType = getProviderType();
+ Class providerType = getProviderType();
// REVIEW: This assumes there is only one endpoint description on the service. Is that always the case?
EndpointDescription endpointDesc = request.getEndpointDescription();
@@ -240,12 +268,12 @@
}
// Save off the protocol info so we can use it when creating the response message.
- messageProtocol = message.getProtocol();
+ Protocol messageProtocol = message.getProtocol();
// Determine what type blocks we want to create (String, Source, etc) based on Provider Type
BlockFactory factory = createBlockFactory(providerType);
- providerServiceMode = endpointDesc.getServiceMode();
+ Service.Mode providerServiceMode = endpointDesc.getServiceMode();
if (providerServiceMode != null && providerServiceMode == Service.Mode.MESSAGE) {
if (providerType.equals(SOAPMessage.class)) {
@@ -289,33 +317,64 @@
}
public MessageContext createResponse(MessageContext request, Object[] input, Object output) {
+ if (log.isDebugEnabled()) {
+ log.debug("Start createResponse");
+ }
Message m;
+ EndpointDescription endpointDesc = null;
try {
- m = createMessageFromValue(output);
- } catch (Exception e) {
- throw ExceptionFactory.makeWebServiceException(e);
+ endpointDesc = request.getEndpointDescription();
+ Service.Mode mode = endpointDesc.getServiceMode();
+ m = createMessageFromValue(output, request.getMessage().getProtocol(), mode);
+ } catch (Throwable t) {
+ if (log.isDebugEnabled()) {
+ log.debug("Throwable caught");
+ log.debug("Throwable=" + t);
+ }
+ throw ExceptionFactory.makeWebServiceException(t);
}
- // Enable MTOM if indicated by the binding
- String bindingType = endpointDesc.getBindingType();
- if (bindingType != null) {
- if (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
- || bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
- m.setMTOMEnabled(true);
- }
+ if (log.isDebugEnabled()) {
+ log.debug("Response message is created.");
}
+
+ MessageContext response = null;
+ try {
+ // Enable MTOM if indicated by the binding
+ String bindingType = endpointDesc.getBindingType();
+ if (bindingType != null) {
+ if (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
+ || bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
+ m.setMTOMEnabled(true);
+ }
+ }
- MessageContext response = MessageContextUtils.createResponseMessageContext(request);
- response.setMessage(m);
+ response = MessageContextUtils.createResponseMessageContext(request);
+ response.setMessage(m);
+ } catch (RuntimeException e) {
+ if (log.isDebugEnabled()) {
+ log.debug("Throwable caught creating Response MessageContext");
+ log.debug("Throwable=" + e);
+ }
+ } finally {
+ if (log.isDebugEnabled()) {
+ log.debug("End createResponse");
+ }
+ }
return response;
}
public MessageContext createFaultResponse(MessageContext request, Throwable fault) {
+ if (log.isDebugEnabled()) {
+ log.debug("Create XMLFault for createFaultResponse");
+ }
Message m;
try {
+ EndpointDescription endpointDesc = request.getEndpointDescription();
+ Service.Mode mode = endpointDesc.getServiceMode();
XMLFault xmlFault = MethodMarshallerUtils.createXMLFaultFromSystemException(fault);
- m = createMessageFromValue(xmlFault);
+ m = createMessageFromValue(xmlFault, request.getMessage().getProtocol(), mode);
} catch (Exception e) {
throw ExceptionFactory.makeWebServiceException(e);
}
@@ -369,37 +428,52 @@
/*
* Create a Message object out of the value object that was returned.
*/
- private Message createMessageFromValue(Object value) throws Exception {
+ private Message createMessageFromValue(Object value, Protocol protocol,
+ Service.Mode mode) throws Exception {
MessageFactory msgFactory =
(MessageFactory)FactoryRegistry.getFactory(MessageFactory.class);
Message message = null;
if (value != null) {
+ Class providerType = getProviderType();
BlockFactory factory = createBlockFactory(providerType);
if (value instanceof XMLFault) {
- message = msgFactory.create(messageProtocol);
+ if (log.isDebugEnabled()) {
+ log.debug("Creating message from XMLFault");
+ }
+ message = msgFactory.create(protocol);
message.setXMLFault((XMLFault)value);
- } else if (providerServiceMode != null && providerServiceMode == Service.Mode.MESSAGE) {
+ } else if (mode != null && mode == Service.Mode.MESSAGE) {
// For MESSAGE mode, work with the entire message, Headers and Body
// This is based on logic in org.apache.axis2.jaxws.client.XMLDispatch.createMessageFromBundle()
if (value instanceof SOAPMessage) {
+ if (log.isDebugEnabled()) {
+ log.debug("Creating message from SOAPMessage");
+ }
message = msgFactory.createFrom((SOAPMessage)value);
} else {
+ if (log.isDebugEnabled()) {
+ log.debug("Creating message using " + factory);
+ }
Block block = factory.createFrom(value, null, null);
- message = msgFactory.createFrom(block, null, messageProtocol);
+ message = msgFactory.createFrom(block, null, protocol);
}
} else {
// PAYLOAD mode deals only with the body of the message.
+ if (log.isDebugEnabled()) {
+ log.debug("Creating message (payload) using " + factory);
+ }
Block block = factory.createFrom(value, null, null);
- message = msgFactory.create(messageProtocol);
+ message = msgFactory.create(protocol);
message.setBodyBlock(block);
}
}
- if (message == null)
+ if (message == null) {
// If we didn't create a message above (because there was no value), create one here
- message = msgFactory.create(messageProtocol);
+ message = msgFactory.create(protocol);
+ }
return message;
@@ -441,6 +515,9 @@
*/
private Class<?> getProviderType() {
+ if (_providerType != null) {
+ return _providerType;
+ }
Class providerType = null;
Type[] giTypes = serviceImplClass.getGenericInterfaces();
@@ -462,6 +539,7 @@
providerType = (Class)paramType.getActualTypeArguments()[0];
}
}
+ _providerType = providerType;
return providerType;
}
@@ -496,24 +574,25 @@
* Given a target class type for a payload, load the appropriate BlockFactory.
*/
private BlockFactory createBlockFactory(Class type) {
- if (blockFactory != null)
- return blockFactory;
+ if (_blockFactory != null) {
+ return _blockFactory;
+ }
if (type.equals(String.class)) {
- blockFactory = (XMLStringBlockFactory)FactoryRegistry.getFactory(
+ _blockFactory = (XMLStringBlockFactory)FactoryRegistry.getFactory(
XMLStringBlockFactory.class);
} else if (type.equals(Source.class)) {
- blockFactory = (SourceBlockFactory)FactoryRegistry.getFactory(
+ _blockFactory = (SourceBlockFactory)FactoryRegistry.getFactory(
SourceBlockFactory.class);
} else if (type.equals(SOAPMessage.class)) {
- blockFactory = (SOAPEnvelopeBlockFactory)FactoryRegistry.getFactory(
+ _blockFactory = (SOAPEnvelopeBlockFactory)FactoryRegistry.getFactory(
SOAPEnvelopeBlockFactory.class);
} else {
- ExceptionFactory.makeWebServiceException("Unable to find BlockFactory " +
+ throw ExceptionFactory.makeWebServiceException("Unable to find BlockFactory " +
"for type: " + type.getClass().getName());
}
- return blockFactory;
+ return _blockFactory;
}
protected Method getJavaMethod() {
@@ -528,5 +607,25 @@
return m;
}
+
+ private void initialize(MessageContext mc) {
+
+ mc.setOperationName(mc.getAxisMessageContext().getAxisOperation().getName());
+
+ endpointDesc = mc.getEndpointDescription();
+ String bindingType = endpointDesc.getBindingType();
+
+ if (bindingType != null) {
+ if (bindingType.equals(SOAPBinding.SOAP11HTTP_MTOM_BINDING)
+ || bindingType.equals(SOAPBinding.SOAP12HTTP_MTOM_BINDING)) {
+ mc.getMessage().setMTOMEnabled(true);
+ }
+ }
+
+ //Set SOAP Operation Related properties in SOAPMessageContext.
+
+ ContextUtils.addWSDLProperties_provider(mc);
+ }
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Constants.java Tue Oct 30 05:10:34 2007
@@ -49,6 +49,12 @@
// Usage: A list of ApplicationContextMigrator objects that are to be called for an invocation.
public static final String APPLICATION_CONTEXT_MIGRATOR_LIST_ID =
"org.apache.axis2.jaxws.spi.ApplicationContextMigrators";
+
+ // Value = ClassLoader
+ // Usage: Stores ClassLoader instance on response message context that ensures the
+ // JAXBUtils class will use the same ClassLoader to retrieve a JAXBContext as the
+ // one that was used to create the request
+ public static final String CACHE_CLASSLOADER = "CACHE_CLASSLOADER";
// Value = Colletion
// Usage: A list of WebServiceFeatureConfigurators that are called to configure the client or
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java Tue Oct 30 05:10:34 2007
@@ -542,9 +542,9 @@
//TODO: Need to make the default number of threads configurable
private Executor getDefaultExecutor() {
- ExecutorFactory executorFactory = (ExecutorFactory) FactoryRegistry.getFactory(
- ExecutorFactory.class);
- return executorFactory.getExecutorInstance();
+ ExecutorFactory executorFactory = (ExecutorFactory) FactoryRegistry.getFactory(
+ ExecutorFactory.class);
+ return executorFactory.getExecutorInstance(ExecutorFactory.CLIENT_EXECUTOR);
}
private boolean isValidServiceName() {
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/ExecutorFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/ExecutorFactory.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/ExecutorFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/ExecutorFactory.java Tue Oct 30 05:10:34 2007
@@ -30,6 +30,20 @@
*/
public interface ExecutorFactory {
- public Executor getExecutorInstance();
+ public static final int CLIENT_EXECUTOR = 0;
+ public static final int SERVER_EXECUTOR = 1;
+
+ /**
+ *
+ * @return
+ */
+ public Executor getExecutorInstance();
+
+ /**
+ *
+ * @param executorType
+ * @return
+ */
+ public Executor getExecutorInstance(int executorType);
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/JAXWSExecutorFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/JAXWSExecutorFactory.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/JAXWSExecutorFactory.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/utility/JAXWSExecutorFactory.java Tue Oct 30 05:10:34 2007
@@ -30,8 +30,14 @@
*/
public class JAXWSExecutorFactory implements ExecutorFactory {
- public Executor getExecutorInstance() {
- return Executors.newFixedThreadPool(3, new JAXWSThreadFactory());
- }
+ public Executor getExecutorInstance() {
+ return Executors.newFixedThreadPool(3, new JAXWSThreadFactory());
+ }
+
+ public Executor getExecutorInstance(int executorType) {
+ return getExecutorInstance();
+ }
+
+
}
Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/test/org/apache/axis2/jaxws/misc/JAXBContextTest.java Tue Oct 30 05:10:34 2007
@@ -85,8 +85,9 @@
assertTrue(jaxbContext1.toString().equals(jaxbContext1.toString()));
assertTrue(context3.contains("org.test.addnumbers"));
assertTrue(context3.contains("org.test.anytype"));
- // TODO FIXME - does not work under m2/surefire
-// assertTrue(!context3.contains("my.grandma.loves.jaxws")); // invalid package should be silently removed
+ // The invalid package should now be retained...this is due
+ // a minor semantic change to avoid this side effect.
+ assertTrue(context3.contains("my.grandma.loves.jaxws"));
// Repeat with a subset of packages
TreeSet<String> context4 = new TreeSet<String>();
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/conf/axis2.xml Tue Oct 30 05:10:34 2007
@@ -31,6 +31,12 @@
<parameter name="attachmentDIR"></parameter>
<parameter name="sizeThreshold">4000</parameter-->
+ <!--Uncomment if you want to enable the reduction of the in-memory cache of WSDL definitions -->
+ <!--In some server environments, the available memory heap is limited and can fill up under load -->
+ <!--Since in-memory copies of WSDL definitions can be large, some steps can be taken-->
+ <!--to reduce the memory needed for the cached WSDL definitions. -->
+ <!--parameter name="reduceWSDLMemoryCache">true</parameter-->
+
<!--This will give out the timout of the configuration contexts, in milliseconds-->
<parameter name="ConfigContextTimeoutInterval">30000</parameter>
@@ -72,6 +78,9 @@
<!-- Following parameter will completely disable REST handling in Axis2-->
<parameter name="disableREST" locked="true">false</parameter>
+
+ <!-- Following parameter will suppress generation of SOAP 1.2 bindings in auto-generated WSDL files -->
+ <parameter name="disableSOAP12" locked="true">false</parameter>
<!--POJO deployer , this will alow users to drop .class file and make that into a service-->
<deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/pom.xml Tue Oct 30 05:10:34 2007
@@ -72,7 +72,23 @@
</dependency>
<dependency>
<groupId>org.apache.woden</groupId>
- <artifactId>woden</artifactId>
+ <artifactId>woden-api</artifactId>
+ <version>${woden.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.woden</groupId>
+ <artifactId>woden-impl-dom</artifactId>
+ <version>${woden.version}</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/Constants.java Tue Oct 30 05:10:34 2007
@@ -268,6 +268,9 @@
public static final String MM7_PART_CID = "MM7PartCID";
+ public static final String REDUCE_WSDL_MEMORY_CACHE = "reduceWSDLMemoryCache";
+ public static final String REDUCE_WSDL_MEMORY_TYPE = "reduceWSDLMemoryType";
+
public static final String HTTP_METHOD_GET = "GET";
public static final String HTTP_METHOD_DELETE = "DELETE";
public static final String HTTP_METHOD_PUT = "PUT";
@@ -289,7 +292,8 @@
public static final String DRILL_DOWN_TO_ROOT_CAUSE_FOR_FAULT_REASON =
"drillDownToRootCauseForFaultReason";
- public static final String DISABLE_REST = "disableREST";
+ public static final String DISABLE_REST = "disableREST";
+ public static final String DISABLE_SOAP12 = "disableSOAP12";
// this will contain the keys of all the properties that will be in the message context
public static final String TRANSPORT_URL = "TransportURL";
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/classloader/MultiParentClassLoader.java Tue Oct 30 05:10:34 2007
@@ -213,6 +213,17 @@
return resolveClass(clazz, resolve);
} catch (ClassNotFoundException ignored) {
// this parent didn't have the class; try the next one
+ // TODO REVIEW FOR JAVA 6
+ // In Java 5, if you passed an array string such as "[Lcom.mypackage.MyClass;" to
+ // loadClass, the class would indeed be loaded.
+ // In JDK6, a ClassNotFoundException is thrown.
+ // The work-around is to use code Class.forName instead.
+ // Example:
+ // try {
+ // classLoader.loadClass(name);
+ // } catch (ClassNotFoundException e) {
+ // Class.forName(name, false, loader);
+ // }
}
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Stub.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Stub.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Stub.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/client/Stub.java Tue Oct 30 05:10:34 2007
@@ -197,9 +197,18 @@
envelop.getHeader().addHeaderBlock(omElementToadd.getLocalName(),omElementToadd.getNamespace());
soapHeaderBlock.setMustUnderstand(mustUnderstand);
OMNode omNode = null;
+
+ // add child elements
for (Iterator iter = omElementToadd.getChildren(); iter.hasNext();){
omNode = (OMNode) iter.next();
soapHeaderBlock.addChild(omNode);
+ }
+
+ OMAttribute omatribute = null;
+ // add attributes
+ for (Iterator iter = omElementToadd.getAllAttributes(); iter.hasNext();){
+ omatribute = (OMAttribute) iter.next();
+ soapHeaderBlock.addAttribute(omatribute);
}
}
Modified: webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java?rev=590048&r1=590047&r2=590048&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/kernel/src/org/apache/axis2/context/AbstractContext.java Tue Oct 30 05:10:34 2007
@@ -103,6 +103,28 @@
}
/**
+ * Retrieves an object given a key. Only searches at this level
+ * i.e. getLocalProperty on MessageContext does not look in
+ * the OperationContext properties map if a local result is not
+ * found.
+ *
+ * @param key - if not found, will return null
+ * @return Returns the property.
+ */
+ public Object getLocalProperty(String key) {
+ Object obj = properties == null ? null : properties.get(key);
+ if ((obj == null) && (parent != null)) {
+ // This is getLocalProperty() don't search the hierarchy.
+ } else {
+
+ // Assume that a property is which is read may be updated.
+ // i.e. The object pointed to by 'value' may be modified after it is read
+ addPropertyDifference(key);
+ }
+ return obj;
+ }
+
+ /**
* Retrieves an object given a key. The retrieved property will not be replicated to
* other nodes in the clustered scenario.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org