Package org.jboss.weld.resources.spi

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


   }

   @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


    public EjbDescriptorImpl(EJBComponentDescription componentDescription, BeanDeploymentArchiveImpl beanDeploymentArchive, final DeploymentReflectionIndex reflectionIndex) {
        final SessionBeanComponentDescription description = componentDescription instanceof SessionBeanComponentDescription ? (SessionBeanComponentDescription) componentDescription : null;
        final Set<BusinessInterfaceDescriptor<?>> localInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        final Set<BusinessInterfaceDescriptor<?>> remoteInterfaces = new HashSet<BusinessInterfaceDescriptor<?>>();
        final ResourceLoader loader = beanDeploymentArchive.getServices().get(ResourceLoader.class);

        ejbClass = (Class<T>) loader.classForName(componentDescription.getEJBClassName());

        if (componentDescription.getViews() != null) {
            for (ViewDescription view : componentDescription.getViews()) {

                if (description == null || getMethodIntf(view) == MethodIntf.LOCAL) {
                    final String viewClassName = view.getViewClassName();
                    localInterfaces.add(new BusinessInterfaceDescriptorImpl<Object>(beanDeploymentArchive, viewClassName));
                } else if (getMethodIntf(view) == MethodIntf.REMOTE) {
                    remoteInterfaces.add(new BusinessInterfaceDescriptorImpl<Object>(beanDeploymentArchive, view.getViewClassName()));
                }
            }
        }
        if(componentDescription instanceof StatefulComponentDescription) {
            Set<Method> removeMethods = new HashSet<Method>();
            final Collection<StatefulComponentDescription.StatefulRemoveMethod> methods = ((StatefulComponentDescription) componentDescription).getRemoveMethods();
            for(final StatefulComponentDescription.StatefulRemoveMethod method : methods) {
                Class<?> c = ejbClass;
                while (c != null && c != Object.class) {
                    ClassReflectionIndex<?> index = reflectionIndex.getClassIndex(c);
                    Method m = index.getMethod(method.getMethodIdentifier());
                    if(m != null) {
                        removeMethods.add(m);
                    }
                    c = c.getSuperclass();
                }
            }
            this.removeMethods = Collections.unmodifiableSet(removeMethods);
        } else {
            removeMethods = Collections.emptySet();
        }


        this.ejbName = componentDescription.getEJBName();
        Map<Class<?>, ServiceName> viewServices = new HashMap<Class<?>, ServiceName>();
        for (ViewDescription view : componentDescription.getViews()) {
            viewServices.put(loader.classForName(view.getViewClassName()), view.getServiceName());
        }
        this.viewServices = Collections.unmodifiableMap(viewServices);
        this.localInterfaces = localInterfaces;
        this.remoteInterfaces = remoteInterfaces;
        this.baseName = componentDescription.getServiceName();
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

    //
    BeansXml xml = owner.bootstrap.parse(xmlURLs);

    //
//      URLClassLoader classLoader = new URLClassLoader(fsURLs.toArray(new URL[fsURLs.size()]), owner.classLoader);
    ResourceLoader loader = new ClassLoaderResourceLoader(owner.classLoader);

    //
    ServiceRegistry registry = new SimpleServiceRegistry();
    registry.add(ResourceLoader.class, loader);
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.