@Override protected Class<?> getBeanClass(Class<?> exClass) { try { if (java.rmi.ServerException.class.isAssignableFrom(exClass) || java.rmi.RemoteException.class.isAssignableFrom(exClass) || "javax.xml.ws".equals(PackageUtils.getPackageName(exClass))) { return null; } Method getFaultInfo = exClass.getMethod("getFaultInfo", new Class[0]); return getFaultInfo.getReturnType(); } catch (SecurityException e) { throw new ServiceConstructionException(e); } catch (NoSuchMethodException e) { //ignore for now } WebFault fault = exClass.getAnnotation(WebFault.class); if (fault != null && !StringUtils.isEmpty(fault.faultBean())) { try { return ClassLoaderUtils.loadClass(fault.faultBean(), exClass); } catch (ClassNotFoundException e1) { //ignore } } return super.getBeanClass(exClass); }
private String getWebFaultBean(final Class<?> exceptionClass) { WebFault fault = exceptionClass.getAnnotation(WebFault.class); if (fault == null) { return null; } return fault.faultBean(); }
private String getWebFaultBean(final Class<?> exceptionClass) { WebFault fault = exceptionClass.getAnnotation(WebFault.class); if (fault == null) { return null; } return fault.faultBean(); }
public Class<?> run() { try { return Class.forName(fault.faultBean(), false, cls.getClassLoader()); } catch (ClassNotFoundException e) { throw new ServiceRuntimeException(e); } } });
public String getFaultBean() { if (faultBean != null && faultBean.length() > 0) { // Return the faultBean if it was already calculated return faultBean; } else { // Load up the WebFault annotation and get the faultBean. // @WebFault may not be present WebFault annotation = getAnnoWebFault(); if (annotation != null && annotation.faultBean() != null && annotation.faultBean().length() > 0) { faultBean = annotation.faultBean(); } else { // There is no default. But it seems reasonable to return // the fault info type. faultBean = getFaultInfo(); // The faultBean still may be "" at this point. The JAXWS runtime // is responsible for finding/buildin a representative fault bean. } } return faultBean; }
/** * The qualified name of the implicit fault bean of this web fault, or null if this web fault * does not define an implicit faul bean. * * @return The qualified name of the implicit fault bean of this web fault. */ public String getImplicitFaultBeanQualifiedName() { String faultBean = null; if (isImplicitSchemaElement()) { faultBean = getPackage().getQualifiedName() + ".jaxws." + getSimpleName() + "Bean"; if ((annotation != null) && (annotation.faultBean() != null) && (!"".equals(annotation.faultBean()))) { faultBean = annotation.faultBean(); } } return faultBean; }
public String getFaultBean() { if (faultBean != null && faultBean.length() > 0) { // Return the faultBean if it was already calculated return faultBean; } else { // Load up the WebFault annotation and get the faultBean. // @WebFault may not be present WebFault annotation = getAnnoWebFault(); if (annotation != null && annotation.faultBean() != null && annotation.faultBean().length() > 0) { faultBean = annotation.faultBean(); } else { // There is no default. But it seems reasonable to return // the fault info type. faultBean = getFaultInfo(); // The faultBean still may be "" at this point. The JAXWS runtime // is responsible for finding/buildin a representative fault bean. } } return faultBean; }
/** * The qualified name of the implicit fault bean of this web fault, or null if this web fault * does not define an implicit faul bean. * * @return The qualified name of the implicit fault bean of this web fault. */ public String getImplicitFaultBeanQualifiedName() { String faultBean = null; if (isImplicitSchemaElement()) { faultBean = getPackage().getQualifiedName() + ".jaxws." + getSimpleName() + "Bean"; if ((annotation != null) && (annotation.faultBean() != null) && (!"".equals(annotation.faultBean()))) { faultBean = annotation.faultBean(); } } return faultBean; }
/** * The qualified name of the implicit fault bean of this web fault, or null if this web fault * does not define an implicit faul bean. * * @return The qualified name of the implicit fault bean of this web fault. */ public String getImplicitFaultBeanQualifiedName() { String faultBean = null; if (isImplicitSchemaElement()) { faultBean = getPackage().getQualifiedName() + ".jaxws." + getSimpleName() + "Bean"; if ((annotation != null) && (annotation.faultBean() != null) && (!"".equals(annotation.faultBean()))) { faultBean = annotation.faultBean(); } } return faultBean; }
WebFault webFault = exceptionClass.getAnnotation(WebFault.class); if (webFault != null) { faultBeanName = webFault.faultBean(); if (!"".equals(faultBeanName)) { return faultBeanName;
@Override protected Class<?> getBeanClass(Class<?> exClass) { try { if (java.rmi.ServerException.class.isAssignableFrom(exClass) || java.rmi.RemoteException.class.isAssignableFrom(exClass) || "javax.xml.ws".equals(PackageUtils.getPackageName(exClass))) { return null; } Method getFaultInfo = exClass.getMethod("getFaultInfo", new Class[0]); return getFaultInfo.getReturnType(); } catch (SecurityException e) { throw new ServiceConstructionException(e); } catch (NoSuchMethodException e) { //ignore for now } WebFault fault = exClass.getAnnotation(WebFault.class); if (fault != null && !StringUtils.isEmpty(fault.faultBean())) { try { return ClassLoaderUtils.loadClass(fault.faultBean(), exClass); } catch (ClassNotFoundException e1) { //ignore } } return super.getBeanClass(exClass); }
/** * This method will be used to attach @WebFault annotation data to the * <code>DescriptionBuilderComposite</code> * * @param composite - <code>DescriptionBuilderComposite</code> */ private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) { WebFault webFault = (WebFault)ConverterUtils.getAnnotation( WebFault.class, serviceClass); if (webFault != null) { WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl(); webFaultAnnot.setFaultBean(webFault.faultBean()); webFaultAnnot.setName(webFault.name()); webFaultAnnot.setTargetNamespace(webFault.targetNamespace()); try { webFaultAnnot.setMessageName(webFault.messageName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } composite.setWebFaultAnnot(webFaultAnnot); } }
/** * This method will be used to attach @WebFault annotation data to the * <code>DescriptionBuilderComposite</code> * * @param composite - <code>DescriptionBuilderComposite</code> */ private void attachWebFaultAnnotation(DescriptionBuilderComposite composite) { WebFault webFault = (WebFault)ConverterUtils.getAnnotation( WebFault.class, serviceClass); if (webFault != null) { WebFaultAnnot webFaultAnnot = WebFaultAnnot.createWebFaultAnnotImpl(); webFaultAnnot.setFaultBean(webFault.faultBean()); webFaultAnnot.setName(webFault.name()); webFaultAnnot.setTargetNamespace(webFault.targetNamespace()); try { webFaultAnnot.setMessageName(webFault.messageName()); } catch (NoSuchMethodError ex) { // Ignore: we are running on Java 1.6 and the JAX-WS 2.2 libs have not been endorsed } composite.setWebFaultAnnot(webFaultAnnot); } }