Java Doc for SanityManager.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » shared » common » sanity » 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 » Database DBMS » db derby 10.2 » org.apache.derby.shared.common.sanity 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.shared.common.sanity.SanityManager

All known Subclasses:   org.apache.derby.iapi.services.sanity.SanityManager,
SanityManager
public class SanityManager (Code)
The SanityService provides assertion checking and debug control.

Assertions and debug checks can only be used for testing conditions that might occur in development code but not in production code. They are compiled out of production code.

Uses of assertions should not add AssertFailure catches or throws clauses; AssertFailure is under RuntimeException in the java exception hierarchy. Our outermost system block will bring the system down when it detects an assertion failure.

In addition to ASSERTs in code, classes can choose to implement an isConsistent method that would be used by ASSERTs, UnitTests, and any other code wanting to check the consistency of an object.

Assertions are meant to be used to verify the state of the system and bring the system down if the state is not correct. Debug checks are meant to display internal information about a running system.


See Also:   org.apache.derby.iapi.services.sanity.AssertFailure



Field Summary
final public static  booleanASSERT
     The build tool may be configured to alter this source file to reset the static final variables so that assertion and debug checks can be compiled out of the code.
final public static  booleanDEBUG
    
final public static  StringDEBUGDEBUG
    


Method Summary
final public static  voidASSERT(boolean mustBeTrue)
     ASSERT checks the condition, and if it is false, throws AssertFailure.
final public static  voidASSERT(boolean mustBeTrue, String msgIfFail)
     ASSERT checks the condition, and if it is false, throws AssertFailure.
final public static  voidDEBUG(String flag, String message)
     The DEBUG calls provide the ability to print information or perform actions based on whether a debug flag is set or not. debug flags are set in configurations and picked up by the sanity manager when the monitor finds them (see CONFIG below).

The message is output to the trace stream, so it ends up in db2j.LOG.

final public static  voidDEBUG_ALL_OFF()
     This can be used to have the SanityManager return FALSE for any DEBUG_ON check.
final public static  voidDEBUG_ALL_ON()
     This can be used to have the SanityManager return TRUE for any DEBUG_ON check.
final public static  voidDEBUG_CLEAR(String flag)
     Set the named debug flag to false.
final public static  booleanDEBUG_ON(String flag)
     This can be called directly if you want to control what is done once the debug flag has been verified -- for example, if you are calling a routine that prints to the trace stream directly rather than returning a string to be printed, or if you want to perform more (or fewer!)

Calls to this method should be surrounded with if (SanityManager.DEBUG) { } so that they can be compiled out completely.

public static  voidDEBUG_PRINT(String flag, String message)
     The DEBUG_PRINT calls provides a convenient way to print debug information to the db2j.LOG file, The message includes a header

DEBUG OUTPUT: before the message

If the debugStream stream cannot be found, the message is printed to System.out.

final public static  voidDEBUG_SET(String flag)
     Set the named debug flag to true.
public static  java.io.PrintWriterGET_DEBUG_STREAM()
    
public static  voidNOTREACHED()
    
public static  voidSET_DEBUG_STREAM(java.io.PrintWriter pw)
    
final public static  voidTHROWASSERT(String msgIfFail)
     THROWASSERT throws AssertFailure.
final public static  voidTHROWASSERT(String msg, Throwable t)
     THROWASSERT throws AssertFailure.
final public static  voidTHROWASSERT(Throwable t)
     THROWASSERT throws AssertFailure.
public static  voidshowTrace(Throwable t)
    

Field Detail
ASSERT
final public static boolean ASSERT(Code)
The build tool may be configured to alter this source file to reset the static final variables so that assertion and debug checks can be compiled out of the code.



DEBUG
final public static boolean DEBUG(Code)



DEBUGDEBUG
final public static String DEBUGDEBUG(Code)





Method Detail
ASSERT
final public static void ASSERT(boolean mustBeTrue)(Code)
ASSERT checks the condition, and if it is false, throws AssertFailure. A message about the assertion failing is printed.


See Also:   org.apache.derby.iapi.services.sanity.AssertFailure




ASSERT
final public static void ASSERT(boolean mustBeTrue, String msgIfFail)(Code)
ASSERT checks the condition, and if it is false, throws AssertFailure. The message will be printed and included in the assertion.


See Also:   org.apache.derby.iapi.services.sanity.AssertFailure




DEBUG
final public static void DEBUG(String flag, String message)(Code)
The DEBUG calls provide the ability to print information or perform actions based on whether a debug flag is set or not. debug flags are set in configurations and picked up by the sanity manager when the monitor finds them (see CONFIG below).

The message is output to the trace stream, so it ends up in db2j.LOG. It will include a header line of DEBUG OUTPUT: before the message.

If the debugStream stream cannot be found, the message is printed to System.out.




DEBUG_ALL_OFF
final public static void DEBUG_ALL_OFF()(Code)
This can be used to have the SanityManager return FALSE for any DEBUG_ON check. DEBUG_SET of an individual flag will appear to have no effect.



DEBUG_ALL_ON
final public static void DEBUG_ALL_ON()(Code)
This can be used to have the SanityManager return TRUE for any DEBUG_ON check. DEBUG_CLEAR of an individual flag will appear to have no effect.



DEBUG_CLEAR
final public static void DEBUG_CLEAR(String flag)(Code)
Set the named debug flag to false.

Calls to this method should be surrounded with if (SanityManager.DEBUG) { } so that they can be compiled out completely.
Parameters:
  flag - The name of the debug flag to set to false




DEBUG_ON
final public static boolean DEBUG_ON(String flag)(Code)
This can be called directly if you want to control what is done once the debug flag has been verified -- for example, if you are calling a routine that prints to the trace stream directly rather than returning a string to be printed, or if you want to perform more (or fewer!)

Calls to this method should be surrounded with if (SanityManager.DEBUG) { } so that they can be compiled out completely. true if the flag has been set to "true"; falseif the flag is not set, or is set to something other than "true".




DEBUG_PRINT
public static void DEBUG_PRINT(String flag, String message)(Code)
The DEBUG_PRINT calls provides a convenient way to print debug information to the db2j.LOG file, The message includes a header

DEBUG OUTPUT: before the message

If the debugStream stream cannot be found, the message is printed to System.out.




DEBUG_SET
final public static void DEBUG_SET(String flag)(Code)
Set the named debug flag to true.

Calls to this method should be surrounded with if (SanityManager.DEBUG) { } so that they can be compiled out completely.
Parameters:
  flag - The name of the debug flag to set to true




GET_DEBUG_STREAM
public static java.io.PrintWriter GET_DEBUG_STREAM()(Code)



NOTREACHED
public static void NOTREACHED()(Code)



SET_DEBUG_STREAM
public static void SET_DEBUG_STREAM(java.io.PrintWriter pw)(Code)



THROWASSERT
final public static void THROWASSERT(String msgIfFail)(Code)
THROWASSERT throws AssertFailure. This is used in cases where the caller has already detected the assertion failure (such as in the default case of a switch). This method should be used, rather than throwing AssertFailure directly, to allow us to centralize all sanity checking. The message argument will be printed and included in the assertion.


Parameters:
  msgIfFail - message to print with the assertion
See Also:   org.apache.derby.iapi.services.sanity.AssertFailure




THROWASSERT
final public static void THROWASSERT(String msg, Throwable t)(Code)
THROWASSERT throws AssertFailure. This flavor will print the stack associated with the exception. The message argument will be printed and included in the assertion.


Parameters:
  msg - message to print with the assertion
Parameters:
  t - exception to print with the assertion
See Also:   org.apache.derby.iapi.services.sanity.AssertFailure




THROWASSERT
final public static void THROWASSERT(Throwable t)(Code)
THROWASSERT throws AssertFailure. This flavor will print the stack associated with the exception.


Parameters:
  t - exception to print with the assertion
See Also:   org.apache.derby.iapi.services.sanity.AssertFailure




showTrace
public static void showTrace(Throwable t)(Code)



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.