Source Code Cross Referenced for StopwatchEngine.java in  » Profiler » stopwatch » com » commsen » stopwatch » 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 » Profiler » stopwatch » com.commsen.stopwatch 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: StopwatchEngine.java,v 1.2 2006/03/06 11:30:53 azzazzel Exp $
003:         *
004:         * Copyright 2006 Commsen International
005:         * 
006:         * Licensed under the Common Public License, Version 1.0 (the "License");
007:         * you may not use this file except in compliance with the License.
008:         * You may obtain a copy of the License at
009:         * 
010:         *      http://www.opensource.org/licenses/cpl1.0.txt
011:         * 
012:         * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
013:         * EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS 
014:         * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
015:         *
016:         */
017:        package com.commsen.stopwatch;
018:
019:        /**
020:         * Interface describes the basic functionality a Stopwatch engine should support.
021:         * All classes implementing this interface are considered Stopwatch engines. 
022:         * Stopwatch can be configured to use given engine by :
023:         * <ul> 
024:         *   <li>setting <code>-Dcom.commsen.stopwatch.engine=&lt;fully_qualified_class_name&gt;</code> JVM parameter</li>
025:         *   <li>creating "stopwatch.properties" file on classpath and seting <code>engine=&lt;fully_qualified_class_name&gt;</code></li>
026:         * </ul>  
027:         *
028:         * @author Milen Dyankov
029:         *
030:         */
031:        public interface StopwatchEngine {
032:
033:            /**
034:             * Method called by Stopwatch when initilializing Stopwatch engine.
035:             */
036:            public void start();
037:
038:            /**
039:             * Called when Stopwatch is disabled or for any other reason it will not use this engine for some time.
040:             * This gives engine a chance to force-close all pending measurments, invalidate caches, 
041:             * close database connections, etc.  
042:             */
043:            public void pause();
044:
045:            /**
046:             * Called when Stopwatch is enabled and before attepting to use paused engine.
047:             * This gives engine a chance to re-initialize caches, open database connections, etc.  
048:             */
049:            public void resume();
050:
051:            /**
052:             * Called when Stopwatch's engine is changed or for any other reason Stopwatch will no longer use this engine.
053:             * This gives engine a chance to free all used resources.  
054:             */
055:            public void stop();
056:
057:            /**
058:             * Method called when mensuration is started. 
059:             * 
060:             * @param group the name of the group this measurment should be placed in  
061:             * @param label how this measurment should be labeled
062:             * @return Unique ID representing current measurment.
063:             */
064:            public long begin(String group, String label);
065:
066:            /**
067:             * Method called when mensuration is stopped. 
068:             * It is possible to call this method multiple times with the same id, however the engine should 
069:             * process only the first call.
070:             * 
071:             * @param id Unique ID representing the actual measurment that need to be stopped.
072:             */
073:            public void end(long id);
074:
075:            /**
076:             * Method called when mensuration with id <code>id</code> is to be skipped. 
077:             * It is possible to call this method multiple times with the same id, however the engine should 
078:             * process only the first call.
079:             * 
080:             * @param id Unique ID representing the actual measurment that need to be stopped.
081:             */
082:            public void skip(long id);
083:
084:            /**
085:             * Method called to instruct engine to use user defined storage  
086:             * @param storage the storage to be used by this engine
087:             */
088:            public void setStorage(StopwatchStorage storage);
089:
090:            /**
091:             * Method called to instruct engine in what mode persistence manager should work in.
092:             * @param persistenceMode the mode persistence manager should work in.
093:             * 
094:             * @see com.commsen.stopwatch.storages.StorageManager#NORMAL_MODE
095:             * @see com.commsen.stopwatch.storages.StorageManager#THREAD_MODE
096:             * @see com.commsen.stopwatch.storages.StorageManager#DELAYED_MODE
097:             * 
098:             */
099:            public void setPersistenceMode(int persistenceMode);
100:
101:            /**
102:             * Method called to obtain the current storage class  
103:             * @return the class name of the current storage
104:             */
105:            public String getStorageClass();
106:
107:            /**
108:             * Allows clients to get reference to the stopwatch's storage. 
109:             * Storage is normaly used by clients to generate reports.
110:             *  
111:             * @return reference to the storage   
112:             *   
113:             */
114:            public StopwatchStorage getStorage();
115:
116:            /**
117:             * Instructs engine to disable/enable debug information.
118:             * The reason for this exist is to be able to minimize the performance impact 
119:             * Stopwatch may have on the measured application. Generating debug info consumes additional 
120:             * CPU units, which may become a problem if Stopwatch is heavily used. 
121:             * 
122:             * Setting this to false (it is false by default) should cause no debug info being generated
123:             *  even when log4j's level is set to DEBUG.
124:             *   
125:             * @param debugEnabled should debug information be generated
126:             */
127:            public void setDebugEnabled(boolean debugEnabled);
128:
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.