[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2159) Let's use component scope in lookupInStatefulContexts

Dmitriy Lapko (JIRA) jira-events at lists.jboss.org
Fri Oct 26 03:06:01 EDT 2007


Let's use component scope in lookupInStatefulContexts
-----------------------------------------------------

                 Key: JBSEAM-2159
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2159
             Project: JBoss Seam
          Issue Type: Feature Request
          Components: Core
    Affects Versions: 2.0.0.CR3
            Reporter: Dmitriy Lapko


One of the key methods of Seam in class Component is: 
Code:

public static Object getInstance(String name, boolean create)
   {
      Object result = Contexts.lookupInStatefulContexts(name);
      result = getInstance(name, create, result);
      return result;
   }
	



Method lookupInStatefulContexts checks all possible scopes for an instance of a requested component. But as for me, usually a scope for a component is defined and I don't understand, why can't we use this information before scanning of all contexts. 

If I marked my component by annotation @Scope, and defined its scope to Session, wouldn't it be faster not to check method, event, page and conversation scopes before getting it from session? Searching in method, event and page contexts is fast, just hashmap searching, but for conversation scope it is much longer and depends on component realization. 

Why do I ask - because in my application there are more session scoped components then conversation scoped. And for them method ServerConversationContext.isPerNestedConversation is called anyway and it takes more then 1% of CPU time in all application, because it iterates among all methods in component trying to find annotation PerNestedConversation (I profiled it with JProfiler). 

So, why can't we use 
Code:
Component component = Component.forName(name);
component.getScope();	



in method Contexts.lookupInStatefulContexts and search only in this scope or untill this scope?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list