Source Code Cross Referenced for MethodFilterInterceptor.java in  » J2EE » webwork-2.2.6 » com » opensymphony » xwork » interceptor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » webwork 2.2.6 » com.opensymphony.xwork.interceptor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2006 by OpenSymphony
003:         * All rights reserved.
004:         */
005:
006:        package com.opensymphony.xwork.interceptor;
007:
008:        import java.util.Collections;
009:        import java.util.Set;
010:
011:        import org.apache.commons.logging.Log;
012:        import org.apache.commons.logging.LogFactory;
013:
014:        import com.opensymphony.xwork.ActionInvocation;
015:        import com.opensymphony.xwork.util.TextParseUtil;
016:
017:        /**
018:         * <!-- START SNIPPET: javadoc -->
019:         * 
020:         * An abstract <code>Interceptor</code> that is applied to selectively according
021:         * to specified included/excluded method lists.
022:         * 
023:         * <p/>
024:         * 
025:         * Setable parameters are as follows:
026:         * 
027:         * <ul>
028:         * 		<li>excludeMethods - methods name to be excluded</li>
029:         * 		<li>includeMethods - methods name to be included</li>
030:         * </ul>
031:         * 
032:         * <p/>
033:         * 
034:         * <b>NOTE:</b> If method name are available in both includeMethods and 
035:         * excludeMethods, it will still be considered as an included method. In short
036:         * includeMethods takes precedence over excludeMethods.
037:         * 
038:         * <p/>
039:         * 
040:         * Interceptors that extends this capability would be :-
041:         * 
042:         * <ul>
043:         *    <li>TokenInterceptor</li>
044:         *    <li>TokenSessionStoreInterceptor</li>
045:         *    <li>DefaultWorkflowInterceptor</li>
046:         *    <li>ValidationInterceptor</li>
047:         * </ul>
048:         * 
049:         * <!-- END SNIPPET: javadoc -->
050:         * 
051:         * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
052:         * @author Rainer Hermanns
053:         * 
054:         * @see com.opensymphony.webwork.interceptor.TokenInterceptor
055:         * @see com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor
056:         * @see com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor
057:         * @see com.opensymphony.xwork.validator.ValidationInterceptor
058:         * 
059:         * @version $Date: 2006-05-15 09:42:45 +0200 (Mo, 15 Mai 2006) $ $Id: MethodFilterInterceptor.java 1017 2006-05-15 07:42:45Z tmjee $
060:         */
061:        public abstract class MethodFilterInterceptor implements  Interceptor {
062:            protected transient Log log = LogFactory.getLog(getClass());
063:
064:            protected Set excludeMethods = Collections.EMPTY_SET;
065:            protected Set includeMethods = Collections.EMPTY_SET;
066:
067:            public void setExcludeMethods(String excludeMethods) {
068:                this .excludeMethods = TextParseUtil
069:                        .commaDelimitedStringToSet(excludeMethods);
070:            }
071:
072:            public Set getExcludeMethodsSet() {
073:                return excludeMethods;
074:            }
075:
076:            public void setIncludeMethods(String includeMethods) {
077:                this .includeMethods = TextParseUtil
078:                        .commaDelimitedStringToSet(includeMethods);
079:            }
080:
081:            public Set getIncludeMethodsSet() {
082:                return includeMethods;
083:            }
084:
085:            public String intercept(ActionInvocation invocation)
086:                    throws Exception {
087:                if (applyInterceptor(invocation)) {
088:                    return doIntercept(invocation);
089:                }
090:                return invocation.invoke();
091:            }
092:
093:            protected boolean applyInterceptor(ActionInvocation invocation) {
094:                String method = invocation.getProxy().getMethod();
095:                // ValidationInterceptor
096:                boolean applyMethod = MethodFilterInterceptorUtil.applyMethod(
097:                        excludeMethods, includeMethods, method);
098:                if (log.isDebugEnabled()) {
099:                    if (!applyMethod) {
100:                        log.debug("Skipping Interceptor... Method [" + method
101:                                + "] found in exclude list.");
102:                    }
103:                }
104:                return applyMethod;
105:            }
106:
107:            /**
108:             * Subclasses must override to implement the interceptor logic.
109:             * 
110:             * @param invocation the action invocation
111:             * @return the result of invocation
112:             * @throws Exception
113:             */
114:            protected abstract String doIntercept(ActionInvocation invocation)
115:                    throws Exception;
116:
117:            public void destroy() {
118:            }
119:
120:            public void init() {
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.