You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Rahul Mohan <ra...@tcs.com> on 2010/01/20 11:24:32 UTC

Scope Interceptor

Hi,

I have made changes in the scope plugin ( 
http://code.google.com/p/struts2scopeplugin/ ) to support multiple 
conversations. My implementation is based on this(
http://issues.apache.org/struts/browse/WW-1514)  discussion.  I am yet to 
commit the changes back. Please comment on my approach:

Changes:
1. Added class ConversationManager: 
        - It is a session-level singleton that maintains a map of 
conversations keyed by a conversation-id that is generated.
        - Each conversation is again a map

2. Changed class ScopeInterceptor:
        - creates a conversation when it encounters the @Begin annotation 
by calling ConversationManager.getInstance().createConversation()
        - ends the conversation when it encounters the @End annotation
        - Nested conversations are not supported. If @Begin is encountered 
again in the conversation, it just reuses the existing conversation.
        - Current conversation key is stored in ActionContext

3. Changed class ConversationScopeAdapter:
        - Constructor gets the current conversation key from ActionContext 
and gets the conversation from ConversationManager
        - Performs injection, outjection and remove from the conversation.

I am also concerned about the scope-adaptor implementation. I see a large 
number of objects getting instantiated and disposed by the interceptor(one 
per in/out field). Any suggestions to improve it?

- Rahul
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you