< 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, 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 --- 1,7 ---- /* ! * Copyright (c) 1997, 2016, 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
*** 64,74 **** import java.lang.annotation.Annotation; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; - import java.rmi.RemoteException; import java.security.AccessController; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; --- 64,73 ----
*** 113,123 **** public static final String RETURN = "return"; public static final String BEAN = "Bean"; public static final String SERVICE = "Service"; public static final String PORT = "Port"; public static final Class HOLDER_CLASS = Holder.class; ! public static final Class<RemoteException> REMOTE_EXCEPTION_CLASS = RemoteException.class; public static final Class<RuntimeException> RUNTIME_EXCEPTION_CLASS = RuntimeException.class; public static final Class<Exception> EXCEPTION_CLASS = Exception.class; public static final String DecapitalizeExceptionBeanProperties = "com.sun.xml.internal.ws.api.model.DecapitalizeExceptionBeanProperties"; public static final String SuppressDocLitWrapperGeneration = "com.sun.xml.internal.ws.api.model.SuppressDocLitWrapperGeneration"; public static final String DocWrappeeNamespapceQualified = "com.sun.xml.internal.ws.api.model.DocWrappeeNamespapceQualified"; --- 112,122 ---- public static final String RETURN = "return"; public static final String BEAN = "Bean"; public static final String SERVICE = "Service"; public static final String PORT = "Port"; public static final Class HOLDER_CLASS = Holder.class; ! public static final String REMOTE_EXCEPTION_CLASS = "java.rmi.RemoteException"; public static final Class<RuntimeException> RUNTIME_EXCEPTION_CLASS = RuntimeException.class; public static final Class<Exception> EXCEPTION_CLASS = Exception.class; public static final String DecapitalizeExceptionBeanProperties = "com.sun.xml.internal.ws.api.model.DecapitalizeExceptionBeanProperties"; public static final String SuppressDocLitWrapperGeneration = "com.sun.xml.internal.ws.api.model.SuppressDocLitWrapperGeneration"; public static final String DocWrappeeNamespapceQualified = "com.sun.xml.internal.ws.api.model.DocWrappeeNamespapceQualified";
*** 584,594 **** * @param exception * @return */ private boolean isServiceException(Class<?> exception) { return EXCEPTION_CLASS.isAssignableFrom(exception) && ! !(RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || REMOTE_EXCEPTION_CLASS.isAssignableFrom(exception)); } /** * creates the runtime model for a method on the <code>portClass</code> * @param method the method to model --- 583,593 ---- * @param exception * @return */ private boolean isServiceException(Class<?> exception) { return EXCEPTION_CLASS.isAssignableFrom(exception) && ! !(RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || isRemoteException(exception)); } /** * creates the runtime model for a method on the <code>portClass</code> * @param method the method to model
*** 1167,1177 **** if(!param.isOUT()){ WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.IN); if(p == null) reqRpcParams.put(reqRpcParams.size()+10000, param); else ! reqRpcParams.put(p.getIndex(), param); } if(!param.isIN()){ if (isOneway) { throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters", --- 1166,1176 ---- if(!param.isOUT()){ WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.IN); if(p == null) reqRpcParams.put(reqRpcParams.size()+10000, param); else ! reqRpcParams.put(param.getIndex(), param); } if(!param.isIN()){ if (isOneway) { throw new RuntimeModelerException("runtime.modeler.oneway.operation.no.out.parameters",
*** 1179,1189 **** } WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.OUT); if(p == null) resRpcParams.put(resRpcParams.size()+10000, param); else ! resRpcParams.put(p.getIndex(), param); } }else{ javaMethod.addParameter(param); } } --- 1178,1188 ---- } WSDLPart p = getPart(new QName(targetNamespace,operationName), partName, Mode.OUT); if(p == null) resRpcParams.put(resRpcParams.size()+10000, param); else ! resRpcParams.put(param.getIndex(), param); } }else{ javaMethod.addParameter(param); } }
*** 1208,1218 **** for (Class<?> exception : method.getExceptionTypes()) { //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; --- 1207,1217 ---- for (Class<?> exception : method.getExceptionTypes()) { //Exclude RuntimeException, RemoteException and Error etc if (!EXCEPTION_CLASS.isAssignableFrom(exception)) continue; ! if (RUNTIME_EXCEPTION_CLASS.isAssignableFrom(exception) || isRemoteException(exception)) continue; if (getAnnotation(exception, javax.xml.bind.annotation.XmlTransient.class) != null) continue; Class exceptionBean; Annotation[] anns;
*** 1644,1653 **** --- 1643,1667 ---- return bo.getPart(partName, mode); } return null; } + /* + * Returns true if an exception is a java.rmi.RemoteException or its subtype. + * + * @param exception + * @return true if an exception is a java.rmi.RemoteException or its subtype, + * false otherwise + */ + private boolean isRemoteException(Class<?> exception) { + Class<?> c = exception; + while (c != null && !REMOTE_EXCEPTION_CLASS.equals(c.getName())) { + c = c.getSuperclass(); + } + return c != null; + } + private static Boolean getBooleanSystemProperty(final String prop) { return AccessController.doPrivileged( new java.security.PrivilegedAction<Boolean>() { public Boolean run() { String value = System.getProperty(prop);
< prev index next >