public String getFileName() { return ann.file(); }
public String getFileName() { return ann.file(); }
public String getFileName() { return ann.file(); }
public void process(ServiceReferenceMetaData refs, E type) { HandlerChain annotation = finder.getAnnotation(type, HandlerChain.class); if (annotation == null) return; if (annotation.file() != null && annotation.file().length() > 1) { if(log.isTraceEnabled()) log.trace("processing HandlerChain for element: " + type); process(refs, type, annotation); } }
public static HandlerChains getHandlerChains(Class<?> declaringClass, String serviceEndpoint, ClassLoader classLoader) throws OpenEJBException { HandlerChain handlerChain = declaringClass.getAnnotation(HandlerChain.class); if (handlerChain == null && serviceEndpoint != null) { try { declaringClass = classLoader.loadClass(serviceEndpoint); handlerChain = declaringClass.getAnnotation(HandlerChain.class); } catch (ClassNotFoundException ignored) { } } HandlerChains handlerChains = null; if (handlerChain != null) { try { URL handlerFileURL = declaringClass.getResource(handlerChain.file()); handlerChains = ReadDescriptors.readHandlerChains(handlerFileURL); } catch (Throwable e) { throw new OpenEJBException("Unable to load handler chain file: " + handlerChain.file(), e); } } return handlerChains; } }
public static HandlerChains getHandlerChains(Class<?> declaringClass, final String serviceEndpoint, final ClassLoader classLoader) throws OpenEJBException { HandlerChain handlerChain = declaringClass.getAnnotation(HandlerChain.class); if (handlerChain == null && serviceEndpoint != null) { try { declaringClass = classLoader.loadClass(serviceEndpoint); handlerChain = declaringClass.getAnnotation(HandlerChain.class); } catch (final ClassNotFoundException ignored) { // no-op } } HandlerChains handlerChains = null; if (handlerChain != null) { try { final URL handlerFileURL = declaringClass.getResource(handlerChain.file()); handlerChains = ReadDescriptors.readHandlerChains(handlerFileURL); } catch (final Throwable e) { throw new OpenEJBException("Unable to load handler chain file: " + handlerChain.file(), e); } } return handlerChains; } }
public static HandlerChains getHandlerChains(Class<?> declaringClass, final String serviceEndpoint, final ClassLoader classLoader) throws OpenEJBException { HandlerChain handlerChain = declaringClass.getAnnotation(HandlerChain.class); if (handlerChain == null && serviceEndpoint != null) { try { declaringClass = classLoader.loadClass(serviceEndpoint); handlerChain = declaringClass.getAnnotation(HandlerChain.class); } catch (final ClassNotFoundException ignored) { // no-op } } HandlerChains handlerChains = null; if (handlerChain != null) { try { final URL handlerFileURL = declaringClass.getResource(handlerChain.file()); handlerChains = ReadDescriptors.readHandlerChains(handlerFileURL); } catch (final Throwable e) { throw new OpenEJBException("Unable to load handler chain file: " + handlerChain.file(), e); } } return handlerChains; } }
public HandlerChainAnnotation getHandlerChainAnnotation(Class clazz) { HandlerChain handlerChain = (HandlerChain) clazz.getAnnotation(HandlerChain.class); HandlerChainAnnotation annotation = null; if (handlerChain != null) { annotation = new HandlerChainAnnotation(handlerChain.file(), handlerChain.name()); } return annotation; }
private static void processHandlerChainAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) { final javax.jws.HandlerChain handlerChainAnnotation = getAnnotation(anElement, javax.jws.HandlerChain.class); if (handlerChainAnnotation != null) { // Set the handlerChain from @HandlerChain on the annotated element String handlerChain = null; if (handlerChainAnnotation.file().length() > 0) handlerChain = handlerChainAnnotation.file(); // Resolve path to handler chain if (handlerChain != null) { try { new URL(handlerChain); } catch (MalformedURLException ignored) { final Class<?> declaringClass = getDeclaringClass(anElement); handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain; } serviceRefUMDM.setHandlerChain(handlerChain); } } }
private static void processHandlerChainAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) { final javax.jws.HandlerChain handlerChainAnnotation = getAnnotation(anElement, javax.jws.HandlerChain.class); if (handlerChainAnnotation != null) { // Set the handlerChain from @HandlerChain on the annotated element String handlerChain = null; if (handlerChainAnnotation.file().length() > 0) handlerChain = handlerChainAnnotation.file(); // Resolve path to handler chain if (handlerChain != null) { try { new URL(handlerChain); } catch (MalformedURLException ignored) { final Class<?> declaringClass = getDeclaringClass(anElement); handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain; } serviceRefUMDM.setHandlerChain(handlerChain); } } }
private static void processHandlerChainAnnotation(final AnnotatedElement anElement, final UnifiedServiceRefMetaData serviceRefUMDM) { final javax.jws.HandlerChain handlerChainAnnotation = getAnnotation(anElement, javax.jws.HandlerChain.class); if (handlerChainAnnotation != null) { // Set the handlerChain from @HandlerChain on the annotated element String handlerChain = null; if (handlerChainAnnotation.file().length() > 0) handlerChain = handlerChainAnnotation.file(); // Resolve path to handler chain if (handlerChain != null) { try { new URL(handlerChain); } catch (MalformedURLException ignored) { final Class<?> declaringClass = getDeclaringClass(anElement); handlerChain = declaringClass.getPackage().getName().replace('.', '/') + "/" + handlerChain; } serviceRefUMDM.setHandlerChain(handlerChain); } } }
static InputStream getFileAsStream(Class clazz, HandlerChain chain) { Package pkg = clazz.getPackage(); String filename = chain.file(); String fullpath = addPackagePath(filename, pkg); InputStream is; is = moduleResource(clazz, filename); if (is != null) return is; is = moduleResource(clazz, fullpath); if (is != null) return is; URL url = cpResource(clazz, filename); if (url == null) url = cpResource(clazz, fullpath); if (url == null) { throw new UtilException("util.failed.to.find.handlerchain.file", clazz.getName(), filename); } try { return url.openStream(); } catch (IOException e) { throw new UtilException("util.failed.to.parse.handlerchain.file", clazz.getName(), filename); } }
public static HandlerChainAnnot createFromAnnotation(Annotation annotation) { HandlerChainAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.jws.HandlerChain) { javax.jws.HandlerChain hc = (javax.jws.HandlerChain) annotation; returnAnnot = new HandlerChainAnnot(hc.file(), hc.name()); } return returnAnnot; }
public static HandlerChainAnnot createFromAnnotation(Annotation annotation) { HandlerChainAnnot returnAnnot = null; if (annotation != null && annotation instanceof javax.jws.HandlerChain) { javax.jws.HandlerChain hc = (javax.jws.HandlerChain) annotation; returnAnnot = new HandlerChainAnnot(hc.file(), hc.name()); } return returnAnnot; }
/** * This is a helper method to create a <code>HandlerChainAnnot</code> since the * * @param handlerChain - <code>HandlerChain</code> * @return - <code>HandlerChainAnnot</code> * @HandlerChain annotation may be present on a Type, Method, or Field. */ public static HandlerChainAnnot createHandlerChainAnnot(HandlerChain handlerChain) { HandlerChainAnnot hcAnnot = HandlerChainAnnot.createHandlerChainAnnotImpl(); hcAnnot.setFile(handlerChain.file()); hcAnnot.setName(handlerChain.name()); return hcAnnot; }
/** * This is a helper method to create a <code>HandlerChainAnnot</code> since the * * @param handlerChain - <code>HandlerChain</code> * @return - <code>HandlerChainAnnot</code> * @HandlerChain annotation may be present on a Type, Method, or Field. */ public static HandlerChainAnnot createHandlerChainAnnot(HandlerChain handlerChain) { HandlerChainAnnot hcAnnot = HandlerChainAnnot.createHandlerChainAnnotImpl(); hcAnnot.setFile(handlerChain.file()); hcAnnot.setName(handlerChain.name()); return hcAnnot; }
/** * This constructors has to be used on the endpoint side (@WebService annotated class). * @param clazz supporting class */ public AnnotationHandlerChainBuilder(final Class<?> clazz) { HandlerChainAnnotation annotation = findHandlerChainAnnotation(clazz, true); // If we found an annotation, use it if (annotation != null) { String file = annotation.getHandlerChain().file().trim(); if ((file == null) || ("".equals(file))) { throw new WebServiceException("@HandlerChain annotation on '" + clazz + "' is missing a valid 'file' value."); } URL location = getHandlerChainsLocation(file, annotation.getDeclaringClass()); try { handlerChainsElement = HandlerChainsLoader.loadHandlerChains(location, true); } catch (ParsingException e) { throw new WebServiceException("Cannot parse <handler-chains>", e); } } }