Java Doc for MonitorFactory.java in  » UML » MetaBoss » com » jamonapi » 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 » UML » MetaBoss » com.jamonapi 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jamonapi.MonitorFactory

MonitorFactory
public class MonitorFactory extends java.lang.Object (Code)
MonitorFactory - Class that controls monitors including creating, starting, enabling, disabling and resetting them. This class uses the Gang of 4's creational patterns. Monitors returned by MonitorFactory are thread safe.
author:
   Steve Souza
version:
   1.01

Inner Class :abstract static class MonitorFactoryBase implements MonitorFactoryInterface
Inner Class :static class MonitorFactoryEnabled extends MonitorFactoryBase
Inner Class :static class MonitorFactoryDisabled extends MonitorFactoryBase



Method Summary
public static  MonitorCompositegetComposite(String locator)
     Returns the composite monitor specified in the argument.
public static  MonitorFactoryInterfacegetDebugFactory()
     Returns the factory for creating debug monitors.
public static  MonitorFactoryInterfacegetDebugFactory(int _debugPriorityLevel)
     Returns the factory for creating debug monitors.
protected static  MonitorFactoryInterfacegetFactory()
    
protected static  MonitorFactoryInterfacegetFactory(boolean _enabled)
    
public static  StringgetReport()
     Returns all gathered statistics as an HTML table as a String.
public static  StringgetReport(String locator)
     Returns gathered statistics underneath lower in the heirarchy than the locator string.
public static  MonitorCompositegetRootMonitor()
    
protected static  booleanisDebugEnabled()
    
protected static  booleanisDebugEnabled(int _debugPriorityLevel)
    
public static  booleanisEnabled()
     Returns the state of the enabled flag.
public static  voidmain(String[] args)
     Test code for the MonitorFactory class.
public static  voidreset()
     Wipes out all statistics that have been gathered.
public static  voidsetDebugEnabled(boolean _debugEnabled)
     Enable or disable the debug factory.
public static  voidsetDebugPriorityLevel(int _debugPriorityLevel)
     Enable or disable the priority driven debug factory.
public static  voidsetEnabled(boolean _enabled)
     Enable or disable the factory.
public static  voidsetJAMonAdminPage(String JAMonAdminPage)
     Call this method if you don't want to use the default name or location for JAMonAdmin.jsp that is returned in the JAMon report.
protected static  voidsetNodeTree(NodeTree monitorTree)
    
public static  Monitorstart(String locator)
    
public static  Monitorstart()
     Return a Monitor and begin gathering timing statistics for it.
public static  MonitorstartPrimary(String locator)
     Return a Monitor and begin gathering timing statistics for it.



Method Detail
getComposite
public static MonitorComposite getComposite(String locator)(Code)
Returns the composite monitor specified in the argument. Composite Monitor's are groups of other monitors (including other composites).

Sample Call: String html=MonitorFactory.getComposite("pages").getReport();


Parameters:
  locator - A string that locates the Composite Monitor. MonitorComposite



getDebugFactory
public static MonitorFactoryInterface getDebugFactory()(Code)
Returns the factory for creating debug monitors. The debug factory can be disabled independently from the regular factory. Debug monitors are no different than monitors returned by the regular monitor factory. However the debug factory can be used to monitor items in a test environment and disable them in production.

Sample Call: MonitorFactory.getDebugFactory().start();

MonitorFactoryInterface



getDebugFactory
public static MonitorFactoryInterface getDebugFactory(int _debugPriorityLevel)(Code)
Returns the factory for creating debug monitors. The debug factory can be disabled independently from the regular factory. Debug monitors are no different than monitors returned by the regular monitor factory. However the debug factory can be used to monitor items in a test environment and disable them in production.
This method takes a priority level threshold as an argument. If the passed priority level is greater than or equal to the MonitorFactory debug priority level then a Monitor is returned or else a null Monitor is returned (no statistics will be kept).

Sample Call: MonitorFactory.getDebugFactory(20).start();
if MonitorFactory debug priority level is 10 then a non null Monitor will be returned

MonitorFactoryInterface



getFactory
protected static MonitorFactoryInterface getFactory()(Code)



getFactory
protected static MonitorFactoryInterface getFactory(boolean _enabled)(Code)



getReport
public static String getReport() throws Exception(Code)
Returns all gathered statistics as an HTML table as a String. This can be displayed in a JSP or Servlet.

Sample Call: String html=MonitorFactory.getReport();




getReport
public static String getReport(String locator) throws Exception(Code)
Returns gathered statistics underneath lower in the heirarchy than the locator string. The returned String is as an HTML table as a String. This can be displayed in a JSP or Servlet.

Sample Call: String html=MonitorFactory.getReport("MyApplication.DataAccess");
This would return statistics for MyApplication.DataAccess.open(), MyApplication.DataAccess.close(),...




getRootMonitor
public static MonitorComposite getRootMonitor()(Code)
Returns the topmost Composite Monitor *



isDebugEnabled
protected static boolean isDebugEnabled()(Code)



isDebugEnabled
protected static boolean isDebugEnabled(int _debugPriorityLevel)(Code)



isEnabled
public static boolean isEnabled()(Code)
Returns the state of the enabled flag.

Sample Call:
if (MonitorFactory.isEnabled())
........// Do something which only makes sence when monitoring is enabled
else
........// Do something which only makes sence when monitoring is disabled




main
public static void main(String[] args) throws Exception(Code)
Test code for the MonitorFactory class.



reset
public static void reset()(Code)
Wipes out all statistics that have been gathered. Subsequent calls to the start(...) methods will continue to gather statistics.

Sample Call: MonitorFactory.reset();




setDebugEnabled
public static void setDebugEnabled(boolean _debugEnabled)(Code)
Enable or disable the debug factory. The debug factory can be enabled/disabled at runtime. Calling this method with a false also disables calls to MonitorFactory.getDebugFactory(int debugPriorityLevel)

Sample Call:
MonitorFactory.setDebugEnabled(false);
MonitorFactory.getDebugFactory().start(); // no stats are gathered.
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.




setDebugPriorityLevel
public static void setDebugPriorityLevel(int _debugPriorityLevel)(Code)
Enable or disable the priority driven debug factory. The debug factory can be enabled/disabled at runtime. Calling this method with a false has no effect on MonitorFactory.getDebugFactory()

Sample Call:
MonitorFactory.setDebugEnabled(false);
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.




setEnabled
public static void setEnabled(boolean _enabled)(Code)
Enable or disable the factory. The factory can be enabled/disabled at runtime. Calling this method with a false also disables calls to both MonitorFactory.getDebugFactory(), and MonitorFactory.getDebugFactory(int debugPriorityLevel)

Sample Call:
MonitorFactory.setEnabled(false);
MonitorFactory.start(); // no stats are gathered.
MonitorFactory.start("MyApp.DataAccess.open()"); // no stats are gathered.
MonitorFactory.getDebugFactory().start(); // no stats are gathered.
MonitorFactory.getDebugFactory(20).start(); // no stats are gathered.




setJAMonAdminPage
public static void setJAMonAdminPage(String JAMonAdminPage)(Code)
Call this method if you don't want to use the default name or location for JAMonAdmin.jsp that is returned in the JAMon report.



setNodeTree
protected static void setNodeTree(NodeTree monitorTree)(Code)



start
public static Monitor start(String locator)(Code)
Return a Monitor and begin gathering timing statistics for it.

Sample Call:
Monitor mon=MonitorFactory.start("MyApp.DataAccess.open()");
...code being monitored...
System.out.println(mon.stop());




start
public static Monitor start()(Code)
Return a Monitor and begin gathering timing statistics for it. Statistics for this start() method will not be returned by MonitorFactory.getReport()

Sample Call:
Monitor mon=MonitorFactory.start();
...code being monitored...
System.out.println(mon.stop());




startPrimary
public static Monitor startPrimary(String locator)(Code)
Return a Monitor and begin gathering timing statistics for it. See the online JAMon users manual for an explanation of this method.

Sample Call:
Monitor mon=MonitorFactory.startPrimary("MyApp.jsp.HomePage");
...code being monitored...
System.out.println(mon.stop());




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.