You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sc...@apache.org on 2008/04/02 22:30:10 UTC
svn commit: r644039 - in /webservices/axis2/trunk/java/modules:
jaxws-integration/test-resources/
jaxws-integration/test/org/apache/axis2/jaxws/proxy/
jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/
jaxws/src/org/apache/axis2/jaxws...
Author: scheu
Date: Wed Apr 2 13:30:08 2008
New Revision: 644039
URL: http://svn.apache.org/viewvc?rev=644039&view=rev
Log:
AXIS2-3674
Contributor:Rich Scheuerle
Use @XmlSeeAlso information the JAXWS artifacts to gather additional package information
for constructing the JAXBContext. This will allow users to more easily add derived classes.
Added:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtilsMonitor.java
Modified:
webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/log4j.properties
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/AnnotationDesc.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationBuilder.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationDescImpl.java
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/log4j.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/log4j.properties?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/log4j.properties (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test-resources/log4j.properties Wed Apr 2 13:30:08 2008
@@ -67,8 +67,9 @@
# the axis2.small.log.
# You can add this without changing the root category.
#log4j.category.org.apache.axiom.om.util.StAXUtils=DEBUG, SMALL
-#log4j.category.org.apache.axis2.jaxws.server=DEBUG, SMALL
+# Enable the following to get JAXWS TestLogger trace.
+#log4j.category.JAXWS-Tests=DEBUG, SMALL
# Set the enterprise logger priority to FATAL
log4j.logger.org.apache.axis2.enterprise=FATAL
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/GorillaDLWProxyTests.java Wed Apr 2 13:30:08 2008
@@ -23,6 +23,7 @@
import junit.framework.TestSuite;
import org.apache.axis2.jaxws.TestLogger;
import org.apache.axis2.jaxws.framework.AbstractTestCase;
+import org.apache.axis2.jaxws.message.databinding.JAXBUtilsMonitor;
import org.apache.axis2.jaxws.proxy.gorilla_dlw.sei.GorillaInterface;
import javax.xml.namespace.QName;
@@ -113,6 +114,42 @@
}catch(Exception e){
e.printStackTrace();
fail("Exception received" + e);
+ }
+ }
+
+ /**
+ * Test whether the @XmlSeeAlso that was added to the SEI
+ * is used to construct the JAXBContext
+ */
+ public void testXmlSeeAlso() throws Exception {
+ try{
+ // Set up the JAXBUtils monitor
+ JAXBUtilsMonitor.setMonitoring(true);
+ JAXBUtilsMonitor.clear();
+
+ GorillaInterface proxy = getProxy();
+ String request = "Hello World";
+
+ String response = proxy.echoString(request);
+ assertTrue(response != null);
+ assertEquals(response, request);
+
+ // Now query the monitor
+ List<String> keys = JAXBUtilsMonitor.getPackageKeys();
+ assertTrue(keys != null && keys.size() > 0);
+ for (int i=0; i<keys.size(); i++) {
+ String observedKey = keys.get(i);
+ TestLogger.logger.debug("Observed Key =" + observedKey);
+ // Check for one of the expected (referenced) packages
+ assertTrue(observedKey.contains("org.apache.axis2.jaxws.proxy.gorilla_dlw.data"));
+ // Check for the package referenced only by an @XmlSeeAlso
+ assertTrue(observedKey.contains("org.test.stock2"));
+ }
+ }catch(Exception e){
+ e.printStackTrace();
+ fail("Exception received" + e);
+ } finally {
+ JAXBUtilsMonitor.setMonitoring(false);
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws-integration/test/org/apache/axis2/jaxws/proxy/gorilla_dlw/sei/GorillaInterface.java Wed Apr 2 13:30:08 2008
@@ -27,6 +27,7 @@
import javax.jws.WebParam.Mode;
import javax.jws.WebResult;
import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.Holder;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
@@ -39,6 +40,7 @@
*
*/
@WebService(name = "GorillaInterface", targetNamespace = "http://org/apache/axis2/jaxws/proxy/gorilla_dlw")
+@XmlSeeAlso(org.test.stock2.GetPrice.class) // Test see also processing
public interface GorillaInterface {
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtils.java Wed Apr 2 13:30:08 2008
@@ -149,6 +149,7 @@
log.debug(pkg);
}
}
+ JAXBUtilsMonitor.addPackageKey(key);
// The JAXBContexts are keyed by ClassLoader and the set of Strings
ClassLoader cl = getContextClassLoader();
Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtilsMonitor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtilsMonitor.java?rev=644039&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtilsMonitor.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/message/databinding/JAXBUtilsMonitor.java Wed Apr 2 13:30:08 2008
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axis2.jaxws.message.databinding;
+
+import org.apache.axis2.util.JavaUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * The monitor is used by the tests to ensure
+ * that the JAXBUtils code is used and is functioning correctly.
+ * In normal usage, monitoring is off.
+ *
+ * Currently the JAXBUtilsMonitor keeps track of the packageKeys
+ * passed to createJAXBContext(*). Future improvements may monitor
+ * the size of the pools, the pool hits versus misses, etc.
+ */
+public class JAXBUtilsMonitor {
+
+ private static final Log log = LogFactory.getLog(JAXBUtilsMonitor.class);
+ private static boolean monitoring = false;
+ private static ArrayList<String> packageKeys = new ArrayList<String>();
+ private static String semifore = "JAXBUtils";
+
+ /**
+ * Intentionally private. All methods are static.
+ */
+ private JAXBUtilsMonitor() {
+
+ }
+
+ /**
+ * @return true if monitoring
+ */
+ public static boolean isMonitoring() {
+ return monitoring;
+ }
+
+ /**
+ * Set monitoring
+ * @param monitoring boolean
+ */
+ public static void setMonitoring(boolean monitoring) {
+ JAXBUtilsMonitor.monitoring = monitoring;
+ }
+
+ /**
+ * Clear the number of creates and failed creates
+ */
+ public static void clear() {
+ synchronized(semifore) {
+ packageKeys.clear();
+ }
+ }
+
+ /**
+ * @return package keys
+ */
+ public static List<String> getPackageKeys() {
+ synchronized(semifore) {
+ return new ArrayList<String>(packageKeys);
+ }
+
+ }
+
+ /**
+ * Add PackageKey
+ */
+ public static void addPackageKey(String packageKey) {
+ if (isMonitoring()) {
+ synchronized(semifore) {
+ if (log.isDebugEnabled()) {
+ log.debug(JavaUtils.callStackToString());
+ }
+ if (!packageKeys.contains(packageKey)) {
+ packageKeys.add(packageKey);
+ }
+ }
+ }
+ }
+
+}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/AnnotationDesc.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/AnnotationDesc.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/AnnotationDesc.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/AnnotationDesc.java Wed Apr 2 13:30:08 2008
@@ -31,4 +31,8 @@
/** @return @XmlRootElement namespace or default namespace (null if !hasXmlRootElement) */
public String getXmlRootElementNamespace();
+ /**
+ * @return @XmlSeeAlso classes or null
+ */
+ public Class[] getXmlSeeAlsoClasses();
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationBuilder.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationBuilder.java Wed Apr 2 13:30:08 2008
@@ -19,16 +19,21 @@
package org.apache.axis2.jaxws.runtime.description.marshal.impl;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.java.security.AccessController;
+import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.FaultDescription;
import org.apache.axis2.jaxws.description.OperationDescription;
import org.apache.axis2.jaxws.description.ParameterDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.i18n.Messages;
import org.apache.axis2.jaxws.runtime.description.marshal.AnnotationDesc;
import org.apache.axis2.jaxws.runtime.description.marshal.FaultBeanDesc;
import org.apache.axis2.jaxws.utility.ClassUtils;
+import org.apache.axis2.util.JavaUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -79,8 +84,15 @@
* @param map
*/
private static void getAnnotationDescs(EndpointDescription endpointDesc,
- ArtifactProcessor ap, Map<String,
- AnnotationDesc> map) {
+ ArtifactProcessor ap,
+ Map<String, AnnotationDesc> map) {
+ String implClassName = getServiceImplClassName(endpointDesc);
+ if (implClassName != null) {
+ Class clz = loadClass(implClassName);
+ if (clz != null) {
+ addAnnotation(clz, map);
+ }
+ }
EndpointInterfaceDescription endpointInterfaceDesc =
endpointDesc.getEndpointInterfaceDescription();
if (endpointInterfaceDesc != null) {
@@ -97,6 +109,11 @@
private static void getAnnotationDescs(EndpointInterfaceDescription endpointInterfaceDesc,
ArtifactProcessor ap,
Map<String, AnnotationDesc> map) {
+ Class clz = endpointInterfaceDesc.getSEIClass();
+ if (clz != null) {
+ addAnnotation(clz, map);
+ }
+
// Don't dig into the async operations
OperationDescription[] opDescs = endpointInterfaceDesc.getDispatchableOperations();
@@ -235,6 +252,16 @@
map.put(class2.getCanonicalName(), desc2);
}
}
+
+ // Inspect the interfaces. This is done to pick up other
+ // @XmlSeeAlso usages.
+ Class[] interfaces = cls.getInterfaces();
+ if (interfaces != null) {
+ for (int i=0; i<interfaces.length; i++) {
+ addAnnotation(interfaces[i], map);
+ }
+ }
+
}
}
@@ -317,5 +344,26 @@
}
return cl;
+ }
+
+ /**
+ * Get the Serivce Impl Class by looking at the AxisService
+ * @param endpointDescription
+ * @return class name or null
+ */
+ static private String getServiceImplClassName(EndpointDescription endpointDescription) {
+ String result = null;
+ if (endpointDescription != null) {
+ AxisService as = endpointDescription.getAxisService();
+ if (as != null) {
+ Parameter param = as.getParameter(org.apache.axis2.Constants.SERVICE_CLASS);
+
+ // If there was no implementation class, we should not go any further
+ if (param != null) {
+ result = ((String)param.getValue()).trim();
+ }
+ }
+ }
+ return result;
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationDescImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationDescImpl.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationDescImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/AnnotationDescImpl.java Wed Apr 2 13:30:08 2008
@@ -19,19 +19,27 @@
package org.apache.axis2.jaxws.runtime.description.marshal.impl;
+import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.runtime.description.marshal.AnnotationDesc;
import org.apache.axis2.jaxws.utility.XMLRootElementUtil;
+import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.namespace.QName;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.security.PrivilegedAction;
+
/**
- *
+ * Common annotation information for a class. This is setup once
+ * so that and stored in the AnnotationDesc so that it is easily accessible.
*/
class AnnotationDescImpl implements AnnotationDesc {
private boolean _hasXmlRootElement = false;
private String _XmlRootElementName = null;
private String _XmlRootElementNamespace = null;
+ private Class[] _XmlSeeAlsoClasses = null;
private AnnotationDescImpl() {
super();
@@ -52,14 +60,22 @@
static AnnotationDesc create(Class cls) {
AnnotationDescImpl aDesc = new AnnotationDescImpl();
+ // XMLSeeAlso is part of JAXB 2.1.2.
+ // The assumption is that this is a prereq for JAXWS 2.1; thus
+ // we can safely reference this class
+ XmlSeeAlso xmlSeeAlso = (XmlSeeAlso)
+ getAnnotation(cls, XmlSeeAlso.class);
+
+ if (xmlSeeAlso != null) {
+ aDesc._XmlSeeAlsoClasses = xmlSeeAlso.value();
+ }
+
QName qName = XMLRootElementUtil.getXmlRootElementQName(cls);
- if (qName == null) {
- return aDesc;
+ if (qName != null) {
+ aDesc._hasXmlRootElement = true;
+ aDesc._XmlRootElementName = qName.getLocalPart();
+ aDesc._XmlRootElementNamespace = qName.getNamespaceURI();
}
- aDesc._hasXmlRootElement = true;
- aDesc._XmlRootElementName = qName.getLocalPart();
- aDesc._XmlRootElementNamespace = qName.getNamespaceURI();
-
return aDesc;
}
@@ -77,7 +93,31 @@
string.append(" @XMLRootElement name = " + this.getXmlRootElementName());
}
+ if (this._XmlSeeAlsoClasses != null) {
+ for (int i=0; i<_XmlSeeAlsoClasses.length; i++) {
+ string.append(newline);
+ string.append(" @XMLSeeAlso class = " + this._XmlSeeAlsoClasses[i].getName());
+ }
+ }
return string.toString();
+ }
+
+ public Class[] getXmlSeeAlsoClasses() {
+ return _XmlSeeAlsoClasses;
+ }
+
+ /**
+ * Get an annotation. This is wrappered to avoid a Java2Security violation.
+ * @param cls Class that contains annotation
+ * @param annotation Class of requrested Annotation
+ * @return annotation or null
+ */
+ private static Annotation getAnnotation(final AnnotatedElement element, final Class annotation) {
+ return (Annotation) AccessController.doPrivileged(new PrivilegedAction() {
+ public Object run() {
+ return element.getAnnotation(annotation);
+ }
+ });
}
}
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java?rev=644039&r1=644038&r2=644039&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/runtime/description/marshal/impl/PackageSetBuilder.java Wed Apr 2 13:30:08 2008
@@ -19,6 +19,8 @@
package org.apache.axis2.jaxws.runtime.description.marshal.impl;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.Parameter;
import org.apache.axis2.java.security.AccessController;
import org.apache.axis2.jaxws.ExceptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
@@ -152,32 +154,46 @@
*/
private static TreeSet<String> getPackagesFromAnnotations(EndpointDescription endpointDesc,
MarshalServiceRuntimeDescription msrd) {
+
+ TreeSet<String> set = new TreeSet<String>();
+ String implClassName = getServiceImplClassName(endpointDesc);
+ if (implClassName != null) {
+ Class clz = loadClass(implClassName);
+ if (clz != null) {
+ addXmlSeeAlsoPackages(clz, msrd, set);
+ }
+ }
EndpointInterfaceDescription endpointInterfaceDesc =
endpointDesc.getEndpointInterfaceDescription();
- if (endpointInterfaceDesc == null) {
- return new TreeSet<String>();
- } else {
- return getPackagesFromAnnotations(endpointInterfaceDesc, msrd);
+ if (endpointInterfaceDesc != null) {
+ getPackagesFromAnnotations(endpointInterfaceDesc, set, msrd);
}
+ return set;
}
/**
* @param endpointInterfaceDescription EndpointInterfaceDescription
- * @return Set of Packages
+ * @param Set of Packages
+ * @param msrd
*/
- private static TreeSet<String> getPackagesFromAnnotations(
+ private static void getPackagesFromAnnotations(
EndpointInterfaceDescription endpointInterfaceDesc,
+ TreeSet<String> set,
MarshalServiceRuntimeDescription msrd) {
- TreeSet<String> set = new TreeSet<String>();
+
OperationDescription[] opDescs = endpointInterfaceDesc.getDispatchableOperations();
- // Build a set of packages from all of the opertions
+ // Inspect the @XmlSeeAlso classes on the interface
+ addXmlSeeAlsoPackages(endpointInterfaceDesc.getSEIClass(), msrd, set);
+
+
+ // Build a set of packages from all of the operations
if (opDescs != null) {
for (int i = 0; i < opDescs.length; i++) {
getPackagesFromAnnotations(opDescs[i], set, msrd);
}
}
- return set;
+ return;
}
/**
@@ -266,19 +282,19 @@
FaultBeanDesc faultBeanDesc = msrd.getFaultBeanDesc(faultDesc);
if(faultBeanDesc == null){
- if(log.isDebugEnabled()){
- log.debug("faultBeanDesc from MarshallServiceRuntimeDescription is null");
- }
- //NO FaultBeanDesc found nothing we can do.
- return;
+ if(log.isDebugEnabled()){
+ log.debug("faultBeanDesc from MarshallServiceRuntimeDescription is null");
+ }
+ //NO FaultBeanDesc found nothing we can do.
+ return;
}
String faultBeanName = faultBeanDesc.getFaultBeanClassName();
if(faultBeanName == null){
- if(log.isDebugEnabled()){
- log.debug("FaultBeanName is null");
- }
- //We cannot load the faultBeanName
- return;
+ if(log.isDebugEnabled()){
+ log.debug("FaultBeanName is null");
+ }
+ //We cannot load the faultBeanName
+ return;
}
Class faultBean = loadClass(faultBeanName);
if (faultBean != null) {
@@ -312,6 +328,7 @@
if (pkg != null) {
set.add(pkg);
}
+ addXmlSeeAlsoPackages(tClass, msrd, set);
}
// Set the package for the element
@@ -333,6 +350,7 @@
if (pkg != null) {
set.add(pkg);
}
+ addXmlSeeAlsoPackages(tClass, msrd, set);
}
}
}
@@ -405,6 +423,34 @@
return pkg;
}
+ private static void addXmlSeeAlsoPackages(Class clz,
+ MarshalServiceRuntimeDescription msrd,
+ TreeSet<String> set) {
+ if (clz != null) {
+ AnnotationDesc aDesc = msrd.getAnnotationDesc(clz);
+ if (aDesc != null) {
+ Class[] seeAlso = aDesc.getXmlSeeAlsoClasses();
+ if (seeAlso != null) {
+ for (int i=0; i<seeAlso.length; i++) {
+ String pkg =
+ (seeAlso[i] == null) ? null :
+ (seeAlso[i].getPackage() == null) ? "" :
+ seeAlso[i].getPackage().getName();
+ if (pkg != null) {
+ set.add(pkg);
+ }
+ }
+ }
+ }
+
+ Class[] interfaces = clz.getInterfaces();
+ if (interfaces != null) {
+ for (int i=0; i<interfaces.length; i++) {
+ addXmlSeeAlsoPackages(interfaces[i], msrd, set);
+ }
+ }
+ }
+ }
/**
* Loads the class
*
@@ -520,5 +566,25 @@
}
return cl;
+ }
+ /**
+ * Get the Serivce Impl Class by looking at the AxisService
+ * @param endpointDescription
+ * @return class name or null
+ */
+ static private String getServiceImplClassName(EndpointDescription endpointDescription) {
+ String result = null;
+ if (endpointDescription != null) {
+ AxisService as = endpointDescription.getAxisService();
+ if (as != null) {
+ Parameter param = as.getParameter(org.apache.axis2.Constants.SERVICE_CLASS);
+
+ // If there was no implementation class, we should not go any further
+ if (param != null) {
+ result = ((String)param.getValue()).trim();
+ }
+ }
+ }
+ return result;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org