Java Doc for GenericConfigurationImpl.java in  » J2EE » fleXive » com » flexive » core » configuration » 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 » J2EE » fleXive » com.flexive.core.configuration 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.flexive.core.configuration.GenericConfigurationImpl

All known Subclasses:   com.flexive.ejb.beans.configuration.GlobalConfigurationEngineBean,  com.flexive.ejb.beans.configuration.DivisionConfigurationEngineBean,  com.flexive.ejb.beans.configuration.UserConfigurationEngineBean,
GenericConfigurationImpl
abstract public class GenericConfigurationImpl implements GenericConfigurationEngine(Code)
Abstract base class for configuration methods. Implements templated getter/setter methods for configuration classes that may add custom behavior like caching.

An implementor must create SQL statements for reading, updating and deleting parameters, and a method for obtaining a database connection for the configuration table.

The setParameter/getParameter methods may be overridden to implement custom behavior, e.g. caching of parameter values. Some set- and get-methods are declared final because they are wrappers for the (non-final) main set/get method.


author:
   Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Inner Class :protected static class UnsetParameter implements Serializable
Inner Class :protected static class NullParameter implements Serializable



Method Summary
protected  voiddeleteCache(String path, String key)
    
protected  voiddeleteCache(String path)
    
final public  Tget(Parameter<T> parameter)
    
final public  Tget(Parameter<T> parameter, String key)
    
final public  Tget(Parameter<T> parameter, String key, boolean ignoreDefault)
    
final public  Map<String, T>getAll(Parameter<T> parameter)
    
protected  SerializablegetCache(String path, String key)
    
protected  StringgetCachePath(String path)
     Return the cache path for the given configuration parameter path. If this method returns null (like the default implementation), caching is disabled.
abstract protected  ConnectiongetConnection()
     Return a (new or existing) Connection to the configuration table.
abstract protected  PreparedStatementgetDeleteStatement(Connection conn, String path, String key)
     Return a delete statement to delete the given parameter.
Parameters:
  conn - the current connection
Parameters:
  path - path of the row to be deleted
Parameters:
  key - key of the row to be deleted.
abstract protected  PreparedStatementgetInsertStatement(Connection conn, String path, String key, String value)
     Return an insert statement that inserts a new row for the given path, key and value.
final public  Collection<String>getKeys(Parameter<T> parameter)
    
protected  ObjectgetParameter(Parameter<T> parameter, String path, String key)
     Get a configuration parameter identified by a path and a key.
abstract protected  PreparedStatementgetSelectStatement(Connection conn, String path, String key)
     Return a select statement that selects the given path and key and returns the stored value.
abstract protected  PreparedStatementgetSelectStatement(Connection conn, String path)
     Return a select statement that selects all keys and values for the given path.
abstract protected  PreparedStatementgetUpdateStatement(Connection conn, String path, String key, String value)
     Return an update statement that updates the value for the given path/key combination.
protected  TloadParameterFromDb(Parameter<T> parameter)
     Loads the given parameter from the database.
protected  SerializableloadParameterFromDb(String path, String key)
     Loads the given parameter from the database.
protected  voidlogCacheHit(String path, String key)
     Wrapper for simple cache stats.
protected  voidlogCacheMiss(String path, String key)
     Wrapper for simple cache stats.
public  voidput(Parameter<T> parameter, String key, T value)
    
final public  voidput(Parameter<T> parameter, T value)
    
protected  voidputCache(String path, String key, Serializable value)
     Store the given value in the cache.
public  voidremove(Parameter<T> parameter, String key)
    
final public  voidremove(Parameter<T> parameter)
    
final public  voidremoveAll(Parameter<T> parameter)
    



Method Detail
deleteCache
protected void deleteCache(String path, String key)(Code)
Delete the given parameter from the cache
Parameters:
  path - path of the parameter to be removed
Parameters:
  key - key of the parameter to be removed



deleteCache
protected void deleteCache(String path)(Code)
Delete the given path from the cache
Parameters:
  path - the path to be removed



get
final public T get(Parameter<T> parameter) throws FxApplicationException(Code)



get
final public T get(Parameter<T> parameter, String key) throws FxApplicationException(Code)



get
final public T get(Parameter<T> parameter, String key, boolean ignoreDefault) throws FxApplicationException(Code)



getAll
final public Map<String, T> getAll(Parameter<T> parameter) throws FxApplicationException(Code)



getCache
protected Serializable getCache(String path, String key) throws FxCacheException(Code)
Returns the cached value of the given parameter
Parameters:
  path - the parameter path
Parameters:
  key - the parameter key the cached value of the given parameter
throws:
  FxCacheException - if a cache exception occured



getCachePath
protected String getCachePath(String path)(Code)
Return the cache path for the given configuration parameter path. If this method returns null (like the default implementation), caching is disabled. Be aware that you have to add the context to your cache path, e.g. the user ID for user settings.
Parameters:
  path - the parameter path to be mapped the mapped parameter path, or null to disable caching



getConnection
abstract protected Connection getConnection() throws SQLException(Code)
Return a (new or existing) Connection to the configuration table.
throws:
  SQLException - if the connection could not be retrieved a Connection to the configuration table.



getDeleteStatement
abstract protected PreparedStatement getDeleteStatement(Connection conn, String path, String key) throws SQLException, FxNoAccessException(Code)
Return a delete statement to delete the given parameter.
Parameters:
  conn - the current connection
Parameters:
  path - path of the row to be deleted
Parameters:
  key - key of the row to be deleted. If null, all keys under the given path should be deleted. a PreparedStatement for deleting the given path/key
throws:
  SQLException - if a database error occurs
throws:
  FxNoAccessException - if the caller is not permitted to delete the given parameter



getInsertStatement
abstract protected PreparedStatement getInsertStatement(Connection conn, String path, String key, String value) throws SQLException, FxNoAccessException(Code)
Return an insert statement that inserts a new row for the given path, key and value.
Parameters:
  conn - the current connection
Parameters:
  path - path of the new row
Parameters:
  key - key of the new row
Parameters:
  value - value of the new row
throws:
  SQLException - if a database error occurs
throws:
  FxNoAccessException - if the caller is not permitted to create the given parameter a PreparedStatement for inserting the given path/key/value



getKeys
final public Collection<String> getKeys(Parameter<T> parameter) throws FxApplicationException(Code)



getParameter
protected Object getParameter(Parameter<T> parameter, String path, String key) throws FxLoadException, FxNotFoundException(Code)
Get a configuration parameter identified by a path and a key.
Parameters:
  parameter - the actual parameter instance
Parameters:
  path - path of the parameter
Parameters:
  key - key of the parameter the parameter value
throws:
  FxLoadException - if the parameter could not be loaded
throws:
  FxNotFoundException - if the parameter does not exist



getSelectStatement
abstract protected PreparedStatement getSelectStatement(Connection conn, String path, String key) throws SQLException(Code)
Return a select statement that selects the given path and key and returns the stored value.

Required SELECT arguments:

  1. value


Parameters:
  conn - the current connection
Parameters:
  path - the requested path
Parameters:
  key - the requested key
throws:
  SQLException - if a database error occurs a PreparedStatement selecting the value for the given path/key combination



getSelectStatement
abstract protected PreparedStatement getSelectStatement(Connection conn, String path) throws SQLException(Code)
Return a select statement that selects all keys and values for the given path.

Required SELECT arguments:

  1. key
  2. value


Parameters:
  conn - the current connection
Parameters:
  path - the requested path
throws:
  SQLException - if a database error occurs a PreparedStatement selecting all keys and values for the given path



getUpdateStatement
abstract protected PreparedStatement getUpdateStatement(Connection conn, String path, String key, String value) throws SQLException, FxNoAccessException(Code)
Return an update statement that updates the value for the given path/key combination.
Parameters:
  conn - the current connection
Parameters:
  path - path of the parameter
Parameters:
  key - key to be updated
Parameters:
  value - the new value to be stored
throws:
  SQLException - if a database error occurs
throws:
  FxNoAccessException - if the caller is not permitted to update the given parameter a PreparedStatement updating the given row



loadParameterFromDb
protected T loadParameterFromDb(Parameter<T> parameter) throws FxNotFoundException, FxLoadException(Code)
Loads the given parameter from the database. Helper method for implementors.
Parameters:
  parameter - the parameter to be loaded<
Parameters:
  T - > value type of the parameter the parameter value
throws:
  FxNotFoundException - if the parameter does not exist
throws:
  FxLoadException - if the parameter could not be loaded



loadParameterFromDb
protected Serializable loadParameterFromDb(String path, String key) throws FxLoadException, FxNotFoundException(Code)
Loads the given parameter from the database. Helper method for implementors.
Parameters:
  path - path of the parameter
Parameters:
  key - key of the parameter the parameter value
throws:
  FxLoadException - if the parameter could not be loaded
throws:
  FxNotFoundException - if the parameter does not exist



logCacheHit
protected void logCacheHit(String path, String key)(Code)
Wrapper for simple cache stats. May be used as hook for adding cache logging or as an aspectj pointcut.
Parameters:
  path - the parameter path that caused the cache hit
Parameters:
  key - the parameter key that caused the cache hit



logCacheMiss
protected void logCacheMiss(String path, String key)(Code)
Wrapper for simple cache stats. May be used as hook for adding cache logging or as an aspectj pointcut.
Parameters:
  path - the parameter path that caused the cache hit
Parameters:
  key - the parameter key that caused the cache hit



put
public void put(Parameter<T> parameter, String key, T value) throws FxApplicationException(Code)



put
final public void put(Parameter<T> parameter, T value) throws FxApplicationException(Code)



putCache
protected void putCache(String path, String key, Serializable value)(Code)
Store the given value in the cache.
Parameters:
  path - the parameter path
Parameters:
  key - the parameter key
Parameters:
  value - the serializable value to be stored



remove
public void remove(Parameter<T> parameter, String key) throws FxApplicationException(Code)



remove
final public void remove(Parameter<T> parameter) throws FxApplicationException(Code)



removeAll
final public void removeAll(Parameter<T> parameter) throws FxApplicationException(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.