Package org.jboss.seam

Examples of org.jboss.seam.Component


      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(
            Seam.getComponentName(Manager.class) + ".component",
            new Component(Manager.class, appContext)
         );

      FacesLifecycle.beginRequest( externalContext );
      Contexts.getSessionContext().set( "foo", new Foo() );
     
      RemoveInterceptor ri = new RemoveInterceptor();
      ri.setComponent( new Component(Foo.class, appContext) );
     
      ri.aroundInvoke( new MockInvocationContext() {
         @Override
         public Method getMethod()
         {
View Full Code Here


import org.testng.annotations.Test;

public class ContextTest {
    private void installComponent(Context appContext, Class clazz) {
        appContext.set(Seam.getComponentName(clazz) + ".component",
                new Component(clazz));
    }
View Full Code Here

      Lifecycle.endCall();
   }
  
   protected void installComponent(Context appContext, Class clazz)
   {
      appContext.set(Seam.getComponentName(clazz) + ".component", new Component(clazz));
   }
View Full Code Here

      Lifecycle.endApplication();
   }

   private void installComponent(Context appContext, Class clazz)
   {
      appContext.set(Seam.getComponentName(clazz) + ".component", new Component(clazz));
   }
View Full Code Here

               {
                  log.info("redeploying components");
                  Seam.clearComponentNameCache();
                  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);
View Full Code Here

   {
      String name = descriptor.getName();
      String componentName = name + COMPONENT_SUFFIX;
      try
      {
         Component component = new Component(
               descriptor.getComponentClass(),
               name,
               descriptor.getScope(),
               descriptor.isStartup(),
               descriptor.getStartupDependencies(),
               descriptor.getJndiName()
            );
         context.set(componentName, component);
         if ( hotDeploymentStrategy != null && hotDeploymentStrategy.isEnabled() && hotDeploymentStrategy.isFromHotDeployClassLoader( descriptor.getComponentClass() ) )
         {
            Init.instance().addHotDeployableComponent( component.getName() );
         }
      }
      catch (Throwable e)
      {
         throw new RuntimeException("Could not create Component: " + name, e);
View Full Code Here

   {
      if ( component.isStartup() )
      {
         for ( String dependency: component.getDependencies() )
         {
            Component dependentComponent = Component.forName(dependency);
            if (dependentComponent!=null)
            {
               startup(dependentComponent);
            }
         }
View Full Code Here

      Lifecycle.startDestroying();
      try
      {
         for ( String name: context.getNames() )
         {
            Component component = Component.forName(name);
            log.debug("destroying: " + name);
            if ( component!=null )
            {
               Object object = context.get(name);
               if (object!=null) //in a portal environment, this is possible
               {
                  if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preDestroy." + name);
                  component.destroy(object);
               }
            }
         }
      }
      finally
View Full Code Here

      for ( String name: context.getNames() )
      {
         Object object = context.get(name);
         if ( object!=null && (object instanceof Component) )
         {
            Component component = (Component) object;
            if ( component.isStartup() && component.getScope()==scopeType )
            {
               startup(component);
            }
         }
      }
View Full Code Here

      }
    }

    private boolean isPerNestedConversation(String name)
    {
        Component component = Component.forName(name);
        return (component != null) && component.isPerNestedConversation();
    }
View Full Code Here

TOP

Related Classes of org.jboss.seam.Component

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.