public boolean accepts(ResourceContext resource) { return resource.getUrl().toString().contains("weld.deployer") == false; } }
/** * Log throwable. * * @param resource the resource we're visiting * @param t the throwable */ protected void logThrowable(ResourceContext resource, Throwable t) { if (log.isTraceEnabled()) log.trace("Exception reading resource: " + resource.getResourceName(), t); }
/** * This one loads the class. * * @param resource the resource * @return the owner url */ public URL findOwnerURL(ResourceContext resource) { if (resource.isClass() == false) throw new IllegalArgumentException("Can only handle classes: " + resource); Class<?> clazz = resource.loadClass(); ProtectionDomain domain = clazz.getProtectionDomain(); CodeSource source = domain.getCodeSource(); return source.getLocation(); } }
public TypeInfo getTypeInfo(ResourceContext resource) throws Throwable { return configurator.getTypeInfo(resource.getClassName(), resource.getClassLoader()); } }
public boolean accepts(ResourceContext resource) if (resource.isClass() == false) return false; URL url = resource.getUrl(); String urlString = url.toExternalForm(); List<PathMetaData> paths = smd.getPaths(); String resourceName = resource.getResourceName(); boolean explicitInclude = false; // do we have an explicit include
return false; URL url = resource.getUrl(); String urlString = url.toExternalForm(); for (Map.Entry<String, RootNode> root : roots.entrySet()) String resourceName = resource.getResourceName(); List<String> tokens = PathTokenizer.getTokens(resourceName); Node current = rootNode;
public boolean accepts(ResourceContext resource) { return resource.isClass(); }
public TypeInfo getTypeInfo(ResourceContext resource) throws Throwable { InputStream stream = resource.getInputStream(); if (stream == null) throw new IllegalArgumentException("Null stream: " + resource); try { CtClass ctClass = getClassPool(resource.getClassLoader()).makeClassIfNew(stream); return JavassistUtil.toTypeInfo(ctClass); } finally { stream.close(); } } }
public void visit(ResourceContext resource) { wbdi.addWeldClass(resource.getClassName()); } }
public TypeInfo getTypeInfo(ResourceContext resource) throws Throwable { return factory.getTypeInfo(resource.loadClass()); } }
public TypeInfo createTypeInfo(ResourceContext context) throws Exception { InputStream stream = context.getInputStream(); if (stream == null) throw new IllegalArgumentException("Null stream: " + context); try { CtClass ctClass = pool.makeClassIfNew(stream); return JavassistUtil.toTypeInfo(ctClass); } finally { stream.close(); } } }
public boolean accepts(ResourceContext resource) if (resource.isClass() == false) return false; URL url = resource.getUrl(); String urlString = url.toExternalForm(); List<PathMetaData> paths = smd.getPaths(); String resourceName = resource.getResourceName(); boolean explicitInclude = false; // do we have an explicit include
public void visit(ResourceContext resource) { if (resource.isClass() == false) return; try { doVisit(resource); } catch (Throwable t) { if (errorHandler != null) errorHandler.handleError(this, resource, t); else if (ignoreError) logThrowable(resource, t); else throw new RuntimeException(t); } }
public void visit(ResourceContext resource) { env.addWeldClass(resource.getClassName()); } }
public TypeInfo createTypeInfo(ResourceContext context) throws Exception { return factory.getTypeInfo(context.loadClass()); } }
public boolean accepts(ResourceContext resource) { URL url = resource.getUrl(); String urlString = url.toExternalForm(); List<PathMetaData> paths = smd.getPaths(); if (paths != null && paths.isEmpty() == false) { for (PathMetaData pmd : paths) { String name = pmd.getPathName(); // url contains path if (urlString.contains(name)) { return true; } } } return false; } }
/** * Log throwable. * * @param resource the resource we're visiting * @param t the throwable */ protected void logThrowable(ResourceContext resource, Throwable t) { if (log.isTraceEnabled()) log.trace("Exception reading resource: " + resource.getResourceName(), t); }
public void visit(ResourceContext resource) { wbdi.addWeldClass(resource.getClassName()); } }
public boolean accepts(ResourceContext resource) { try { URL url = resource.getUrl(); VirtualFile file = VFS.getChild(url.toURI()); VirtualFile[] parents = file.getParentFiles(); // we're going from the end, from API the first element is the leafmost. for (VirtualFile parent : parents) { // is our resource part of weld's classpath if (cpFiles.contains(parent)) return true; } return false; } catch (Exception e) { throw new RuntimeException(e); } } };