Java Doc for PersistencePlugin.java in  » Science » Cougaar12_4 » org » cougaar » core » persist » 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 » Science » Cougaar12_4 » org.cougaar.core.persist 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.cougaar.core.persist.PersistencePlugin

All known Subclasses:   org.cougaar.core.persist.FilePersistenceBase,  org.cougaar.core.persist.DatabasePersistence,  org.cougaar.core.persist.BufferedFilePersistence,  org.cougaar.core.persist.FilePersistence,  org.cougaar.core.persist.DummyPersistence,
PersistencePlugin
public interface PersistencePlugin (Code)
A media-specific persistence handler for reading and writing snapshots.

PersistencePlugin defines the API that media-specific persistence plugins must implement. A persistence plugin defines a medium that can be used to store a series of persistence snapshots. When an agent restarts, a set of these snapshots called a rehydration set is retrieved from the persistence medium to reconstitute or "rehydrate" the previous state of the agent.





Method Summary
 voidabortOutputStream(SequenceNumbers retainNumbers)
     Clean up after output was aborted.
 booleancheckOwnership()
    
 voidcleanupArchive()
    
 voidcleanupOldDeltas(SequenceNumbers cleanupNumbers)
     Cleanup old deltas as specified by cleanupNumbers.
 voidfinishInputStream(int deltaNumber)
    
 voidfinishOutputStream(SequenceNumbers retainNumbers, boolean full)
     Clean up after closing the output stream.
 intgetConsolidationPeriod()
     Get the number of incremental snapshots between full snapshots.
 String[]getControlNames()
     Gets the names of all media-specific controls.
 OMCRangeListgetControlValues(String controlName)
     Gets the list of allowed ranges for values of the named control.
 java.sql.ConnectiongetDatabaseConnection(Object locker)
     Get the connection to the database into which persistence deltas are being written for coordinated transaction management.
 StringgetName()
     Gets the name of the PersistencePlugin.
 StringgetParam(int i)
     Get a specific plugin parameter.
Parameters:
  i - the index of the desired parameter.
 intgetParamCount()
     Get the number of parameters for this plugin.
 longgetPersistenceInterval()
    
 voidinit(PersistencePluginSupport pps, String name, String[] params, boolean deleteOldPersistence)
     Initialize the plugin with PersistencePluginSupport and parameters.
 booleanisWritable()
     Is this persistence medium writable? Non-writable media are only used for rehydration.
 voidlockOwnership()
     Lock out other instances of this agent.
 InputStreamopenInputStream(int deltaNumber)
     Open an InputStream from which a persistence delta can be read.
 OutputStreamopenOutputStream(int deltaNumber, boolean full)
     Open an OutputStream onto which a persistence delta can be written.
 SequenceNumbers[]readSequenceNumbers(String suffix)
     Read the specified set of sequence numbers.
 voidreleaseDatabaseConnection(Object locker)
     Release the connection to the database into which persistence deltas are being written for coordinated transaction management.
 DataProtectionKeyretrieveDataProtectionKey(int deltaNumber)
    
 voidsetConsolidationPeriod(int newPeriod)
    
 voidsetControl(String controlName, Comparable newValue)
     Set value of a particular control.
 voidsetPersistenceInterval(long newInterval)
    
 voidsetWritable(boolean newDisable)
    
 voidstoreDataProtectionKey(int deltaNumber, DataProtectionKey key)
    
 voidunlockOwnership()
     Release the lockout of other instances of this agent.



Method Detail
abortOutputStream
void abortOutputStream(SequenceNumbers retainNumbers)(Code)
Clean up after output was aborted. Called in response to an exception during the writing of the current stream.
Parameters:
  retainNumbers - the numbers of the deltas excluding theone just written that comprise a complete rehydration set.Subsequent calls to readSequenceNumbers should return thesevalues.



checkOwnership
boolean checkOwnership() throws PersistenceException(Code)
Check that this agent instance still owns the persistence data



cleanupArchive
void cleanupArchive()(Code)
Delete old archives



cleanupOldDeltas
void cleanupOldDeltas(SequenceNumbers cleanupNumbers)(Code)
Cleanup old deltas as specified by cleanupNumbers. These deltas are never part of the current state. When archiving is enabled, the old deltas constituting an archive are not discarded.
Parameters:
  cleanupNumbers - the numbers to be discarded (or archived).



finishInputStream
void finishInputStream(int deltaNumber)(Code)
Clean up after closing the input stream
Parameters:
  deltaNumber - the number of the delta being closed.Provided as a convenience to the method



finishOutputStream
void finishOutputStream(SequenceNumbers retainNumbers, boolean full)(Code)
Clean up after closing the output stream. This method is called within a mutual exclusion semaphore such that multiple instances of the same agent cannot both be calling this or related methods. This is the opportunity to rename the output stream to its real identity.
Parameters:
  retainNumbers - the numbers of the deltas including theone just written that comprise a complete rehydration set.Subsequent calls to readSequenceNumbers should return thesevalues.



getConsolidationPeriod
int getConsolidationPeriod()(Code)
Get the number of incremental snapshots between full snapshots.



getControlNames
String[] getControlNames()(Code)
Gets the names of all media-specific controls. The names of these controls must not conflict with the (@link BasePersistence#getMediaControlNames names that all media plugins have}. an array of the names of the controls for this mediaplugin.



getControlValues
OMCRangeList getControlValues(String controlName)(Code)
Gets the list of allowed ranges for values of the named control. Values supplied to PersistencePlugin.setControl are guaranteed to be in the specified ranges. the list or allowed ranges.



getDatabaseConnection
java.sql.Connection getDatabaseConnection(Object locker) throws UnsupportedOperationException(Code)
Get the connection to the database into which persistence deltas are being written for coordinated transaction management. Non-database implementations should throw an UnsupportedOperationException



getName
String getName()(Code)
Gets the name of the PersistencePlugin. Every PersistencePlugin should have a distinct name. The name can be computed by the plugin based on its class and parameters or it can be specified as an argument in the constructor.



getParam
String getParam(int i)(Code)
Get a specific plugin parameter.
Parameters:
  i - the index of the desired parameter. Must be between 0(inclusive) and the value returned byPersistencePlugin.getParamCount getParamCount (exclusive). the value of the specified parameter.



getParamCount
int getParamCount()(Code)
Get the number of parameters for this plugin. the number of parameters



getPersistenceInterval
long getPersistenceInterval()(Code)
Get the average interval between persistence snapshots for this plugin



init
void init(PersistencePluginSupport pps, String name, String[] params, boolean deleteOldPersistence) throws PersistenceException(Code)
Initialize the plugin with PersistencePluginSupport and parameters. After initialization, the plugin should be ready to service all methods.
Parameters:
  pps - the persistence plugin support specifies the contextwithin which persistence is being performed.
Parameters:
  name - the name of this plugin.
Parameters:
  params - String parameters to configure the plugin. Theparameters come from configuration information andinterpretation is up to the plugin.



isWritable
boolean isWritable()(Code)
Is this persistence medium writable? Non-writable media are only used for rehydration.



lockOwnership
void lockOwnership() throws PersistenceException(Code)
Lock out other instances of this agent.



openInputStream
InputStream openInputStream(int deltaNumber) throws IOException(Code)
Open an InputStream from which a persistence delta can be read.
Parameters:
  deltaNumber - the number of the delta to be opened



openOutputStream
OutputStream openOutputStream(int deltaNumber, boolean full) throws IOException(Code)
Open an OutputStream onto which a persistence delta can be written. The stream returned should be relatively non-blocking since it is possible for the entire agent to be blocked waiting for completion. Implementations that may block indefinitely should perform buffering as needed. Also, the OutputStream should be unique relative to other instances of the same agent
Parameters:
  deltaNumber - the number of the delta that will bewritten. Numbers are never re-used so this number can be usedto uniquely identify the delta.
Parameters:
  full - indicates that the information to be written is acomplete state dump and does not depend on any earlier deltas.It may be useful to distinctively mark such deltas.



readSequenceNumbers
SequenceNumbers[] readSequenceNumbers(String suffix)(Code)
Read the specified set of sequence numbers. These numbers should identify a complete set of persistence deltas needed to restore the specified state. A specific archive may be specified using the suffix argument. an array of possible rehydration sets. The timestamp ofeach indicates how recent each rehydration set is.
Parameters:
  suffix - identifies which set of persistence deltas arewanted. A non-empty suffix specifies an specific, archivedstate. An empty suffix specifies all available sets.



releaseDatabaseConnection
void releaseDatabaseConnection(Object locker) throws UnsupportedOperationException(Code)
Release the connection to the database into which persistence deltas are being written for coordinated transaction management. Non-database implementations should throw an UnsupportedOperationException



retrieveDataProtectionKey
DataProtectionKey retrieveDataProtectionKey(int deltaNumber) throws IOException(Code)
Retrieve an encrypted key for a particular delta number
Parameters:
  deltaNumber - the number of the delta for which the key is used.



setConsolidationPeriod
void setConsolidationPeriod(int newPeriod)(Code)



setControl
void setControl(String controlName, Comparable newValue)(Code)
Set value of a particular control. Values are guaranteed to be in the ranges specified by PersistencePlugin.getControlValues
Parameters:
  controlName - the name of the control
Parameters:
  newValue - the new value of the control



setPersistenceInterval
void setPersistenceInterval(long newInterval)(Code)



setWritable
void setWritable(boolean newDisable)(Code)



storeDataProtectionKey
void storeDataProtectionKey(int deltaNumber, DataProtectionKey key) throws IOException(Code)
Store an encrypted key for a particular delta number
Parameters:
  deltaNumber - the number of the delta for which the key is used.
Parameters:
  key - has the encrypted key to be stored



unlockOwnership
void unlockOwnership() throws PersistenceException(Code)
Release the lockout of other instances of this agent.



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