Examples of Init


Examples of org.jboss.seam.core.Init

   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
         );
      appContext.set(
View Full Code Here

Examples of org.jboss.seam.core.Init

      ServletLifecycle.beginApplication(servletContext);
      ExternalContext externalContext = new MockExternalContext(servletContext);
      new MockFacesContext( externalContext, new MockApplication() ).setCurrent().createViewRoot();
     
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
         );
      appContext.set(
View Full Code Here

Examples of org.jboss.seam.core.Init

   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
         );
      appContext.set(
View Full Code Here

Examples of org.jboss.seam.core.Init

        installComponent(appContext, ConversationEntries.class);
        installComponent(appContext, Manager.class);
        installComponent(appContext, Session.class);
        installComponent(appContext, ServletContexts.class);
        installComponent(appContext, Parameters.class);
        appContext.set(Seam.getComponentName(Init.class), new Init());

        installComponent(appContext, Bar.class);
        installComponent(appContext, Foo.class);
        appContext.set("otherFoo", new Foo());
View Full Code Here

Examples of org.jboss.seam.core.Init

        Map requestAdaptor = new ServletRequestMap(request);
        Context appContext = new ApplicationContext(externalContext
                .getApplicationMap());
        installComponent(appContext, ConversationEntries.class);
        installComponent(appContext, Manager.class);
        appContext.set(Seam.getComponentName(Init.class), new Init());
        FacesLifecycle.beginRequest(externalContext);
        Manager.instance().setLongRunningConversation(true);
        testContext(new ApplicationContext(externalContext.getApplicationMap()));
        testContext(new SessionContext(sessionAdaptor));
        testContext(new EventContext(requestAdaptor));
View Full Code Here

Examples of org.jboss.seam.core.Init

      installComponent(appContext, Manager.class);
      for (Class c : getComponentsToInstall())
      {
         installComponent(appContext, c);
      }
      appContext.set(Seam.getComponentName(Init.class), new Init());
      Lifecycle.beginCall();
   }
View Full Code Here

Examples of org.jboss.seam.core.Init

        throws Exception
    {
        new ComponentTest() {
            @Override
            protected void testComponents() throws Exception {
                Init init = Init.instance();
                init.addFactoryMethodExpression("namespaceTest.ns3.factory", "#{namespaceTest.fooFactory.createFoo}", ScopeType.SESSION);
               
                assert getValue("#{namespaceTest.ns3.factory}") != null;
            }
        }.run();
    }
View Full Code Here

Examples of org.jboss.seam.core.Init

        throws Exception
    {
        new ComponentTest() {
            @Override
            protected void testComponents() throws Exception {
                Init init = Init.instance();
                init.addFactoryValueExpression("namespaceTest.ns4.factory", "#{namespaceTest.fooFactory.createFoo()}", ScopeType.SESSION);
               
                assert getValue("#{namespaceTest.ns4.factory}") != null;
            }
        }.run();
    }
View Full Code Here

Examples of org.jboss.seam.core.Init

         throw new IllegalStateException("No deployment strategy!");
      }
      ServletLifecycle.beginInitialization();
      Contexts.getApplicationContext().set(Component.PROPERTIES, properties);
      addComponent( new ComponentDescriptor(Init.class), Contexts.getApplicationContext());
      Init init = (Init) Component.getInstance(Init.class, ScopeType.APPLICATION);
      // Make the deployment strategies available in the contexts. This gives
      // access to custom deployment handlers for processing custom annotations
      Contexts.getEventContext().set(StandardDeploymentStrategy.NAME, standardDeploymentStrategy);
      scanForComponents();
      ComponentDescriptor desc = findDescriptor(Jbpm.class);
      if (desc != null && desc.isInstalled())
      {
         init.setJbpmInstalled(true);
      }
      init.checkDefaultInterceptors();
      init.setTimestamp(System.currentTimeMillis());
      addSpecialComponents(init);
     
      // Add the war root deployment
      warRootDeploymentStrategy = new WarRootDeploymentStrategy(
            Thread.currentThread().getContextClassLoader(), warRoot, new File[] { warClassesDirectory, warLibDirectory, hotDeployDirectory });
      Contexts.getEventContext().set(WarRootDeploymentStrategy.NAME, warRootDeploymentStrategy);
      warRootDeploymentStrategy.scan();
      init.setWarTimestamp(System.currentTimeMillis());
     
      hotDeploymentStrategy = createHotDeployment(Thread.currentThread().getContextClassLoader(), isHotDeployEnabled(init));
      Contexts.getEventContext().set(HotDeploymentStrategy.NAME, hotDeploymentStrategy);
      init.setHotDeployPaths( hotDeploymentStrategy.getHotDeploymentPaths() );
     
      if (hotDeploymentStrategy.available())
      {
         hotDeploymentStrategy.scan();
         installHotDeployableComponents();
      }
     
      installComponents(init);
          
      for (String globalImport: globalImports)
      {
         init.importNamespace(globalImport);
      }
     
      ServletLifecycle.endInitialization();
      log.info("done initializing Seam");
      return this;
View Full Code Here

Examples of org.jboss.seam.core.Init

  
   private void registerConverterOrValidator(Context applicationContext)
   {
      if (applicationContext!=null) //for unit tests!
      {
         Init init = (Init) applicationContext.get( Seam.getComponentName(Init.class) );
         if (init!=null)
         {
            if ( getBeanClass().isAnnotationPresent(Converter.class) )
            {
               if(!getBeanClass().isAnnotationPresent(BypassInterceptors.class))
                  throw new IllegalStateException("Converter " + getBeanClass().getName()
                        + " must be annotated with @BypassInterceptors");
              
               Converter converter = getBeanClass().getAnnotation(Converter.class);
               if ( converter.forClass()!=void.class )
               {
                  init.getConvertersByClass().put( converter.forClass(), getName() );
               }
               String id = converter.id().equals("") ? getName() : converter.id();
               init.getConverters().put( id, getName() );
            }
            if ( getBeanClass().isAnnotationPresent(Validator.class) )
            {
               if(!getBeanClass().isAnnotationPresent(BypassInterceptors.class))
                  throw new IllegalStateException("Validator " + getBeanClass().getName()
                        + " must be annotated with @BypassInterceptors");

               Validator validator = getBeanClass().getAnnotation(Validator.class);
               String id = validator.id().equals("") ? getName() : validator.id();
               init.getValidators().put( id, getName() );
            }
         }
      }
   }
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.