Java Doc for NodeManager.java in  » Web-Framework » helma » helma » objectmodel » db » 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 » Web Framework » helma » helma.objectmodel.db 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   helma.objectmodel.db.NodeManager

NodeManager
final public class NodeManager (Code)
The NodeManager is responsible for fetching Nodes from the internal or external data sources, caching them in a least-recently-used Hashtable, and writing changes back to the databases.


Field Summary
protected  Applicationapp
    
protected  IDatabasedb
    
protected  IDGeneratoridgen
    
protected  booleanlogReplication
    
final public  WrappedNodeManagersafe
    

Constructor Summary
public  NodeManager(Application app)
     Create a new NodeManager for Application app.

Method Summary
public  voidaddNodeChangeListener(NodeChangeListener listener)
     Add a listener that is notified each time a transaction commits that adds, modifies or deletes any Nodes.
public  voidclearCache()
     Clear the object cache, causing all objects to be recreated.
public  intcountCacheEntries()
    
public  intcountNodes(Node home, Relation rel)
     Count the nodes contained in the child collection of the home node which is defined by Relation rel.
public  NodecreateNode(DbMapping dbm, ResultSet rs, DbColumn[] columns, int offset)
     Create a new Node from a ResultSet.
public  voiddeleteNode(Node node)
     Delete a node from the database.
public  voiddeleteNode(IDatabase db, ITransaction txn, Node node)
     Performs the actual deletion of a node from either the embedded or an external SQL database.
public  StringdoGenerateID(DbMapping map)
     Actually generates an ID, using a method matching the given DbMapping.
public  voidevictKey(Key key)
     Used when a key stops being valid for a node.
public  voidevictNode(Node node)
     Remove a node from the node cache.
public  voidevictNodeByKey(Key key)
     Remove a node from the node cache.
public  voidexportNode(Node node, DbSource dbs)
     Insert a node into a different (relational) database than its default one.
public  voidexportNode(Node node, DbMapping dbm)
     Insert a node into a different (relational) database than its default one.
protected  voidfireNodeChangeEvent(List inserted, List updated, List deleted, List parents)
     Called by transactors after committing.
synchronized  StringgenerateEmbeddedID(DbMapping map)
     Gererates an ID for use with the embedded database.
public  StringgenerateID(DbMapping map)
     Generate a new ID for a given type, delegating to our IDGenerator if set.
synchronized  StringgenerateMaxID(DbMapping map)
    
 StringgenerateSequenceID(DbMapping map)
    
public  Object[]getCacheEntries()
    
public  DbMappinggetDbMapping(String protoname)
     Get a DbMapping for a given prototype name.
public  NodegetNode(Key key)
     Get a node by key.
public  NodegetNode(Node home, String kstr, Relation rel)
     Get a node by relation, using the home node, the relation and a key to apply.
public  SubnodeListgetNodeIDs(Node home, Relation rel)
     Loades subnodes via subnode relation.
public  SubnodeListgetNodes(Node home, Relation rel)
     Loades subnodes via subnode relation.
public  VectorgetPropertyNames(Node home, Relation rel)
    
public  NodegetRootNode()
     Gets the application's root node.
protected  booleanhasNodeChangeListeners()
    
public  voidinit(File dbHome, Properties props)
     Initialize the NodeManager for the given dbHome and application properties.
public  voidinsertNode(IDatabase db, ITransaction txn, Node node)
     Insert a new node in the embedded database or a relational database table, depending on its db mapping.
protected  voidinsertRelationalNode(Node node, DbMapping dbm, Connection con)
     Insert a node into a relational database.
public  booleanisRootNode(Node node)
     Checks if the given node is the application's root node.
public  voidprefetchNodes(Node home, Relation rel, Key[] keys)
    
public  voidregisterNode(Node node)
     Register a node in the node cache.
protected  voidregisterNode(Node node, Key key)
     Register a node in the node cache using the key argument.
public  voidremoveNodeChangeListener(NodeChangeListener listener)
     Remove a previously added NodeChangeListener.
public  voidreplicateCache(Vector add, Vector delete)
     Receive notification from a remote app that objects in its cache have been modified.
public  voidshutdown()
     Shut down this node manager.
public  booleanupdateNode(IDatabase db, ITransaction txn, Node node)
     Updates a modified node in the embedded db or an external relational database, depending on its database mapping.
public  voidupdateProperties(Properties props)
     app.properties file has been updated.
public  intupdateSubnodeList(Node home, Relation rel)
     Update a UpdateableSubnodeList retrieving all values having higher Values according to the updateCriteria's set for this Collection's Relation The returned Map-Object has two Properties: addedNodes = an Integer representing the number of Nodes added to this collection newNodes = an Integer representing the number of Records returned by the Select-Statement These two values may be different if a max-size is defined for this Collection and a new node would be outside of this Border because of the ordering of this collection.

Field Detail
app
protected Application app(Code)



db
protected IDatabase db(Code)



idgen
protected IDGenerator idgen(Code)



logReplication
protected boolean logReplication(Code)



safe
final public WrappedNodeManager safe(Code)




Constructor Detail
NodeManager
public NodeManager(Application app)(Code)
Create a new NodeManager for Application app.




Method Detail
addNodeChangeListener
public void addNodeChangeListener(NodeChangeListener listener)(Code)
Add a listener that is notified each time a transaction commits that adds, modifies or deletes any Nodes.



clearCache
public void clearCache()(Code)
Clear the object cache, causing all objects to be recreated.



countCacheEntries
public int countCacheEntries()(Code)
Get the number of elements in the object cache



countNodes
public int countNodes(Node home, Relation rel) throws Exception(Code)
Count the nodes contained in the child collection of the home node which is defined by Relation rel.



createNode
public Node createNode(DbMapping dbm, ResultSet rs, DbColumn[] columns, int offset) throws SQLException, IOException, ClassNotFoundException(Code)
Create a new Node from a ResultSet.



deleteNode
public void deleteNode(Node node) throws Exception(Code)
Delete a node from the database.



deleteNode
public void deleteNode(IDatabase db, ITransaction txn, Node node) throws Exception(Code)
Performs the actual deletion of a node from either the embedded or an external SQL database.



doGenerateID
public String doGenerateID(DbMapping map) throws Exception(Code)
Actually generates an ID, using a method matching the given DbMapping.



evictKey
public void evictKey(Key key)(Code)
Used when a key stops being valid for a node. The cached node itself remains valid, if it is present in the cache by other keys.



evictNode
public void evictNode(Node node)(Code)
Remove a node from the node cache. If at a later time it is accessed again, it will be refetched from the database.



evictNodeByKey
public void evictNodeByKey(Key key)(Code)
Remove a node from the node cache. If at a later time it is accessed again, it will be refetched from the database.



exportNode
public void exportNode(Node node, DbSource dbs) throws SQLException, ClassNotFoundException(Code)
Insert a node into a different (relational) database than its default one.



exportNode
public void exportNode(Node node, DbMapping dbm) throws SQLException, ClassNotFoundException(Code)
Insert a node into a different (relational) database than its default one.



fireNodeChangeEvent
protected void fireNodeChangeEvent(List inserted, List updated, List deleted, List parents)(Code)
Called by transactors after committing.



generateEmbeddedID
synchronized String generateEmbeddedID(DbMapping map) throws Exception(Code)
Gererates an ID for use with the embedded database.



generateID
public String generateID(DbMapping map) throws Exception(Code)
Generate a new ID for a given type, delegating to our IDGenerator if set.



generateMaxID
synchronized String generateMaxID(DbMapping map) throws Exception(Code)
Generates an ID for the table by finding out the maximum current value



generateSequenceID
String generateSequenceID(DbMapping map) throws Exception(Code)



getCacheEntries
public Object[] getCacheEntries()(Code)
Get an array of the the keys currently held in the object cache



getDbMapping
public DbMapping getDbMapping(String protoname)(Code)
Get a DbMapping for a given prototype name. This is just a proxy method to the app's getDbMapping() method.



getNode
public Node getNode(Key key) throws Exception(Code)
Get a node by key. This is called from a node that already holds a reference to another node via a NodeHandle/Key.



getNode
public Node getNode(Node home, String kstr, Relation rel) throws Exception(Code)
Get a node by relation, using the home node, the relation and a key to apply. In contrast to getNode (Key key), this is usually called when we don't yet know whether such a node exists.



getNodeIDs
public SubnodeList getNodeIDs(Node home, Relation rel) throws Exception(Code)
Loades subnodes via subnode relation. Only the ID index is loaded, the nodes are loaded later on demand.



getNodes
public SubnodeList getNodes(Node home, Relation rel) throws Exception(Code)
Loades subnodes via subnode relation. This is similar to getNodeIDs, but it actually loades all nodes in one go, which is better for small node collections. This method is used when xxx.loadmode=aggressive is specified.



getPropertyNames
public Vector getPropertyNames(Node home, Relation rel) throws Exception(Code)
Similar to getNodeIDs, but returns a Vector that return's the nodes property names instead of IDs



getRootNode
public Node getRootNode() throws Exception(Code)
Gets the application's root node.



hasNodeChangeListeners
protected boolean hasNodeChangeListeners()(Code)
Let transactors know if they should collect and fire NodeChangeListener events



init
public void init(File dbHome, Properties props) throws DatabaseException, ClassNotFoundException, IllegalAccessException, InstantiationException(Code)
Initialize the NodeManager for the given dbHome and application properties. An embedded database will be created in dbHome if one doesn't already exist.



insertNode
public void insertNode(IDatabase db, ITransaction txn, Node node) throws IOException, SQLException, ClassNotFoundException(Code)
Insert a new node in the embedded database or a relational database table, depending on its db mapping.



insertRelationalNode
protected void insertRelationalNode(Node node, DbMapping dbm, Connection con) throws ClassNotFoundException, SQLException(Code)
Insert a node into a relational database.



isRootNode
public boolean isRootNode(Node node)(Code)
Checks if the given node is the application's root node.



prefetchNodes
public void prefetchNodes(Node home, Relation rel, Key[] keys) throws Exception(Code)



registerNode
public void registerNode(Node node)(Code)
Register a node in the node cache.



registerNode
protected void registerNode(Node node, Key key)(Code)
Register a node in the node cache using the key argument.



removeNodeChangeListener
public void removeNodeChangeListener(NodeChangeListener listener)(Code)
Remove a previously added NodeChangeListener.



replicateCache
public void replicateCache(Vector add, Vector delete)(Code)
Receive notification from a remote app that objects in its cache have been modified.



shutdown
public void shutdown() throws DatabaseException(Code)
Shut down this node manager. This is called when the application using this node manager is stopped.



updateNode
public boolean updateNode(IDatabase db, ITransaction txn, Node node) throws IOException, SQLException, ClassNotFoundException(Code)
Updates a modified node in the embedded db or an external relational database, depending on its database mapping. true if the DbMapping of the updated Node is to be marked as updated viaDbMapping.setLastDataChange



updateProperties
public void updateProperties(Properties props)(Code)
app.properties file has been updated. Reread some settings.



updateSubnodeList
public int updateSubnodeList(Node home, Relation rel) throws Exception(Code)
Update a UpdateableSubnodeList retrieving all values having higher Values according to the updateCriteria's set for this Collection's Relation The returned Map-Object has two Properties: addedNodes = an Integer representing the number of Nodes added to this collection newNodes = an Integer representing the number of Records returned by the Select-Statement These two values may be different if a max-size is defined for this Collection and a new node would be outside of this Border because of the ordering of this collection.
Parameters:
  home - the home of this subnode-list
Parameters:
  rel - the relation the home-node has to the nodes contained inside the subnodelist A map having two properties of type String (newNodes (number of nodes retreived by the select-statment), addedNodes (nodes added to the collection))
throws:
  Exception -



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.