This content has been marked as final.
Show 2 replies
-
1. Re: any way to defer Seam initialization to first request to webapp rather than at webapp start time?
gonorrhea Apr 6, 2009 10:23 PM (in response to ips)Your concept is similar to lazy loading in ORM frameworks like Hibernate.
Specifically, are you referring to
skipping
the following in the server.log during JBoss AS Seam app deploy?13:19:03,018 INFO [Initialization] Installing components... 13:19:03,065 INFO [Component] Component: applicationMetaData, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: com.cox.bets.session.ApplicationMetaDataAction, JNDI: BETS/ApplicationMetaDataAction/local 13:19:03,096 INFO [Component] Component: arbiTestView, scope: CONVERSATION, type: ENTITY_BEAN, class: .... 13:19:03,643 INFO [Initialization] done initializing Seam
I'm not sure if the functionality you're asking for is available or not (as a config in components.xml). I haven't heard anybody ask about this or covered in ref docs or Seam books up to 2.1.x.
The Seam devs would know better...
-
2. Re: any way to defer Seam initialization to first request to webapp rather than at webapp start time?
gonorrhea Apr 6, 2009 10:36 PM (in response to ips)I'm not sure how/what calls the public init() method below, but here is the pertinent code in Seam 2.1.1.GA org.jboss.seam.init.Initialization class. It looks like it is not configurable to lazy load the components. Perhaps someone will prove me wrong...
public Initialization init() { log.info("initializing Seam"); if (standardDeploymentStrategy == null) { 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; }