Source Code Cross Referenced for ProxyConfig.java in  » J2EE » spring-framework-2.0.6 » org » springframework » aop » framework » 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 » spring framework 2.0.6 » org.springframework.aop.framework 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.springframework.aop.framework;
018:
019:        import java.io.Serializable;
020:
021:        import org.springframework.util.Assert;
022:
023:        /**
024:         * Convenience superclass for configuration used in creating proxies,
025:         * to ensure that all proxy creators have consistent properties.
026:         *
027:         * @author Rod Johnson
028:         * @author Juergen Hoeller
029:         * @see AdvisedSupport
030:         */
031:        public class ProxyConfig implements  Serializable {
032:
033:            /** use serialVersionUID from Spring 1.2 for interoperability */
034:            private static final long serialVersionUID = -8409359707199703185L;
035:
036:            private boolean proxyTargetClass = false;
037:
038:            private boolean optimize = false;
039:
040:            boolean opaque = false;
041:
042:            boolean exposeProxy = false;
043:
044:            private boolean frozen = false;
045:
046:            /**
047:             * Set whether to proxy the target class directly, instead of just proxying
048:             * specific interfaces. Default is "false".
049:             * <p>Set this to "true" to force proxying for the TargetSource's exposed
050:             * target class. If that target class is an interface, a JDK proxy will be
051:             * created for the given interface. If that target class is any other class,
052:             * a CGLIB proxy will be created for the given class.
053:             * <p>Note: Depending on the configuration of the concrete proxy factory,
054:             * the proxy-target-class behavior will also be applied if no interfaces
055:             * have been specified (and no interface autodetection is activated).
056:             * @see org.springframework.aop.TargetSource#getTargetClass()
057:             */
058:            public void setProxyTargetClass(boolean proxyTargetClass) {
059:                this .proxyTargetClass = proxyTargetClass;
060:            }
061:
062:            /**
063:             * Return whether to proxy the target class directly as well as any interfaces.
064:             */
065:            public boolean isProxyTargetClass() {
066:                return this .proxyTargetClass;
067:            }
068:
069:            /**
070:             * Set whether proxies should perform aggressive optimizations.
071:             * The exact meaning of "aggressive optimizations" will differ
072:             * between proxies, but there is usually some tradeoff.
073:             * Default is "false".
074:             * <p>For example, optimization will usually mean that advice changes won't
075:             * take effect after a proxy has been created. For this reason, optimization
076:             * is disabled by default. An optimize value of "true" may be ignored
077:             * if other settings preclude optimization: for example, if "exposeProxy"
078:             * is set to "true" and that's not compatible with the optimization.
079:             */
080:            public void setOptimize(boolean optimize) {
081:                this .optimize = optimize;
082:            }
083:
084:            /**
085:             * Return whether proxies should perform aggressive optimizations.
086:             */
087:            public boolean isOptimize() {
088:                return this .optimize;
089:            }
090:
091:            /**
092:             * Set whether proxies created by this configuration should be prevented
093:             * from being cast to {@link Advised} to query proxy status.
094:             * <p>Default is "false", meaning that any AOP proxy can be cast to
095:             * {@link Advised}.
096:             */
097:            public void setOpaque(boolean opaque) {
098:                this .opaque = opaque;
099:            }
100:
101:            /**
102:             * Return whether proxies created by this configuration should be
103:             * prevented from being cast to {@link Advised}.
104:             */
105:            public boolean isOpaque() {
106:                return this .opaque;
107:            }
108:
109:            /**
110:             * Set whether the proxy should be exposed by the AOP framework as a
111:             * ThreadLocal for retrieval via the AopContext class. This is useful
112:             * if an advised object needs to call another advised method on itself.
113:             * (If it uses <code>this</code>, the invocation will not be advised).
114:             * <p>Default is "false", for optimal performance.
115:             */
116:            public void setExposeProxy(boolean exposeProxy) {
117:                this .exposeProxy = exposeProxy;
118:            }
119:
120:            /**
121:             * Return whether the AOP proxy will expose the AOP proxy for
122:             * each invocation.
123:             */
124:            public boolean isExposeProxy() {
125:                return this .exposeProxy;
126:            }
127:
128:            /**
129:             * Set whether this config should be frozen.
130:             * <p>When a config is frozen, no advice changes can be made. This is
131:             * useful for optimization, and useful when we don't want callers to
132:             * be able to manipulate configuration after casting to Advised.
133:             */
134:            public void setFrozen(boolean frozen) {
135:                this .frozen = frozen;
136:            }
137:
138:            /**
139:             * Return whether the config is frozen, and no advice changes can be made.
140:             */
141:            public boolean isFrozen() {
142:                return this .frozen;
143:            }
144:
145:            /**
146:             * Copy configuration from the other config object.
147:             * @param other object to copy configuration from
148:             */
149:            public void copyFrom(ProxyConfig other) {
150:                Assert.notNull(other,
151:                        "Other ProxyConfig object must not be null");
152:                this .proxyTargetClass = other.proxyTargetClass;
153:                this .optimize = other.optimize;
154:                this .exposeProxy = other.exposeProxy;
155:                this .frozen = other.frozen;
156:                this .opaque = other.opaque;
157:            }
158:
159:            public String toString() {
160:                StringBuffer sb = new StringBuffer();
161:                sb.append("proxyTargetClass=").append(this .proxyTargetClass)
162:                        .append("; ");
163:                sb.append("optimize=").append(this .optimize).append("; ");
164:                sb.append("opaque=").append(this .opaque).append("; ");
165:                sb.append("exposeProxy=").append(this .exposeProxy).append("; ");
166:                sb.append("frozen=").append(this.frozen);
167:                return sb.toString();
168:            }
169:
170:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.