Package org.jboss.seam.core

Examples of org.jboss.seam.core.Init


   }

   public static Object getInstanceFromFactory(String name)
   {
      Init init = Init.instance();
      if (init==null) //for unit tests, yew!
      {
         return null;
      }
      else
      {
         Init.FactoryMethod factoryMethod = init.getFactory(name);
         Init.FactoryExpression methodBinding = init.getFactoryMethodExpression(name);
         Init.FactoryExpression valueBinding = init.getFactoryValueExpression(name);
         if ( methodBinding!=null && getOutScope( methodBinding.getScope(), null ).isContextActive() ) //let the XML take precedence
         {
            Object result = methodBinding.getMethodBinding().invoke();
            return handleFactoryMethodResult( name, null, result, methodBinding.getScope() );
         }
View Full Code Here


      ServletLifecycle.beginInitialization();
      Contexts.getApplicationContext().set(Component.PROPERTIES, properties);
      scanForHotDeployableComponents();
      scanForComponents();
      addComponent( new ComponentDescriptor(Init.class), Contexts.getApplicationContext());
      Init init = (Init) Component.getInstance(Init.class, ScopeType.APPLICATION);   
      ComponentDescriptor desc = findDescriptor(Jbpm.class);
      if (desc != null && desc.isInstalled())
      {
         init.setJbpmInstalled(true);
      }
      init.setTimestamp( System.currentTimeMillis() );
      if (hotDeploymentStrategy != null)
      {
         init.setHotDeployPaths( hotDeploymentStrategy.getHotDeploymentPaths() );
      }
      addSpecialComponents(init);
      installComponents(init);
     
      for (String globalImport: globalImports)
      {
         init.importNamespace(globalImport);
      }
     
      ServletLifecycle.endInitialization();
      log.info("done initializing Seam");
      return this;
View Full Code Here

   public Initialization redeploy(HttpServletRequest request)
   {
      log.info("redeploying");
      ServletLifecycle.beginReinitialization(request);
      Init init = Init.instance();
      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);
      }
      //TODO open the ability to reuse the classloader by looking at the components class classloaders
      scanForHotDeployableComponents();
      init.setTimestamp( System.currentTimeMillis() );
      init.setHotDeployPaths(hotDeploymentStrategy.getHotDeploymentPaths());
      installComponents(init);
      ServletLifecycle.endInitialization();
      log.info("done redeploying");
      return this;
   }
View Full Code Here

         );
      appContext.set(
            Seam.getComponentName(Manager.class) + ".component",
            new Component(Manager.class, appContext)
         );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
     
      appContext.set(
            Seam.getComponentName(Bar.class) + ".component",
            new Component(Bar.class, appContext)
      );
View Full Code Here

         );
      appContext.set(
            Seam.getComponentName(Manager.class) + ".component",
            new Component(Manager.class)
         );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      Lifecycle.beginRequest(externalContext);
      Manager.instance().setLongRunningConversation(true);
      testContext( new FacesApplicationContext(externalContext) );
      testContext( new WebSessionContext(sessionAdaptor) );
      testContext( new WebRequestContext(requestAdaptor) );
View Full Code Here

   public void testBijectionInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      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

   public void testConversationInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      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

   public void testConversationalInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      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

      MockServletContext servletContext = new MockServletContext();
      ExternalContext externalContext = new MockExternalContext(servletContext);
      new MockFacesContext( externalContext, new MockApplication() ).setCurrent().createViewRoot();
     
      Context appContext = new FacesApplicationContext(externalContext);
      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

   public void testRemoveInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new FacesApplicationContext(externalContext);
      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

TOP

Related Classes of org.jboss.seam.core.Init

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.