Java Doc for VelosurfTool.java in  » Database-ORM » Velosurf » velosurf » web » 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 ORM » Velosurf » velosurf.web 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


velosurf.context.DBReference
   velosurf.web.VelosurfTool

VelosurfTool
public class VelosurfTool extends DBReference (Code)

This class is a tool meant to be referenced in toolbox.xml

It can be used in any scope you want (application/session/request), depending on the behaviour you need for the refinement and ordering mechanisms (which will follow the same scope). The initialization itself is very fast once all static initialization has been done, so there is no performance bottleneck when using request scope.

Since version 1.0rc1, you can have several instances of VelosurfTool, each with a distinct configuration file. This can be useful to have one instance per schema, or one instance per database if dealing with several databases.

For this to work, you have to use the 1.3 version of velocity-tools (not yet released at the time I'm writing this, so you need to grab it from the Velocity subversion repository) and give each instance the pathname of its configuration file via the 'config' parameter in the toolbox.xml file, like this :

 <!-- first instance -->
 <tool>
 <key>db1</key>
 <scope>request</scope>
 <class>velosurf.tools.VelosurfTool</scope>
 <parameter name="config" value="WEB-INF/db1.xml" />
 </tool>
 <!-- second instance -->
 <tool>
 <key>db2</key>
 <scope>request</scope>
 <class>velosurf.tools.VelosurfTool</scope>
 <parameter name="config" value="WEB-INF/db2.xml" />
 </tool>
 

author:
   Claude Brisson



Constructor Summary
public  VelosurfTool()
     build a new VelosurfTool.

Method Summary
public  voidconfigure(Map<String, String> map)
     configure.
static  StringfindConfigFile(ServletContext ctx)
     Tries to find the configuration file.
protected static  DatabasegetConnection(String configFile)
     return the existing Database for the specified config file, or null if it isn't already open.
protected static  DatabasegetConnection(String configFile, ServletContext servletContext)
     return the existing Database for the specified config file and servlet context, or null if an error occurs.
protected static  DatabasegetDefaultConnection()
     return the existing Database for the default config file, or null if it does not already exist.
protected static  DatabasegetDefaultConnection(ServletContext servletContext)
     return the existing Database for the default config file and servlet context, or null if an error occurs.
public static  DBReferencegetDefaultInstance()
     return a db reference the existing Database for the default config file, or null if it does not already exist.
public static  DBReferencegetDefaultInstance(ServletContext servletContext)
     return a db reference on the existing Database for the default config file or null if an error occurs.
public static  DBReferencegetInstance(String configFile)
     return a db reference on the existing Database for the specified config file, or null if it isn't already open.
public static  DBReferencegetInstance(String configFile, ServletContext servletContext)
     return a db reference on the existing Database for the specified config file and servlet context, or null if an error occurs.
public  voidinit(Object viewContext)
     Initialize this instance using the given ViewContext.
protected  voidinitialize(ServletContext ctx)
    


Constructor Detail
VelosurfTool
public VelosurfTool()(Code)
build a new VelosurfTool.




Method Detail
configure
public void configure(Map<String, String> map)(Code)
configure.
Parameters:
  map - parameters



findConfigFile
static String findConfigFile(ServletContext ctx)(Code)
Tries to find the configuration file.
Parameters:
  ctx - servelt context found config file or null



getConnection
protected static Database getConnection(String configFile)(Code)
return the existing Database for the specified config file, or null if it isn't already open.
Parameters:
  configFile - a Database



getConnection
protected static Database getConnection(String configFile, ServletContext servletContext)(Code)
return the existing Database for the specified config file and servlet context, or null if an error occurs.
Parameters:
  configFile - a Database



getDefaultConnection
protected static Database getDefaultConnection()(Code)
return the existing Database for the default config file, or null if it does not already exist. a Database



getDefaultConnection
protected static Database getDefaultConnection(ServletContext servletContext)(Code)
return the existing Database for the default config file and servlet context, or null if an error occurs. a Database



getDefaultInstance
public static DBReference getDefaultInstance()(Code)
return a db reference the existing Database for the default config file, or null if it does not already exist. a DBReference



getDefaultInstance
public static DBReference getDefaultInstance(ServletContext servletContext)(Code)
return a db reference on the existing Database for the default config file or null if an error occurs. a Database



getInstance
public static DBReference getInstance(String configFile)(Code)
return a db reference on the existing Database for the specified config file, or null if it isn't already open.
Parameters:
  configFile - a DBReference



getInstance
public static DBReference getInstance(String configFile, ServletContext servletContext)(Code)
return a db reference on the existing Database for the specified config file and servlet context, or null if an error occurs.
Parameters:
  configFile - a DBReference



init
public void init(Object viewContext) throws Exception(Code)
Initialize this instance using the given ViewContext.
Parameters:
  viewContext - initialization data



initialize
protected void initialize(ServletContext ctx)(Code)
initialization from a servlet context



Methods inherited from velosurf.context.DBReference
public String deobfuscate(Object value)(Code)(Java Doc)
public Object get(Object key)(Code)(Java Doc)
public String getSchema()(Code)(Java Doc)
public UserContext getUserContext()(Code)(Java Doc)
protected void init(Database db)(Code)(Java Doc)
public String obfuscate(Object value)(Code)(Java Doc)
public Object put(String key, Object value)(Code)(Java Doc)
public void setUserContext(UserContext userContext)(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.