Java Doc for MdcInjectionFilter.java in  » Net » mina-2.0.0-M1 » org » apache » mina » filter » logging » 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 » Net » mina 2.0.0 M1 » org.apache.mina.filter.logging 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.mina.filter.util.CommonEventFilter
   org.apache.mina.filter.logging.MdcInjectionFilter

MdcInjectionFilter
public class MdcInjectionFilter extends CommonEventFilter (Code)
This filter will inject some key IoSession properties into the Mapped Diagnostic Context (MDC)

These properties will be set in the MDC for all logging events that are generated down the call stack, even in code that is not aware of MINA. By default, the following properties will be set for all transports:

  • "handlerClass"
  • "remoteAddress"
  • "localAddress"
When session.getTransportMetadata().getAddressType() == InetSocketAddress.class the following properties will also be set:
  • "remoteIp"
  • "remotePort"
  • "localIp"
  • "localPort"
User code can also add properties to the context, via If you only want the MDC to be set for the IoHandler code, it's enough to add one MdcInjectionFilter at the end of the filter chain. If you want the MDC to be set for ALL code, you should add an MdcInjectionFilter to the start of the chain and add one after EVERY ExecutorFilter in the chain
author:
   The Apache MINA Project (dev@mina.apache.org)
version:
   $Rev: 566952 $, $Date: 2007-08-17 09:25:04 +0200 (vr, 17 aug 2007) $

Inner Class :public enum MdcKey


Constructor Summary
public  MdcInjectionFilter(EnumSet<MdcKey> keys)
     Use this constructor when you want to specify which keys to add to the MDC.
public  MdcInjectionFilter(MdcKey... keys)
    
public  MdcInjectionFilter()
    

Method Summary
protected  voidfillContext(IoSession session, Map<String, String> context)
    
protected  voidfilter(IoFilterEvent event)
    
public static  StringgetProperty(IoSession session, String key)
    
public static  voidremoveProperty(IoSession session, String key)
    
public static  voidsetProperty(IoSession session, String key, String value)
    


Constructor Detail
MdcInjectionFilter
public MdcInjectionFilter(EnumSet<MdcKey> keys)(Code)
Use this constructor when you want to specify which keys to add to the MDC. You could still add custom keys via MdcInjectionFilter.setProperty(IoSession,String,String)
Parameters:
  keys - set of keys that should be added to the MDC
See Also:   MdcInjectionFilter.setProperty(org.apache.mina.common.IoSession,String,String)



MdcInjectionFilter
public MdcInjectionFilter(MdcKey... keys)(Code)
Use this constructor when you want to specify which keys to add to the MDC You could still add custom keys via MdcInjectionFilter.setProperty(IoSession,String,String)
Parameters:
  keys - list of keys that should be added to the MDC
See Also:   MdcInjectionFilter.setProperty(org.apache.mina.common.IoSession,String,String)



MdcInjectionFilter
public MdcInjectionFilter()(Code)




Method Detail
fillContext
protected void fillContext(IoSession session, Map<String, String> context)(Code)
write key properties of the session to the Mapped Diagnostic Context sub-classes could override this method to map more/other attributes
Parameters:
  session - the session to map
Parameters:
  context - key properties will be added to this map



filter
protected void filter(IoFilterEvent event) throws Exception(Code)



getProperty
public static String getProperty(IoSession session, String key)(Code)



removeProperty
public static void removeProperty(IoSession session, String key)(Code)



setProperty
public static void setProperty(IoSession session, String key, String value)(Code)
Add a property to the context for the given session This property will be added to the MDC for all subsequent events
Parameters:
  session - The session for which you want to set a property
Parameters:
  key - The name of the property (should not be null)
Parameters:
  value - The value of the property



Methods inherited from org.apache.mina.filter.util.CommonEventFilter
final public void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) throws Exception(Code)(Java Doc)
abstract protected void filter(IoFilterEvent event) throws Exception(Code)(Java Doc)
final public void filterClose(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc)
final public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception(Code)(Java Doc)
final public void messageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception(Code)(Java Doc)
final public void messageSent(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception(Code)(Java Doc)
final public void sessionClosed(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc)
final public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception(Code)(Java Doc)
final public void sessionIdle(NextFilter nextFilter, IoSession session, IdleStatus status) throws Exception(Code)(Java Doc)
final public void sessionOpened(NextFilter nextFilter, IoSession session) throws Exception(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.