Refine search
private List<WeldCDIProvider> providers() { if (providers == null) { synchronized (this) { if (providers == null) { ImmutableList.Builder<WeldCDIProvider> builder = ImmutableList.builder(); for (WeldCDIProvider provider : ServiceLoader.load(WeldCDIProvider.class, CompositeCDIProvider.class.getClassLoader())) { builder.add(provider); } providers = builder.build(new Comparator<WeldCDIProvider>() { @Override public int compare(WeldCDIProvider o1, WeldCDIProvider o2) { return Integer.compare(o2.getPriority(), o1.getPriority()); } }); } } } return providers; }
public SimpleInterceptorInvocation(Object instance, InterceptionType interceptionType, List<Method> interceptorMethods, boolean targetClass) { this.instance = instance; this.interceptionType = interceptionType; this.targetClass = targetClass; if (interceptorMethods.size() == 1) { // Very often there will be only one interceptor method interceptorMethodInvocations = ImmutableList.<InterceptorMethodInvocation> of(new SimpleMethodInvocation(interceptorMethods.get(0))); } else { ImmutableList.Builder<InterceptorMethodInvocation> builder = ImmutableList.builder(); for (Method method : interceptorMethods) { builder.add(new SimpleMethodInvocation(method)); } interceptorMethodInvocations = builder.build(); } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanDirectory(File entryDirectory, ImmutableList.Builder<ScanResult> results) throws IOException { // First try to find beans.xml File beansXmlFile = new File(entryDirectory, AbstractWeldDeployment.BEANS_XML); if (beansXmlFile.canRead()) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryDirectory); final BeansXml beansXml = parseBeansXml(beansXmlFile.toURI().toURL()); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryDirectory.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryDirectory); File extensionFile = new File(entryDirectory, EXTENSION_FILE); if (!extensionFile.canRead()) { results.add(new ScanResult(null, entryDirectory.getPath())); } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
private void scanJarFile(File entryFile, ImmutableList.Builder<ScanResult> results) throws IOException { try (ZipFile zip = new ZipFile(entryFile)) { ZipEntry beansXmlEntry = zip.getEntry(AbstractWeldDeployment.BEANS_XML); if (beansXmlEntry != null) { logger.debugv(BEANS_XML_FOUND_MESSAGE, entryFile); BeansXml beansXml = parseBeansXml( new URL(PROCOTOL_JAR + ":" + entryFile.toURI().toURL().toExternalForm() + JAR_URL_SEPARATOR + beansXmlEntry.getName())); if (accept(beansXml)) { results.add(new ScanResult(beansXml, entryFile.getPath())); } } else { // No beans.xml found - check whether the bean archive contains an extension if (zip.getEntry(EXTENSION_FILE) == null) { logger.debugv(BEANS_XML_NOT_FOUND_MESSAGE, entryFile); results.add(new ScanResult(null, entryFile.getPath())); } } } }
public SimpleInterceptorInvocation(Object instance, InterceptionType interceptionType, List<Method> interceptorMethods, boolean targetClass) { this.instance = instance; this.interceptionType = interceptionType; this.targetClass = targetClass; if (interceptorMethods.size() == 1) { // Very often there will be only one interceptor method interceptorMethodInvocations = ImmutableList.<InterceptorMethodInvocation> of(new SimpleMethodInvocation(interceptorMethods.get(0))); } else { ImmutableList.Builder<InterceptorMethodInvocation> builder = ImmutableList.builder(); for (Method method : interceptorMethods) { builder.add(new SimpleMethodInvocation(method)); } interceptorMethodInvocations = builder.build(); } }
public static <X> List<AnnotatedParameter<X>> forExecutable(Executable executable, BackedAnnotatedCallable<X, ?> declaringCallable, SharedObjectCache cache) { final Parameter[] parameters = executable.getParameters(); if (parameters.length == 0) { return Collections.emptyList(); } ImmutableList.Builder<AnnotatedParameter<X>> builder = ImmutableList.builder(); for (int i = 0; i < parameters.length; i++) { builder.add(BackedAnnotatedParameter.of(parameters[i], i, declaringCallable, cache)); } return builder.build(); }