Java Doc for VersantPersistenceManagerFactory.java in  » Testing » PolePosition-0.20 » com » versant » core » jdo » 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 » Testing » PolePosition 0.20 » com.versant.core.jdo 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.versant.core.jdo.VersantPersistenceManagerFactory

VersantPersistenceManagerFactory
public interface VersantPersistenceManagerFactory extends PersistenceManagerFactory(Code)
JDO Genie extension to the PersistenceManagerFactory interface. This adds methods for monitoring a JDO Genie server, controlling event logging, changing the cache size etc. To use this just cast the PMF to this and call the methods.


Field Summary
final public static  intEVENT_ALL
    
final public static  intEVENT_ERRORS
    
final public static  intEVENT_NORMAL
    
final public static  intEVENT_VERBOSE
    
final public static  StringPROP_DRIVER_NAME
    
final public static  StringPROP_FACTORY2_NAME
    
final public static  StringPROP_FACTORY_NAME
    
final public static  StringPROP_PASSWORD
    
final public static  StringPROP_URL
    
final public static  StringPROP_USER_NAME
    


Method Summary
public  voidaddLifecycleListener(LifecycleListener listener, Class[] classes)
     This PersistenceManagerFactory method adds the listener to the list of lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory.
public  voidclearConnectionPool(String datastore)
     Close all connections in the pool for the datastore.
public  voiddoSystemGC()
     Call System.gc() in the VM that the JDO Genie server associated with this PMF is running in.
public  voidevict(Object oid)
     Evict all information for an OID from the PMF wide cache.
public  voidevictAll(Object[] oids)
     Evict all information for an array of OIDs from the PMF wide cache.
public  voidevictAll(Collection oids)
     Evict all information for a collection of OIDs from the PMF wide cache.
public  voidevictAll(Class cls, boolean includeSubclasses)
     Evict all information for all JDO instances of a Class from the PMF wide cache.
public  voidevictAll()
     Evict all JDO instances from the PMF wide cache.
public  ClassgetClassForID(int classid)
     Get the Class for the classid.
public  ClassgetClassForIndex(int index)
     Get the Class for a class index.
public  ClassgetClassForJdbcID(Class baseClass, Object jdbcClassid)
     Get the Class for the jdbc-class-id for a class in the heirachy starting at baseClass.
public  intgetClassID(Class cls)
     Get the classid for the class.
public  intgetClassIndex(Class cls)
     Get the class index for the class.
public  int[]getClassIndexes(Class[] classes, boolean includeSubclasses)
     Convert an array of Class'es into their class indexes.
public  DataStoreInfogetDataStoreInfo(String datastore)
     This method is for internal testing.
public  ObjectgetEntityManagerFactory()
     Create a ejb3 EntityManagerFactory.
public  ObjectgetJdbcClassID(Class cls)
     Get the JDBC classid for the class.
public  ConnectiongetJdbcConnection(String datastore)
     Obtain a JDBC connection from the pool for the datastore.
public  Metric[]getMetrics()
     Get all the performance metrics configured on the server.
public  MetricSnapshotPacketgetMostRecentMetricSnapshot(int lastId)
     Get the most recent performance metric snapshot since the one with ID of lastId.
public  MetricSnapshotPacketgetNewMetricSnapshots(int lastId)
     Get all performance metric snapshots newer that lastId or all available data if lastId is 0.
public  LogEvent[]getNewPerfEvents(int lastId)
     Get all performance events newer than lastId or all events if lastId is 0.
public  ListgetPersistenceManagers()
     Get status information on all active PersistenceManager's.
public  intgetPmCacheRefType()
     Get the type of reference used to reference instances in the local PM cache by PMs returned by this factory.
public  PmfStatusgetPmfStatus()
     Get server status information bean.
public  RemoteClientStatus[]getRemoteClients()
     Get status information on all active remote clients.
public  PropertyInfogetServerConfiguration()
     Get a tree of all the configurable properties of the server and their current values.
public  ObjectgetServerUserObject()
     Get the user object associated with the JDO Genie server.
public  intgetUserMetric(String name)
     Get the value of the named user-defined metric.
public  ObjectgetUserObject()
     Get the user object.
public  voidincUserMetric(String name, int delta)
     Add delta to the value of the named user-defined metric.
public  booleanisAllowPmCloseWithTxOpen()
     Is closing a PersistenceManager with a active tx is allowed? The default is false.
public  booleanisCheckModelConsistencyOnCommit()
     Are bidirectional relationships (one-to-many, many-to-many) checked for consistency on commit for new PersistenceManagers? The default is false.
public  booleanisInCache(Object oid)
     Is the OID in the PMF wide cache? Note that it may already be gone even if this call returns true.
public  booleanisInterceptDfgFieldAccess()
     Is access to loaded default fetch group fields always intercepted? See the "Cache Management" chapter of the manual for more information on this flag.
public  voidlogEvent(int level, String description, int ms)
     Log a user defined event.
public  voidregisterSCOPersistenceDelegates(Object encoder)
     Configure the encoder with PersistenceDelegate's for JDO Genie SCO instances.
public  voidremoveLifecycleListener(LifecycleListener listener)
     This PersistenceManagerFactory method removes the listener from the list of event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory.
public  voidsetAllowPmCloseWithTxOpen(boolean allowed)
     Allow the closing of a PersistenceManager with active tx.
public  voidsetCheckModelConsistencyOnCommit(boolean on)
     Enable or disable commit time consistency checking for bidirectional relationships (one-to-many, many-to-many) in newly created PersistenceManagers.
public  voidsetInterceptDfgFieldAccess(boolean interceptDfgFieldAccess)
     Control interception of loaded default fetch group fields.
public  voidsetPmCacheRefType(int pmCacheRefType)
     Set the type of reference used to reference instances in the local PM cache by PMs returned by this factory.
public  StringsetServerProperty(String[] beanPath, String value)
     Change a property on a component of the server (e.g.
public  voidsetServerUserObject(Object o)
     Associate a user object with the JDO Genie server.
public  voidsetUserMetric(String name, int value)
     Set the value of the named user-defined metric.
public  voidsetUserObject(Object o)
     Associate a user object with this PMF.
public  voidshutdown()
     Shutdown the JDO Genie server.

Field Detail
EVENT_ALL
final public static int EVENT_ALL(Code)



EVENT_ERRORS
final public static int EVENT_ERRORS(Code)



EVENT_NORMAL
final public static int EVENT_NORMAL(Code)



EVENT_VERBOSE
final public static int EVENT_VERBOSE(Code)



PROP_DRIVER_NAME
final public static String PROP_DRIVER_NAME(Code)



PROP_FACTORY2_NAME
final public static String PROP_FACTORY2_NAME(Code)



PROP_FACTORY_NAME
final public static String PROP_FACTORY_NAME(Code)



PROP_PASSWORD
final public static String PROP_PASSWORD(Code)



PROP_URL
final public static String PROP_URL(Code)



PROP_USER_NAME
final public static String PROP_USER_NAME(Code)





Method Detail
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener, Class[] classes)(Code)
This PersistenceManagerFactory method adds the listener to the list of lifecycle event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory. The classes parameter identifies all of the classes of interest. If the classes parameter is specified as null, events for all persistent classes and interfaces are generated. If the classes specified have persistence-capable subclasses, all such subclasses are registered implicitly. The listener will be called for each event for which it implements the corresponding listener interface.



clearConnectionPool
public void clearConnectionPool(String datastore)(Code)
Close all connections in the pool for the datastore. Connections currently in use are not closed. If datastore is null then the connections for the default datastore are closed. Any errors encountered closing the connections are silently discarded. If you know backups happen at 3am and the database is restarted then you can schedule a call to this method to get rid of the stale connections in the pool.



doSystemGC
public void doSystemGC()(Code)
Call System.gc() in the VM that the JDO Genie server associated with this PMF is running in.



evict
public void evict(Object oid)(Code)
Evict all information for an OID from the PMF wide cache. This is a NOP if there is no information in the cache for the OID.
Parameters:
  oid - OID of the JDO instance to be evicted



evictAll
public void evictAll(Object[] oids)(Code)
Evict all information for an array of OIDs from the PMF wide cache.
Parameters:
  oids - OIDs of the JDO instances to be evicted



evictAll
public void evictAll(Collection oids)(Code)
Evict all information for a collection of OIDs from the PMF wide cache.
Parameters:
  oids - Collection of OIDs of the JDO instances to be evicted



evictAll
public void evictAll(Class cls, boolean includeSubclasses)(Code)
Evict all information for all JDO instances of a Class from the PMF wide cache.
Parameters:
  cls - Class of JDO instances to be evicted
Parameters:
  includeSubclasses - If true then instances of subclasses are alsoevicted



evictAll
public void evictAll()(Code)
Evict all JDO instances from the PMF wide cache.



getClassForID
public Class getClassForID(int classid)(Code)
Get the Class for the classid. A JDOUserException is thrown if the classid is invalid.
See Also:   VersantPersistenceManagerFactory.getClassID
See Also:   VersantPersistenceManagerFactory.getClassForJdbcID
See Also:   VersantPersistenceManagerFactory.getClassForIndex



getClassForIndex
public Class getClassForIndex(int index)(Code)
Get the Class for a class index. An JDOUserException exception is thrown if the index is invalid.
See Also:   VersantPersistenceManagerFactory.getClassIndex
See Also:   VersantPersistenceManagerFactory.getClassForID
See Also:   VersantPersistenceManagerFactory.getClassForJdbcID



getClassForJdbcID
public Class getClassForJdbcID(Class baseClass, Object jdbcClassid)(Code)
Get the Class for the jdbc-class-id for a class in the heirachy starting at baseClass. A JDOUserException is thrown if the jdbc-class-id is invalid.
See Also:   VersantPersistenceManagerFactory.getJdbcClassID
See Also:   VersantPersistenceManagerFactory.getClassForID
See Also:   VersantPersistenceManagerFactory.getClassForIndex



getClassID
public int getClassID(Class cls)(Code)
Get the classid for the class. This is a positive int generated from a hash of the class name. It is used as part of the OID string for datastore identity classes and in jdo_class columns in inheritance heirachies. A JDOUserException is thrown if cls is not persistent.
See Also:   VersantPersistenceManagerFactory.getClassForID
See Also:   VersantPersistenceManagerFactory.getJdbcClassID
See Also:   VersantPersistenceManagerFactory.getClassIndex



getClassIndex
public int getClassIndex(Class cls)(Code)
Get the class index for the class. This is an int between 0 and the number of perstent classes less 1. It is appropriate for short term representation of a class. It will change as new persistent classes are added to the model. A JDOUserException is thrown if cls is not persistent.
See Also:   VersantPersistenceManagerFactory.getClassForIndex
See Also:   VersantPersistenceManagerFactory.getClassID
See Also:   VersantPersistenceManagerFactory.getJdbcClassID



getClassIndexes
public int[] getClassIndexes(Class[] classes, boolean includeSubclasses)(Code)
Convert an array of Class'es into their class indexes. If includeSubclasses is true then this will recursively get the indexes for all the subclasses in each heirachy.



getDataStoreInfo
public DataStoreInfo getDataStoreInfo(String datastore)(Code)
This method is for internal testing. Get information about the datastore. If the datastore parameter is null the information about the default datastore is returned.



getEntityManagerFactory
public Object getEntityManagerFactory()(Code)
Create a ejb3 EntityManagerFactory.



getJdbcClassID
public Object getJdbcClassID(Class cls)(Code)
Get the JDBC classid for the class. If the class is part of an inheritance heirachy then this is the value of the jdbc-class column that identifies instances of the class. The default value is the classid for the class but this can be changed using the jdbc-class-id extension in the meta data.
See Also:   VersantPersistenceManagerFactory.getClassForJdbcID
See Also:   VersantPersistenceManagerFactory.getClassID
See Also:   VersantPersistenceManagerFactory.getClassIndex



getJdbcConnection
public Connection getJdbcConnection(String datastore) throws SQLException(Code)
Obtain a JDBC connection from the pool for the datastore. If the datastore name is null then the default datastore is used. You must close the connection at some point to return it to the pool. The connection has no transaction association and autoCommit will be set to false. If JDBC event logging is on then operations on the connection will be logged. This method is not available to remote clients and a JDOUserException is thrown if it is called by a remote client or if the datastore does not exist.



getMetrics
public Metric[] getMetrics()(Code)
Get all the performance metrics configured on the server.
See Also:   VersantPersistenceManagerFactory.getNewMetricSnapshots(int)



getMostRecentMetricSnapshot
public MetricSnapshotPacket getMostRecentMetricSnapshot(int lastId)(Code)
Get the most recent performance metric snapshot since the one with ID of lastId. If no new data is available then null is be returned. If lastId is 0 then the most recent snapshot is returned.
See Also:   VersantPersistenceManagerFactory.getMetrics()
See Also:   VersantPersistenceManagerFactory.getNewMetricSnapshots(int)



getNewMetricSnapshots
public MetricSnapshotPacket getNewMetricSnapshots(int lastId)(Code)
Get all performance metric snapshots newer that lastId or all available data if lastId is 0. If no new data is available then null is be returned.
See Also:   VersantPersistenceManagerFactory.getMetrics()
See Also:   VersantPersistenceManagerFactory.getMostRecentMetricSnapshot(int)



getNewPerfEvents
public LogEvent[] getNewPerfEvents(int lastId)(Code)
Get all performance events newer than lastId or all events if lastId is 0. If no new events are available null is returned.



getPersistenceManagers
public List getPersistenceManagers()(Code)
Get status information on all active PersistenceManager's.



getPmCacheRefType
public int getPmCacheRefType()(Code)
Get the type of reference used to reference instances in the local PM cache by PMs returned by this factory.
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



getPmfStatus
public PmfStatus getPmfStatus()(Code)
Get server status information bean. For much more detailed information on the state of the server use VersantPersistenceManagerFactory.getNewMetricSnapshots(int) .



getRemoteClients
public RemoteClientStatus[] getRemoteClients()(Code)
Get status information on all active remote clients.



getServerConfiguration
public PropertyInfo getServerConfiguration()(Code)
Get a tree of all the configurable properties of the server and their current values.



getServerUserObject
public Object getServerUserObject()(Code)
Get the user object associated with the JDO Genie server. Note that if the PMF is local then this is the same object as returned by getUserObject. If the PMF is remote then this is the user object associated with the local PMF on the server. For the remote case the user object must be serializable. Typically it will be a remote object providing services to remote clients. Making it available through this method avoids having to register it with the RMI registry or some other naming service.
See Also:   VersantPersistenceManagerFactory.setServerUserObject(Object)



getUserMetric
public int getUserMetric(String name)(Code)
Get the value of the named user-defined metric. Note that the values for all user-defined metrics are returned with each set of samples in VersantPersistenceManagerFactory.getNewMetricSnapshots(int) .



getUserObject
public Object getUserObject()(Code)
Get the user object.
See Also:   VersantPersistenceManagerFactory.setUserObject



incUserMetric
public void incUserMetric(String name, int delta)(Code)
Add delta to the value of the named user-defined metric.
See Also:   VersantPersistenceManagerFactory.setUserMetric



isAllowPmCloseWithTxOpen
public boolean isAllowPmCloseWithTxOpen()(Code)
Is closing a PersistenceManager with a active tx is allowed? The default is false.
See Also:   VersantPersistenceManagerFactory.setAllowPmCloseWithTxOpen(boolean)



isCheckModelConsistencyOnCommit
public boolean isCheckModelConsistencyOnCommit()(Code)
Are bidirectional relationships (one-to-many, many-to-many) checked for consistency on commit for new PersistenceManagers? The default is false.
See Also:   VersantPersistenceManagerFactory.setCheckModelConsistencyOnCommit(boolean)
See Also:   com.versant.core.jdo.VersantPersistenceManager.isCheckModelConsistencyOnCommit



isInCache
public boolean isInCache(Object oid)(Code)
Is the OID in the PMF wide cache? Note that it may already be gone even if this call returns true. This is for our unit tests.



isInterceptDfgFieldAccess
public boolean isInterceptDfgFieldAccess()(Code)
Is access to loaded default fetch group fields always intercepted? See the "Cache Management" chapter of the manual for more information on this flag.



logEvent
public void logEvent(int level, String description, int ms)(Code)
Log a user defined event. If the event logging level does not match the level parameter then the event is ignored. For remote PMs this check is done on the server so a network call is required even if the event is not logged.
See Also:   VersantPersistenceManagerFactory.EVENT_ERRORS
See Also:   VersantPersistenceManagerFactory.EVENT_NORMAL
See Also:   VersantPersistenceManagerFactory.EVENT_VERBOSE
See Also:   VersantPersistenceManagerFactory.EVENT_ALL



registerSCOPersistenceDelegates
public void registerSCOPersistenceDelegates(Object encoder)(Code)
Configure the encoder with PersistenceDelegate's for JDO Genie SCO instances. The java.beans package was only added in JDK 1.4.
See Also:   java.beans.Encoder



removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)(Code)
This PersistenceManagerFactory method removes the listener from the list of event listeners set as the initial listeners for each PersistenceManager created by this PersistenceManagerFactory.



setAllowPmCloseWithTxOpen
public void setAllowPmCloseWithTxOpen(boolean allowed)(Code)
Allow the closing of a PersistenceManager with active tx. The default is to not allow it.



setCheckModelConsistencyOnCommit
public void setCheckModelConsistencyOnCommit(boolean on)(Code)
Enable or disable commit time consistency checking for bidirectional relationships (one-to-many, many-to-many) in newly created PersistenceManagers. When this flag is enabled commiting with an incorrectly completed bidirectional relationship will trigger a JDOUserException. This check is expensive and should only be enabled during development.
See Also:   com.versant.core.jdo.VersantPersistenceManager.setCheckModelConsistencyOnCommit(boolean)



setInterceptDfgFieldAccess
public void setInterceptDfgFieldAccess(boolean interceptDfgFieldAccess)(Code)
Control interception of loaded default fetch group fields. See the "Cache Management" chapter of the manual for more information on this flag.



setPmCacheRefType
public void setPmCacheRefType(int pmCacheRefType)(Code)
Set the type of reference used to reference instances in the local PM cache by PMs returned by this factory. This can also be changed for each PM using com.versant.core.jdo.VersantPersistenceManager.setPmCacheRefType(int) .
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_WEAK
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_SOFT
See Also:   com.versant.core.jdo.VersantPersistenceManager.PM_CACHE_REF_TYPE_STRONG



setServerProperty
public String setServerProperty(String[] beanPath, String value)(Code)
Change a property on a component of the server (e.g. the cache). If the return value is null then the change was sucessful otherwise it is an error message.
Parameters:
  beanPath - The path to the bean property to change (build thisusing the name of each bean in the path and the name of theproperty)
Parameters:
  value - The new value for the property



setServerUserObject
public void setServerUserObject(Object o)(Code)
Associate a user object with the JDO Genie server. Note that if the PMF is local then this method just calls setUserObject. This method makes it possible for a remote client to change the user object associated with the local PMF on the server.
See Also:   VersantPersistenceManagerFactory.getServerUserObject()
See Also:   VersantPersistenceManagerFactory.setUserObject(Object)



setUserMetric
public void setUserMetric(String name, int value)(Code)
Set the value of the named user-defined metric.
See Also:   VersantPersistenceManagerFactory.incUserMetric



setUserObject
public void setUserObject(Object o)(Code)
Associate a user object with this PMF. Note that if the PMF is local then there is one object for the whole server. If the PMF is remote then there is one object per remote connection (i.e. client). For remote PMFs the object must be Serializable. This is typically used to identify remote clients in some way (e.g. the logged on user or a remote stub to communicate with the client).
See Also:   VersantPersistenceManagerFactory.getUserObject()



shutdown
public void shutdown()(Code)
Shutdown the JDO Genie server.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.