Java Doc for TestJNDIContext.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » 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 » Wiki Engine » JSPWiki » com.ecyrd.jspwiki 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ecyrd.jspwiki.TestJNDIContext

TestJNDIContext
public class TestJNDIContext implements Context(Code)

Mock JNDI context that permits String names to be bound to objects. It is intended to simulate JNDI factories in web containers and application servers, and provides only the bare minimum functions. This class contains a static member InitialContextFactory class called Factory that installs a "root" instance of TestJNDIContext as the initial context for the entire JVM. Additional contexts can be bound by supplying pairs of Strings and Objects using TestJNDIContext.bind(String,Object) . Objects are looked up and retrieved using TestJNDIContext.lookup(String) . All other methods in this class no-op.

For example, simulating a JNDI DataSource requires us to first establish an initial context of java:comp/env. Inside the initial context, we bind our data source:

Context initCtx = new InitialContext();
initCtx.bind( "java:comp/env", new TestJNDIContext() );
Context ctx = (Context)initCtx.lookup("java:comp/env");
DataSource ds = new TestJDBCDataSource();
ctx.bind( "jdbc/UserDatabase", ds);

author:
   Andrew R. Jaquith
since:
   2.3

Inner Class :public static class Factory implements InitialContextFactory


Constructor Summary
public  TestJNDIContext()
     Constructs a new mock JNDI context.

Method Summary
public  ObjectaddToEnvironment(String propName, Object propVal)
     No-op; always returns null.
public  voidbind(Name name, Object obj)
     No-op.
public  voidbind(String name, Object obj)
     Binds an object to a supplied String key.
public  voidclose()
     No-op.
public  NamecomposeName(Name name, Name prefix)
     No-op; always returns null.
public  StringcomposeName(String name, String prefix)
     No-op; always returns null.
public  ContextcreateSubcontext(Name name)
     No-op; always returns null.
public  ContextcreateSubcontext(String name)
     No-op; always returns null.
public  voiddestroySubcontext(Name name)
     No-op.
public  voiddestroySubcontext(String name)
     No-op.
public  HashtablegetEnvironment()
     No-op; always returns null.
public  StringgetNameInNamespace()
     No-op; always returns null.
public  NameParsergetNameParser(Name name)
     No-op; always returns null.
public  NameParsergetNameParser(String name)
     No-op; always returns null.
public static  voidinitialize()
     Static factory method that creates a new TestJNDIContext and configures the JVM so that the new InitialContext() always returns this context.
public  NamingEnumerationlist(Name name)
     No-op; always returns null.
public  NamingEnumerationlist(String name)
     No-op; always returns null.
public  NamingEnumerationlistBindings(Name name)
     No-op; always returns null.
public  NamingEnumerationlistBindings(String name)
     No-op; always returns null.
public  Objectlookup(Name name)
     No-op; always returns null.
public  Objectlookup(String name)
     Retrieves an object using a String key.
public  ObjectlookupLink(Name name)
     No-op; always returns null.
public  ObjectlookupLink(String name)
     No-op; always returns null.
public  voidrebind(Name name, Object obj)
     No-op.
public  voidrebind(String name, Object obj)
     No-op.
public  ObjectremoveFromEnvironment(String propName)
     No-op; always returns null.
public  voidrename(Name oldName, Name newName)
     No-op.
public  voidrename(String oldName, String newName)
     No-op.
public  voidunbind(Name name)
     No-op.
public  voidunbind(String name)
     No-op.


Constructor Detail
TestJNDIContext
public TestJNDIContext()(Code)
Constructs a new mock JNDI context. Note that the instance has no relationship to the JVM's initial context per se. To configure the JVM so that it always returns a TestJNDIContext instance, see TestJNDIContext.initialize() .




Method Detail
addToEnvironment
public Object addToEnvironment(String propName, Object propVal) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.addToEnvironment(java.lang.Stringjava.lang.Object)



bind
public void bind(Name name, Object obj) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.bind(javax.naming.Namejava.lang.Object)



bind
public void bind(String name, Object obj) throws NamingException(Code)
Binds an object to a supplied String key.
See Also:   javax.naming.InitialContext.bind(java.lang.Stringjava.lang.Object)



close
public void close() throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.close



composeName
public Name composeName(Name name, Name prefix) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.composeName(javax.naming.Namejavax.naming.Name)



composeName
public String composeName(String name, String prefix) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.composeName(java.lang.Stringjava.lang.String)



createSubcontext
public Context createSubcontext(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.createSubcontext(javax.naming.Name)



createSubcontext
public Context createSubcontext(String name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.createSubcontext(java.lang.String)



destroySubcontext
public void destroySubcontext(Name name) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.destroySubcontext(javax.naming.Name)



destroySubcontext
public void destroySubcontext(String name) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.destroySubcontext(java.lang.String)



getEnvironment
public Hashtable getEnvironment() throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.getEnvironment



getNameInNamespace
public String getNameInNamespace() throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.getNameInNamespace



getNameParser
public NameParser getNameParser(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.getNameParser(javax.naming.Name)



getNameParser
public NameParser getNameParser(String name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.getNameParser(java.lang.String)



initialize
public static void initialize()(Code)
Static factory method that creates a new TestJNDIContext and configures the JVM so that the new InitialContext() always returns this context.



list
public NamingEnumeration list(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.list(javax.naming.Name)



list
public NamingEnumeration list(String name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.list(java.lang.String)



listBindings
public NamingEnumeration listBindings(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.listBindings(javax.naming.Name)



listBindings
public NamingEnumeration listBindings(String name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.listBindings(java.lang.String)



lookup
public Object lookup(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.lookup(javax.naming.Name)



lookup
public Object lookup(String name) throws NamingException(Code)
Retrieves an object using a String key. If not found, throws a NamingException.
See Also:   javax.naming.InitialContext.lookup(java.lang.String)



lookupLink
public Object lookupLink(Name name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.lookupLink(javax.naming.Name)



lookupLink
public Object lookupLink(String name) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.lookupLink(java.lang.String)



rebind
public void rebind(Name name, Object obj) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.rebind(javax.naming.Namejava.lang.Object)



rebind
public void rebind(String name, Object obj) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.rebind(java.lang.Stringjava.lang.Object)



removeFromEnvironment
public Object removeFromEnvironment(String propName) throws NamingException(Code)
No-op; always returns null.
See Also:   javax.naming.Context.removeFromEnvironment(java.lang.String)



rename
public void rename(Name oldName, Name newName) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.rename(javax.naming.Namejavax.naming.Name)



rename
public void rename(String oldName, String newName) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.rename(java.lang.Stringjava.lang.String)



unbind
public void unbind(Name name) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.unbind(javax.naming.Name)



unbind
public void unbind(String name) throws NamingException(Code)
No-op.
See Also:   javax.naming.Context.unbind(java.lang.String)



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.