Package javax.annotation

Examples of javax.annotation.Resources


         loadEnvEntry(container, xml.getEnvironmentEntries());
   }

   public void handleClassAnnotations(Class<?> clazz, InjectionContainer container)
   {
      Resources resources = container.getAnnotation(Resources.class, clazz);
      if (resources != null)
      {
      for (Resource ref : resources.value())
      {
         handleClassAnnotation(ref, container, clazz);
      }
      }
      Resource res = container.getAnnotation(Resource.class, clazz);
View Full Code Here


        }
        /* Process Resources annotation.
         * Ref JSR 250
         */
        if (classClass.isAnnotationPresent(Resources.class)) {
            Resources annotation = (Resources)
                classClass.getAnnotation(Resources.class);
            for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) {
                addResource(context, annotation.value()[i]);
            }
        }
        /* Process EJB annotation.
         * Ref JSR 224, equivalent to the ejb-ref or ejb-local-ref
         * element in the deployment descriptor.
        if (classClass.isAnnotationPresent(EJB.class)) {
            EJB annotation = (EJB)
            classClass.getAnnotation(EJB.class);
           
            if ((annotation.mappedName().length() == 0) ||
                    annotation.mappedName().equals("Local")) {
               
                ContextLocalEjb ejb = new ContextLocalEjb();
               
                ejb.setName(annotation.name());
                ejb.setType(annotation.beanInterface().getCanonicalName());
                ejb.setDescription(annotation.description());
               
                ejb.setHome(annotation.beanName());
               
                context.getNamingResources().addLocalEjb(ejb);
               
            } else if (annotation.mappedName().equals("Remote")) {
               
                ContextEjb ejb = new ContextEjb();
               
                ejb.setName(annotation.name());
                ejb.setType(annotation.beanInterface().getCanonicalName());
                ejb.setDescription(annotation.description());
               
                ejb.setHome(annotation.beanName());
               
                context.getNamingResources().addEjb(ejb);
               
            }
           
        }
         */
        /* Process WebServiceRef annotation.
         * Ref JSR 224, equivalent to the service-ref element in
         * the deployment descriptor.
         * The service-ref registration is not implemented
        if (classClass.isAnnotationPresent(WebServiceRef.class)) {
            WebServiceRef annotation = (WebServiceRef)
            classClass.getAnnotation(WebServiceRef.class);
           
            ContextService service = new ContextService();
           
            service.setName(annotation.name());
            service.setWsdlfile(annotation.wsdlLocation());
           
            service.setType(annotation.type().getCanonicalName());
           
            if (annotation.value() == null)
                service.setServiceinterface(annotation.type().getCanonicalName());
           
            if (annotation.type().getCanonicalName().equals("Service"))
                service.setServiceinterface(annotation.type().getCanonicalName());
           
            if (annotation.value().getCanonicalName().equals("Endpoint"))
                service.setServiceendpoint(annotation.type().getCanonicalName());
           
            service.setPortlink(annotation.type().getCanonicalName());
           
            context.getNamingResources().addService(service);
           
           
        }
         */
        /* Process DeclareRoles annotation.
         * Ref JSR 250, equivalent to the security-role element in
         * the deployment descriptor
         */
        if (classClass.isAnnotationPresent(DeclareRoles.class)) {
            DeclareRoles annotation = (DeclareRoles)
                classClass.getAnnotation(DeclareRoles.class);
            for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) {
                context.addSecurityRole(annotation.value()[i]);
            }
        }
       
       
    }
View Full Code Here

        List<Class> classeswithResources = classFinder.findAnnotatedClasses(Resources.class);

        // Class-level annotation(s)
        List<Resource> resourceList = new ArrayList<Resource>();
        for (Class cls : classeswithResources) {
            Resources resources = (Resources) cls.getAnnotation(Resources.class);
            if (resources != null) {
                resourceList.addAll(Arrays.asList(resources.value()));
            }
            for (Resource resource : resourceList) {
                resourceProcessor.processResource(annotatedApp, resource, cls, null, null);
            }
            resourceList.clear();
View Full Code Here

        assert annotation instanceof Resource || annotation instanceof Resources : annotation;

        if (annotation instanceof Resource) {
            injectResourceClassLevel(clz, (Resource)annotation);
        } else if (annotation instanceof Resources) {
            Resources resources = (Resources)annotation;
            for (Resource resource : resources.value()) {
                injectResourceClassLevel(clz, resource);
            }
        }

    }
View Full Code Here

            // @Resource
            //

            List<Resource> resourceList = new ArrayList<Resource>();
            for (Class<?> clazz : classFinder.findAnnotatedClasses(Resources.class)) {
                Resources resources = clazz.getAnnotation(Resources.class);
                resourceList.addAll(asList(resources.value()));
            }
            for (Class<?> clazz : classFinder.findAnnotatedClasses(Resource.class)) {
                Resource resource = clazz.getAnnotation(Resource.class);
                resourceList.add(resource);
            }
View Full Code Here

        }
        /* Process Resources annotation.
         * Ref JSR 250
         */
        if (classClass.isAnnotationPresent(Resources.class)) {
            Resources annotation = classClass.getAnnotation(Resources.class);
            for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) {
                addResource(context, annotation.value()[i]);
            }
        }
        /* Process EJB annotation.
         * Ref JSR 224, equivalent to the ejb-ref or ejb-local-ref
         * element in the deployment descriptor.
        if (classClass.isAnnotationPresent(EJB.class)) {
            EJB annotation = (EJB)
            classClass.getAnnotation(EJB.class);

            if ((annotation.mappedName().length() == 0) ||
                    annotation.mappedName().equals("Local")) {

                ContextLocalEjb ejb = new ContextLocalEjb();

                ejb.setName(annotation.name());
                ejb.setType(annotation.beanInterface().getCanonicalName());
                ejb.setDescription(annotation.description());

                ejb.setHome(annotation.beanName());

                context.getNamingResources().addLocalEjb(ejb);

            } else if (annotation.mappedName().equals("Remote")) {

                ContextEjb ejb = new ContextEjb();

                ejb.setName(annotation.name());
                ejb.setType(annotation.beanInterface().getCanonicalName());
                ejb.setDescription(annotation.description());

                ejb.setHome(annotation.beanName());

                context.getNamingResources().addEjb(ejb);

            }

        }
         */
        /* Process WebServiceRef annotation.
         * Ref JSR 224, equivalent to the service-ref element in
         * the deployment descriptor.
         * The service-ref registration is not implemented
        if (classClass.isAnnotationPresent(WebServiceRef.class)) {
            WebServiceRef annotation = (WebServiceRef)
            classClass.getAnnotation(WebServiceRef.class);

            ContextService service = new ContextService();

            service.setName(annotation.name());
            service.setWsdlfile(annotation.wsdlLocation());

            service.setType(annotation.type().getCanonicalName());

            if (annotation.value() == null)
                service.setServiceinterface(annotation.type().getCanonicalName());

            if (annotation.type().getCanonicalName().equals("Service"))
                service.setServiceinterface(annotation.type().getCanonicalName());

            if (annotation.value().getCanonicalName().equals("Endpoint"))
                service.setServiceendpoint(annotation.type().getCanonicalName());

            service.setPortlink(annotation.type().getCanonicalName());

            context.getNamingResources().addService(service);


        }
         */
        /* Process DeclareRoles annotation.
         * Ref JSR 250, equivalent to the security-role element in
         * the deployment descriptor
         */
        if (classClass.isAnnotationPresent(DeclareRoles.class)) {
            DeclareRoles annotation =
                classClass.getAnnotation(DeclareRoles.class);
            for (int i = 0; annotation.value() != null && i < annotation.value().length; i++) {
                context.addSecurityRole(annotation.value()[i]);
            }
        }
    }
View Full Code Here

        _wac = wac;
    }
   
    public void doHandle (Class<?> clazz)
    {
        Resources resources = (Resources)clazz.getAnnotation(Resources.class);
        if (resources != null)
        {
            Resource[] resArray = resources.value();
            if (resArray==null||resArray.length==0)
            {
                LOG.warn ("Skipping empty or incorrect Resources annotation on "+clazz.getName());
                return;
            }
View Full Code Here

            // @Resource
            //

            List<Resource> resourceList = new ArrayList<Resource>();
            for (Class<?> clazz : classFinder.findAnnotatedClasses(Resources.class)) {
                Resources resources = clazz.getAnnotation(Resources.class);
                resourceList.addAll(asList(resources.value()));
            }
            for (Class<?> clazz : classFinder.findAnnotatedClasses(Resource.class)) {
                Resource resource = clazz.getAnnotation(Resource.class);
                resourceList.add(resource);
            }
View Full Code Here

        List<Class> classeswithResources = classFinder.findAnnotatedClasses(Resources.class);

        // Class-level annotation(s)
        List<Resource> resourceList = new ArrayList<Resource>();
        for (Class cls : classeswithResources) {
            Resources resources = (Resources) cls.getAnnotation(Resources.class);
            if (resources != null) {
                resourceList.addAll(Arrays.asList(resources.value()));
            }
            for (Resource resource : resourceList) {
                resourceProcessor.processResource(annotatedApp, resource, cls, null, null);
            }
            resourceList.clear();
View Full Code Here

            // @Resource
            //

            final List<Resource> resourceList = new ArrayList<Resource>();
            for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(Resources.class)) {
                final Resources resources = clazz.getAnnotation(Resources.class);
                resourceList.addAll(Arrays.asList(resources.value()));
            }
            for (final Annotated<Class<?>> clazz : annotationFinder.findMetaAnnotatedClasses(Resource.class)) {
                final Resource resource = clazz.getAnnotation(Resource.class);
                resourceList.add(resource);
            }
View Full Code Here

TOP

Related Classes of javax.annotation.Resources

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.