< prev index next >
src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 47,56 ****
--- 47,57 ----
import com.sun.xml.internal.ws.spi.db.BindingContext;
import com.sun.xml.internal.ws.spi.db.TypeInfo;
import com.sun.xml.internal.ws.spi.db.WrapperComposite;
import static com.sun.xml.internal.ws.binding.WebServiceFeatureList.getSoapVersion;
+ import static com.sun.xml.internal.ws.model.Utils.REFLECTION_NAVIGATOR;
import javax.jws.*;
import javax.jws.WebParam.Mode;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
*** 379,388 ****
--- 380,390 ----
if (o!= null && o instanceof Boolean) decapitalizeExceptionBeanProperties = (Boolean) o;
ClassLoader loader = (classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader;
try {
return loader.loadClass(className);
} catch (ClassNotFoundException e) {
+ if (noWrapperGen()) return exception;
logger.fine("Dynamically creating exception bean Class " + className);
return WrapperBeanGenerator.createExceptionBean(className, exception, targetNamespace, name, namespace, loader, decapitalizeExceptionBeanProperties);
}
}
*** 883,893 ****
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if(clazzType==Holder.class){
! clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
WebParam webParam = null;
xmlElem = null;
--- 885,895 ----
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if(clazzType==Holder.class){
! clazzType = erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
WebParam webParam = null;
xmlElem = null;
*** 1098,1108 ****
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if (clazzType==Holder.class)
! clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
for (Annotation annotation : pannotations[pos]) {
if (annotation.annotationType() == javax.jws.WebParam.class) {
javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
--- 1100,1110 ----
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if (clazzType==Holder.class)
! clazzType = erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
for (Annotation annotation : pannotations[pos]) {
if (annotation.annotationType() == javax.jws.WebParam.class) {
javax.jws.WebParam webParam = (javax.jws.WebParam) annotation;
*** 1208,1218 ****
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
!
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
--- 1210,1221 ----
//Exclude RuntimeException, RemoteException and Error etc
if (!EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception))
continue;
! if (getAnnotation(exception, javax.xml.bind.annotation.XmlTransient.class) != null)
! continue;
Class exceptionBean;
Annotation[] anns;
WebFault webFault = getAnnotation(exception, WebFault.class);
Method faultInfoMethod = getWSDLExceptionFaultInfo(exception);
ExceptionType exceptionType = ExceptionType.WSDLException;
*** 1244,1253 ****
--- 1247,1257 ----
QName faultName = new QName(namespace, name);
TypeInfo typeRef = new TypeInfo(faultName, exceptionBean, anns);
CheckedExceptionImpl checkedException =
new CheckedExceptionImpl(javaMethod, exception, typeRef, exceptionType);
checkedException.setMessageName(messageName);
+ checkedException.setFaultInfoGetter(faultInfoMethod);
for(FaultAction fa: faultActions) {
if(fa.className().equals(exception) && !fa.value().equals("")) {
checkedException.setFaultAction(fa.value());
break;
}
*** 1344,1354 ****
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if (clazzType==Holder.class)
! clazzType = (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
for (Annotation annotation : pannotations[pos]) {
if (annotation.annotationType() == javax.jws.WebParam.class) {
--- 1348,1358 ----
boolean isHolder = HOLDER_CLASS.isAssignableFrom(clazzType);
//set the actual type argument of Holder in the TypeReference
if (isHolder) {
if (clazzType==Holder.class)
! clazzType = erasure(((ParameterizedType)genericParameterTypes[pos]).getActualTypeArguments()[0]);
}
Mode paramMode = isHolder ? Mode.INOUT : Mode.IN;
for (Annotation annotation : pannotations[pos]) {
if (annotation.annotationType() == javax.jws.WebParam.class) {
*** 1432,1449 ****
}
private Class getAsyncReturnType(Method method, Class returnType) {
if(Response.class.isAssignableFrom(returnType)){
Type ret = method.getGenericReturnType();
! return (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)ret).getActualTypeArguments()[0]);
}else{
Type[] types = method.getGenericParameterTypes();
Class[] params = method.getParameterTypes();
int i = 0;
for(Class cls : params){
if(AsyncHandler.class.isAssignableFrom(cls)){
! return (Class) Utils.REFLECTION_NAVIGATOR.erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]);
}
i++;
}
}
return returnType;
--- 1436,1453 ----
}
private Class getAsyncReturnType(Method method, Class returnType) {
if(Response.class.isAssignableFrom(returnType)){
Type ret = method.getGenericReturnType();
! return erasure(((ParameterizedType)ret).getActualTypeArguments()[0]);
}else{
Type[] types = method.getGenericParameterTypes();
Class[] params = method.getParameterTypes();
int i = 0;
for(Class cls : params){
if(AsyncHandler.class.isAssignableFrom(cls)){
! return erasure(((ParameterizedType)types[i]).getActualTypeArguments()[0]);
}
i++;
}
}
return returnType;
*** 1731,1737 ****
}
return new QName(ns, localPart);
}
!
}
--- 1735,1743 ----
}
return new QName(ns, localPart);
}
! static public Class erasure(Type type) {
! return (Class)REFLECTION_NAVIGATOR.erasure(type);
! }
}
< prev index next >