Package org.jboss.weld.resources.spi

Examples of org.jboss.weld.resources.spi.ResourceLoader


                    }
                }
                return Collections.enumeration(urls);
            }
        };
        final ResourceLoader loader = new ClassLoaderResourceLoader(classLoader);

        this.weld = new Weld() {
            @Override
            protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) {
                return super.createDeployment(loader, bootstrap);
View Full Code Here


        EjbDescriptors ejbDescriptors = new EjbDescriptors();

        ServiceRegistry registry = beanDeploymentArchive.getServices();
        registry.add(EjbDescriptors.class, ejbDescriptors);

        ResourceLoader resourceLoader = registry.get(ResourceLoader.class);
        if (resourceLoader == null) {
            resourceLoader = DefaultResourceLoader.INSTANCE;
            registry.add(ResourceLoader.class, resourceLoader);
        }
View Full Code Here

      @Override
      public Callable<Object> call() throws Exception
      {
         try
         {
            ResourceLoader resourceLoader = new AddonResourceLoader(addon);
            ModularURLScanner scanner = new ModularURLScanner(resourceLoader, "META-INF/beans.xml");
            ModuleScanResult scanResult = scanner.scan();

            Callable<Object> shutdownCallback = null;
View Full Code Here

      super(archive);
      Validate.notNull(archive, "Archive must be specified");
     
      this.classLoader = new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
     
      serviceRegistry.add(ResourceLoader.class, new ResourceLoader()
      {
         public void cleanup() { }
        
         public Collection<URL> getResources(String name)
         {
View Full Code Here

      super(archive);
      Validate.notNull(archive, "Archive must be specified");
     
      this.classLoader = new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
     
      serviceRegistry.add(ResourceLoader.class, new ResourceLoader()
      {
         public void cleanup() { }
        
         public Collection<URL> getResources(String name)
         {
View Full Code Here

     * beans and events can be accessed.
     *
     * @return weld container
     */
    public WeldContainer initialize() {
        ResourceLoader resourceLoader = new WeldResourceLoader();
        // check for beans.xml
        if (resourceLoader.getResource(WeldDeployment.BEANS_XML) == null) {
            throw CommonLogger.LOG.missingBeansXml();
        }

        final CDI11Bootstrap bootstrap;
        try {
            bootstrap = (CDI11Bootstrap) resourceLoader.classForName(BOOTSTRAP_IMPL_CLASS_NAME).newInstance();
        } catch (InstantiationException ex) {
            throw CommonLogger.LOG.errorLoadingWeld();
        } catch (IllegalAccessException ex) {
            throw CommonLogger.LOG.errorLoadingWeld();
        }
View Full Code Here

    }

    private Set<ResourceLoader> getResourceLoaders() {
        Set<ResourceLoader> resourceLoaders = new HashSet<>();
        for (BeanDeploymentArchive archive : deployment.getBeanDeploymentArchives()) {
            ResourceLoader resourceLoader = archive.getServices().get(ResourceLoader.class);
            if (resourceLoader != null) {
                resourceLoaders.add(resourceLoader);
            }
        }
        resourceLoaders.add(WeldClassLoaderResourceLoader.INSTANCE);
View Full Code Here

            final BeanManagerImpl manager = Container.instance(identifier).activityManager(identifier.getBdaId());
            if (manager == null) {
                return null;
            }
            // second, try to load the class
            final ResourceLoader resourceLoader = manager.getServices().get(ResourceLoader.class);
            Class<?> clazz = null;
            try {
                clazz = resourceLoader.classForName(identifier.getClassName());
            } catch (ResourceLoadingException e) {
                MetadataLogger.LOG.catchingDebug(e);
                return null;
            }
            // finally, try to load the annotated type
View Full Code Here

   }

   @Override
   public void start(Addon addon) throws Exception
   {
      ResourceLoader resourceLoader = new AddonResourceLoader(addon);
      ModularURLScanner scanner = new ModularURLScanner(resourceLoader, "META-INF/beans.xml");
      ModuleScanResult scanResult = scanner.scan();

      if (!scanResult.getDiscoveredResourceUrls().isEmpty())
      {
View Full Code Here

      super(archive);
      Validate.notNull(archive, "Archive must be specified");
     
      this.classLoader = new ShrinkWrapClassLoader(archive.getClass().getClassLoader(), archive);
     
      serviceRegistry.add(ResourceLoader.class, new ResourceLoader()
      {
         public void cleanup() { }
        
         public Collection<URL> getResources(String name)
         {
View Full Code Here

TOP

Related Classes of org.jboss.weld.resources.spi.ResourceLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.