Package org.jboss.seam

Examples of org.jboss.seam.ScopeType


      }
   }

   private void installRole(Class<?> scannedClass, Role role)
   {
      ScopeType scope = Seam.getComponentRoleScope(scannedClass, role);
      addComponentDescriptor( new ComponentDescriptor( role.name(), scannedClass, scope ) );
   }
View Full Code Here


        }
        else
        {
            // scope and create
            Boolean create = parseCreate(componentName);
            ScopeType scopeType = parseScopeType(componentName);
            // shorter name?
            int p = componentName.indexOf(";");
            if (p > 0)
                componentName = componentName.substring(p);
            // register component
View Full Code Here

        return create;
    }

    protected static ScopeType parseScopeType(String name)
    {
        ScopeType scopeType = null;
        Matcher scopeMatcher = SCOPE.matcher(name);
        if (scopeMatcher.find())
        {
            scopeType = ScopeType.valueOf(scopeMatcher.group(1));
        }
View Full Code Here

    {
        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

         {
            interceptionType = Boolean.valueOf(node.getAttributes().getNamedItem(
                     INTERCEPT_TYPE_ATTR).getNodeValue());
         }
         // get the requested scope
         ScopeType scope = ScopeType.valueOf(node.getAttributes().getNamedItem("scope")
                  .getNodeValue());
         if (scope != ScopeType.STATELESS
                  && !BeanDefinition.SCOPE_PROTOTYPE.equals(definition.getBeanDefinition()
                           .getScope()))
         {
View Full Code Here

        {
            // Iterate through all the beans in the factory
            for (String beanName : beanFactory.getBeanDefinitionNames())
            {
                BeanDefinition definition = beanFactory.getBeanDefinition(beanName);
                ScopeType scope;
                if (definition.getScope().startsWith(prefix))
                {
                    // Will throw an error if the scope is not found.
                    scope = ScopeType.valueOf(definition.getScope().replaceFirst(prefix, "").toUpperCase());
                }
View Full Code Here

            // if the class is a seam component
            if (d.isAnnotationPresent(Name.class)) {
                String name = d.getAnnotation(Name.class).value();
                Component component = Component.forName(name);
                if (component != null) {
                    ScopeType scope = component.getScope();
                    if (scope != ScopeType.STATELESS && scope.isContextActive()) {
                        scope.getContext().remove(name);
                    }
                    Init.instance().removeObserverMethods(component);
                }
                Contexts.getApplicationContext().remove(name + Initialization.COMPONENT_SUFFIX);
            }
View Full Code Here

      {
         throw new IllegalArgumentException(
                  "must specify either method or value in <factory/> declaration for variable: "
                           + name);
      }
      ScopeType scope = scopeName == null ? ScopeType.UNSPECIFIED : ScopeType.valueOf(scopeName
               .toUpperCase());
      boolean autoCreate = "true".equals(factory.attributeValue("auto-create"));
      factoryDescriptors.add(new FactoryDescriptor(name, scope, method, value, autoCreate));
   }
View Full Code Here

      String scopeName = component.attributeValue("scope");
      String jndiName = component.attributeValue("jndi-name");
      String precedenceString = component.attributeValue("precedence");
      int precedence = precedenceString==null ? Install.APPLICATION : Integer.valueOf(precedenceString);
      ScopeType scope = scopeName == null ? null : ScopeType.valueOf(scopeName.toUpperCase());
      String autocreateAttribute = component.attributeValue("auto-create");
      Boolean autoCreate = autocreateAttribute==null ? null : "true".equals(autocreateAttribute);
      String startupAttribute = component.attributeValue("startup");
      Boolean startup = startupAttribute==null ? null : "true".equals(startupAttribute);
      if (className != null)
View Full Code Here

      for ( String name: init.getHotDeployableComponents() )
      {
         Component component = Component.forName(name);
         if (component!=null)
         {
            ScopeType scope = component.getScope();
            if ( scope!=ScopeType.STATELESS && scope.isContextActive() )
            {
               scope.getContext().remove(name);
            }
         }
         Contexts.getApplicationContext().remove(name + ".component");
      }
      //TODO open the ability to reuse the classloader by looking at the components class classloaders
View Full Code Here

TOP

Related Classes of org.jboss.seam.ScopeType

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.