Java Doc for ContextManager.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » services » context » 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.iapi.services.context 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.iapi.services.context.ContextManager

ContextManager
public class ContextManager (Code)
The ContextManager collects contexts as they are created. It maintains stacks of contexts by named ids, so that the top context of a given type can be returned. It also maintains a global stack so that contexts can be traversed in the order they were created.

The first implementation of the context manager assumes there is only one thread to worry about and that the user(s) of the class only create one instance of ContextManager.



Field Summary
 intactiveCount
     Count of the number of setCurrentContextManager calls by a single thread, for nesting situations with a single active Contextmanager.
 ThreadactiveThread
     The thread that owns this ContextManager, set by ContextService.setCurrentContextManager and reset by resetCurrentContextManager.
final  ContextServiceowningCsf
    

Constructor Summary
 ContextManager(ContextService csf, HeaderPrintWriter stream)
     Constructs a new instance.

Method Summary
public  booleancleanupOnError(Throwable error)
    
public  ContextgetContext(String contextId)
     Obtain the last pushed Context object of the type indicated by the contextId argument.
final public  ListgetContextStack(String contextId)
     Return an unmodifiable list reference to the ArrayList backing CtxStack object for this type of Contexts.
public  LocalegetMessageLocale()
    
final  booleanisEmpty()
     Is the ContextManager empty containing no Contexts.
public  voidpopContext()
     Remove the last pushed Context object, regardless of type.
 voidpopContext(Context theContext)
     Removes the specified Context object.
public  voidpushContext(Context newContext)
     Add a Context object to the ContextManager.
synchronized  booleansetInterrupted(Context c)
    
public  voidsetLocaleFinder(LocaleFinder finder)
     Set the locale for this context.
public  voidsetMessageLocale(String localeID)
    

Field Detail
activeCount
int activeCount(Code)
Count of the number of setCurrentContextManager calls by a single thread, for nesting situations with a single active Contextmanager. If nesting is occuring with multiple different ContextManagers then this value is set to -1 and nesting is represented by entries in a stack in the ThreadLocal variable, threadContextList.
See Also:   ContextService.threadContextList



activeThread
Thread activeThread(Code)
The thread that owns this ContextManager, set by ContextService.setCurrentContextManager and reset by resetCurrentContextManager. Only a single thread can be active in a ContextManager at any time, and the thread only "owns" the ContextManager while it is executing code within Derby. In the JDBC case setCurrentContextManager is called at the start of a JBDC method and resetCurrentContextManager on completion. Nesting within the same thread is supported, such as server-side JDBC calls in a Java routine or procedure. In that case the activeCount will represent the level of nesting, in some situations.

See Also:   ContextService.setCurrentContextManager(ContextManager)
See Also:   ContextService.resetCurrentContextManager(ContextManager)
See Also:   ContextManager.activeCount



owningCsf
final ContextService owningCsf(Code)




Constructor Detail
ContextManager
ContextManager(ContextService csf, HeaderPrintWriter stream)(Code)
Constructs a new instance. No CtxStacks are inserted into the hashMap as they will be allocated on demand.
Parameters:
  csf - the ContextService owning this ContextManager
Parameters:
  stream - error stream for reporting errors




Method Detail
cleanupOnError
public boolean cleanupOnError(Throwable error)(Code)
true if the context manager is shutdown, false otherwise.



getContext
public Context getContext(String contextId)(Code)
Obtain the last pushed Context object of the type indicated by the contextId argument.
Parameters:
  contextId - a String identifying the type of Context The Context object with the corresponding contextId, or null if not found



getContextStack
final public List getContextStack(String contextId)(Code)
Return an unmodifiable list reference to the ArrayList backing CtxStack object for this type of Contexts. This method allows fast traversal of all Contexts on that stack. The first element in the List corresponds to the bottom of the stack. The assumption is that the Stack will not be modified while it is being traversed.
Parameters:
  contextId - the type of Context stack to return. an unmodifiable "view" of the ArrayList backing the stack
See Also:   org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.resetSavepoints
See Also:   org.apache.derby.iapi.sql.conn.StatementContext.resetSavePoint



getMessageLocale
public Locale getMessageLocale()(Code)



isEmpty
final boolean isEmpty()(Code)
Is the ContextManager empty containing no Contexts.



popContext
public void popContext()(Code)
Remove the last pushed Context object, regardless of type. If there are no Context objects, no action is taken.



popContext
void popContext(Context theContext)(Code)
Removes the specified Context object. If the specified Context object does not exist, the call will fail.
Parameters:
  theContext - the Context object to remove.



pushContext
public void pushContext(Context newContext)(Code)
Add a Context object to the ContextManager. The object is added both to the holder list and to a stack for the specific type of Context.
Parameters:
  newContext - the new Context object



setInterrupted
synchronized boolean setInterrupted(Context c)(Code)



setLocaleFinder
public void setLocaleFinder(LocaleFinder finder)(Code)
Set the locale for this context.



setMessageLocale
public void setMessageLocale(String localeID) throws StandardException(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.