Examples of ScopeType


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

Examples of org.jboss.seam.ScopeType

      {
         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 = Boolean.parseBoolean(factory.attributeValue("auto-create"));
      factoryDescriptors.add(new FactoryDescriptor(name, scope, method, value, autoCreate));
   }
View Full Code Here

Examples of org.jboss.seam.ScopeType

      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 : Boolean.parseBoolean(autocreateAttribute);
      String startupAttribute = component.attributeValue("startup");
      Boolean startup = startupAttribute==null ? null : Boolean.parseBoolean(startupAttribute);
      String startupDependsAttribute = component.attributeValue("startupDepends");
View Full Code Here

Examples of org.jboss.seam.ScopeType

            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);
                  }
                  init.removeObserverMethods(component);
               }
               Contexts.getApplicationContext().remove(name + COMPONENT_SUFFIX);
            }
View Full Code Here

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

Examples of org.jboss.seam.ScopeType

        }
        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

Examples of org.jboss.seam.ScopeType

        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

Examples of org.jboss.seam.ScopeType

    {
        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

Examples of org.jboss.seam.ScopeType

         {
            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

Examples of org.jboss.seam.ScopeType

        {
            // 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
TOP
Copyright © 2018 www.massapi.com. 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.