Package org.jboss.seam.annotations

Examples of org.jboss.seam.annotations.Name


         }

         try {
           //get the class implied by the namespaced XML element name
           Class<Object> clazz = Reflections.classForName(className);
           Name nameAnnotation = clazz.getAnnotation(Name.class);

           //if the name attribute is not explicitly specified in the XML,
           //imply the name from the @Name annotation on the class implied
           //by the XML element name
           if (name == null && nameAnnotation!=null) {
             name = nameAnnotation.value();
           }

           //if this class already has the @Name annotation, the XML element
           //is just adding configuration to the existing component, don't
           //add another ComponentDescriptor (this is super-important to
           //allow overriding!)
           if (nameAnnotation!=null && nameAnnotation.value().equals(name)) {
             Install install = clazz.getAnnotation(Install.class);
             if (install == null || install.value()) {
               className = null;
             }
           }
View Full Code Here


  
   public static String searchComponentName(Class<?> clazz)
   {
      while ( clazz!=null && !Object.class.equals(clazz) )
      {
         Name name = clazz.getAnnotation(Name.class);
         if ( name!=null ) return name.value();
         clazz = clazz.getSuperclass();
      }
      return null;
   }
View Full Code Here

  
   public static String searchComponentName(Class<?> clazz)
   {
      while ( clazz!=null && !Object.class.equals(clazz) )
      {
         Name name = clazz.getAnnotation(Name.class);
         if ( name!=null ) return name.value();
         clazz = clazz.getSuperclass();
      }
      return null;
   }
View Full Code Here

         }

         try {
           //get the class implied by the namespaced XML element name
           Class<Object> clazz = Reflections.classForName(className);
           Name nameAnnotation = clazz.getAnnotation(Name.class);

           //if the name attribute is not explicitly specified in the XML,
           //imply the name from the @Name annotation on the class implied
           //by the XML element name
           if (name == null && nameAnnotation!=null) {
             name = nameAnnotation.value();
           }

           //if this class already has the @Name annotation, the XML element
           //is just adding configuration to the existing component, don't
           //add another ComponentDescriptor (this is super-important to
           //allow overriding!)
           if (nameAnnotation!=null && nameAnnotation.value().equals(name)) {
             Install install = clazz.getAnnotation(Install.class);
             if (install == null || install.value()) {
               className = null;
             }
           }
View Full Code Here

   public void addDestinations(Collection<Class<?>> destinations) {                           
      for (Class<?> annotatedClass: destinations) {
         log.info("Adding scanned flex desitionation for class " + annotatedClass);
         FlexRemote fr = annotatedClass.getAnnotation(FlexRemote.class);
        
         Name name = annotatedClass.getAnnotation(Name.class);
        
         String destinationName = fr.name();
         String componentName = name.value();
         Destination destination = createDestination(destinationName, componentName);
        
         destination.start();  
      }
   }
View Full Code Here

            }                     
         }

         try {
               Class<Object> clazz = null;
               Name nameAnnotation = null;
               if (className != null) {
               //get the class implied by the namespaced XML element name
               clazz = Reflections.classForName(className);
               nameAnnotation = clazz.getAnnotation(Name.class);
               }

           //if the name attribute is not explicitly specified in the XML,
           //imply the name from the @Name annotation on the class implied
           //by the XML element name
           if (name == null && nameAnnotation!=null) {
             name = nameAnnotation.value();
           }

           //if this class already has the @Name annotation, the XML element
           //is just adding configuration to the existing component, don't
           //add another ComponentDescriptor (this is super-important to
           //allow overriding!)
           if (nameAnnotation!=null && nameAnnotation.value().equals(name)) {
             Install install = clazz.getAnnotation(Install.class);
             if (install == null || install.value()) {
               className = null;
             }
           }
View Full Code Here

            }                     
         }

         try {
               Class<Object> clazz = null;
               Name nameAnnotation = null;
               if (className != null) {
               //get the class implied by the namespaced XML element name
               clazz = Reflections.classForName(className);
               nameAnnotation = clazz.getAnnotation(Name.class);
               }

           //if the name attribute is not explicitly specified in the XML,
           //imply the name from the @Name annotation on the class implied
           //by the XML element name
           if (name == null && nameAnnotation!=null) {
             name = nameAnnotation.value();
           }

           //if this class already has the @Name annotation, the XML element
           //is just adding configuration to the existing component, don't
           //add another ComponentDescriptor (this is super-important to
           //allow overriding!)
           if (nameAnnotation!=null && nameAnnotation.value().equals(name)) {
             Install install = clazz.getAnnotation(Install.class);
             if (install == null || install.value()) {
               className = null;
             }
           }
View Full Code Here

  
   public static String searchComponentName(Class<?> clazz)
   {
      while ( clazz!=null && !Object.class.equals(clazz) )
      {
         Name name = clazz.getAnnotation(Name.class);
         if ( name!=null ) return name.value();
         clazz = clazz.getSuperclass();
      }
      return null;
   }
View Full Code Here

            }                     
         }

         try {
               Class<Object> clazz = null;
               Name nameAnnotation = null;
               if (className != null) {
               //get the class implied by the namespaced XML element name
               clazz = Reflections.classForName(className);
               nameAnnotation = clazz.getAnnotation(Name.class);
               }

           //if the name attribute is not explicitly specified in the XML,
           //imply the name from the @Name annotation on the class implied
           //by the XML element name
           if (name == null && nameAnnotation!=null) {
             name = nameAnnotation.value();
           }

           //if this class already has the @Name annotation, the XML element
           //is just adding configuration to the existing component, don't
           //add another ComponentDescriptor (this is super-important to
           //allow overriding!)
           if (nameAnnotation!=null && nameAnnotation.value().equals(name)) {
             Install install = clazz.getAnnotation(Install.class);
             if (install == null || install.value()) {
               className = null;
             }
           }
View Full Code Here

    public Object invoke(Invocation invocation) throws Throwable
    {
        MethodInvocation mi = (MethodInvocation)invocation;
        KernelControllerContext context = (KernelControllerContext)mi.getArguments()[0];
        Name name = (Name)invocation.resolveClassAnnotation(Name.class);
        Scope scope = (Scope)invocation.resolveClassAnnotation(Scope.class);
        ScopeType scopeType = scope != null ? scope.value() : null;
        if ("setKernelControllerContext".equals(mi.getMethod().getName()) && name != null)
        {
            Object target = context.getTarget();
            boolean unmockApplication = false;
            if (!Contexts.isApplicationContextActive())
            {
                Lifecycle.mockApplication();
                unmockApplication = true;
            }
            try
            {
                Contexts.getApplicationContext().set(
                        name + Initialization.COMPONENT_SUFFIX,
                        new MicrocontainerComponent(target.getClass(), name.value(), scopeType, context.getController())
                );
            }
            finally
            {
                if (unmockApplication)
                {
                    Lifecycle.unmockApplication();
                }
            }
        }
        else if (name != null && scopeType != null)
        {
            scopeType.getContext().remove(name.value());
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.annotations.Name

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.