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


java.lang.Object
   org.springframework.aop.interceptor.AbstractTraceInterceptor

All known Subclasses:   org.springframework.aop.interceptor.CustomizableTraceInterceptor,  org.springframework.aop.interceptor.SimpleTraceInterceptor,  org.springframework.aop.interceptor.AbstractMonitoringInterceptor,
AbstractTraceInterceptor
abstract public class AbstractTraceInterceptor implements MethodInterceptor,Serializable(Code)
Base MethodInterceptor implementation for tracing.

By default, log messages are written to the log for the interceptor class, not the class which is being intercepted. Setting the useDynamicLogger bean property to true causes all log messages to be written to the Log for the target class being intercepted.

Subclasses must implement the invokeUnderTrace method, which is invoked by this class ONLY when a particular invocation SHOULD be traced. Subclasses should write to the Log instance provided.
author:
   Rob Harrop
author:
   Juergen Hoeller
since:
   1.2
See Also:   AbstractTraceInterceptor.setUseDynamicLogger
See Also:   AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation,org.apache.commons.logging.Log)



Field Summary
protected transient  LogdefaultLogger
     The default Log instance used to write trace messages.


Method Summary
protected  LoggetLoggerForInvocation(MethodInvocation invocation)
     Return the appropriate Log instance to use for the given MethodInvocation.
public  Objectinvoke(MethodInvocation invocation)
     Determines whether or not logging is enabled for the particular MethodInvocation.
abstract protected  ObjectinvokeUnderTrace(MethodInvocation invocation, Log logger)
     Subclasses must override this method to perform any tracing around the supplied MethodInvocation.
protected  booleanisInterceptorEnabled(MethodInvocation invocation, Log logger)
     Determine whether the interceptor should kick in, that is, whether the invokeUnderTrace method should be called.

Default behavior is to check whether the given Log instance is enabled.

protected  booleanisLogEnabled(Log logger)
     Determine whether the given Log instance is enabled.
public  voidsetHideProxyClassNames(boolean hideProxyClassNames)
     Set to "true" to have AbstractTraceInterceptor.setUseDynamicLogger dynamic loggers hide proxy class names wherever possible.
public  voidsetLoggerName(String loggerName)
     Set the name of the logger to use.
public  voidsetUseDynamicLogger(boolean useDynamicLogger)
     Set whether to use a dynamic logger or a static logger.

Field Detail
defaultLogger
protected transient Log defaultLogger(Code)
The default Log instance used to write trace messages. This instance is mapped to the implementing Class.





Method Detail
getLoggerForInvocation
protected Log getLoggerForInvocation(MethodInvocation invocation)(Code)
Return the appropriate Log instance to use for the given MethodInvocation. If the useDynamicLogger flag is set, the Log instance will be for the target class of the MethodInvocation, otherwise the Log will be the default static logger.
Parameters:
  invocation - the MethodInvocation being traced the Log instance to use
See Also:   AbstractTraceInterceptor.setUseDynamicLogger



invoke
public Object invoke(MethodInvocation invocation) throws Throwable(Code)
Determines whether or not logging is enabled for the particular MethodInvocation. If not, the method invocation proceeds as normal, otherwise the method invocation is passed to the invokeUnderTrace method for handling.
See Also:   AbstractTraceInterceptor.invokeUnderTrace(org.aopalliance.intercept.MethodInvocation,org.apache.commons.logging.Log)



invokeUnderTrace
abstract protected Object invokeUnderTrace(MethodInvocation invocation, Log logger) throws Throwable(Code)
Subclasses must override this method to perform any tracing around the supplied MethodInvocation. Subclasses are responsible for ensuring that the MethodInvocation actually executes by calling MethodInvocation.proceed().

By default, the passed-in Log instance will have log level "trace" enabled. Subclasses do not have to check for this again, unless they overwrite the isInterceptorEnabled method to modify the default behavior.
Parameters:
  logger - the Log to write trace messages to the result of the call to MethodInvocation.proceed()
throws:
  Throwable - if the call to MethodInvocation.proceed()encountered any errors
See Also:   AbstractTraceInterceptor.isInterceptorEnabled
See Also:   AbstractTraceInterceptor.isLogEnabled




isInterceptorEnabled
protected boolean isInterceptorEnabled(MethodInvocation invocation, Log logger)(Code)
Determine whether the interceptor should kick in, that is, whether the invokeUnderTrace method should be called.

Default behavior is to check whether the given Log instance is enabled. Subclasses can override this to apply the interceptor in other cases as well.
Parameters:
  invocation - the MethodInvocation being traced
Parameters:
  logger - the Log instance to check
See Also:   AbstractTraceInterceptor.invokeUnderTrace
See Also:   AbstractTraceInterceptor.isLogEnabled




isLogEnabled
protected boolean isLogEnabled(Log logger)(Code)
Determine whether the given Log instance is enabled.

Default is true when the "trace" level is enabled. Subclasses can override this to change the level under which 'tracing' occurs.
Parameters:
  logger - the Log instance to check




setHideProxyClassNames
public void setHideProxyClassNames(boolean hideProxyClassNames)(Code)
Set to "true" to have AbstractTraceInterceptor.setUseDynamicLogger dynamic loggers hide proxy class names wherever possible. Default is "false".



setLoggerName
public void setLoggerName(String loggerName)(Code)
Set the name of the logger to use. The name will be passed to the underlying logger implementation through Commons Logging, getting interpreted as log category according to the logger's configuration.

This can be specified to not log into the category of a class (whether this interceptor's class or the class getting called) but rather into a specific named category.

NOTE: Specify either this property or "useDynamicLogger", not both.
See Also:   org.apache.commons.logging.LogFactory.getLog(String)
See Also:   org.apache.log4j.Logger.getLogger(String)
See Also:   java.util.logging.Logger.getLogger(String)




setUseDynamicLogger
public void setUseDynamicLogger(boolean useDynamicLogger)(Code)
Set whether to use a dynamic logger or a static logger. Default is a static logger for this trace interceptor.

Used to determine which Log instance should be used to write log messages for a particular method invocation: a dynamic one for the Class getting called, or a static one for the Class of the trace interceptor.

NOTE: Specify either this property or "loggerName", not both.
See Also:   AbstractTraceInterceptor.getLoggerForInvocation(org.aopalliance.intercept.MethodInvocation)




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.