public class Pageflow implements Serializable {
  | ...
  |    public static Pageflow instance()
  |    {
  | ...
  |       return (Pageflow) Component.getInstance(Pageflow.class, 
ScopeType.CONVERSATION, true);
  |    }
  | ...
  | 
public class Component {
  | ...
  |    public static Object getInstance(String name, ScopeType scope, boolean 
create)
  |    {
  |       Object result = scope.getContext().get(name);
  |       result = getInstance(name, create, result);
  |       return result;
  |    }
  | ...
  | 

public class ServerConversationContext implements Context {
  | ...
  |    public Object get(String name) {
  | ...
  |       LinkedList<String> stack = getIdStack();
  | ...
  |          for ( String id: stack )
  |          {
  |             result = session.getAttribute( getKey(name, id) );
  |             if (result!=null) return result;
  |          }
  |          return null;
  | ...
  |     }
  | 

Using this pattern we can have only one such Component (in this case Pageflow) 
per Conversation stack. When we ask for a new instance we will get an old one 
from some parent Conversation.

This is the main thing that prevents using nested Pageflows.

May be it is reasonable to add another option in Component.getInstance() to 
lookup only in one current Conversation.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975694#3975694

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975694
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to