Java Doc for StoreManager.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » server » cluster » 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 » EJB Server resin 3.1.5 » resin » com.caucho.server.cluster 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.server.cluster.StoreManager

All known Subclasses:   com.caucho.server.cluster.FileStore,
StoreManager
abstract public class StoreManager implements AlarmListener,EnvironmentListener,ClassLoaderListener(Code)
Base class for distributed stores.

Inner Class :static class ObjectKey

Field Summary
final static  L10NL
    
protected  LruCache<String, ClusterObject>_clusterObjects
    
protected  long_idleCheckInterval
    
protected  boolean_isAlwaysLoad
    
protected  boolean_isAlwaysSave
    
protected volatile  long_loadCount
    
protected volatile  long_loadFailCount
    
protected  long_maxIdleTime
    
protected volatile  long_saveCount
    
protected volatile  long_saveFailCount
    
protected  int_selfIndex
    
protected  HashMap<String, Store>_storeMap
    
final protected static  Loggerlog
    

Constructor Summary
protected  StoreManager()
    

Method Summary
public  voidaccess(String uniqueId)
     Updates the object's access time.
public  voidaccess(Store store, String id)
     Updates the object's access time.
abstract public  voidaccessImpl(String uniqueId)
     Updates the object's access time in the persistent store.
public  voidclassLoaderDestroy(DynamicClassLoader loader)
     Handles the case where the environment loader is dropped.
public  voidclassLoaderInit(DynamicClassLoader loader)
     Handles the case where the environment is activated.
public  voidclearOldObjects()
     Cleans old objects.
 ClusterObjectcreate(Store store, String id)
     Creates the cluster object.
 ClusterObjectcreateClusterObject(Store store, String id)
     Returns the cluster object.
public  StorecreateStore(String storeId, ObjectManager objectManager)
     Creates a Store.
static  intdecode(int code)
    
public  voiddestroy()
     Called at end of life.
public  voidenvironmentConfig(EnvironmentClassLoader loader)
     Handles the case where the environment is activated.
public  voidenvironmentStart(EnvironmentClassLoader loader)
     Handles the case where the environment is activated.
public  voidenvironmentStop(EnvironmentClassLoader loader)
    
public  longgetAccessWindowTime()
     Returns the length of time an idle object can remain in the store before being cleaned.
public  PersistentStoreMXBeangetAdmin()
     Returns the admin.
public  ClustergetCluster()
     Gets the cluster.
 ClusterObjectgetClusterObject(Store store, String id)
     Returns the cluster object.
 ClusterObjectgetClusterObject(String storeId, String id)
     Returns the cluster object.
 ClusterObjectgetClusterObject(String uniqueId)
     Returns the cluster object.
public  longgetIdleCheckTime()
     Sets the idle check interval for the alarm.
public  longgetLoadCount()
     Returns the total objects loaded.
public  longgetLoadFailCount()
     Returns the objects which failed to load.
public  longgetMaxIdleTime()
     Returns the length of time an idle object can remain in the store before being cleaned.
public  longgetObjectCount()
    
protected  ServerConnectorgetOwningServer(String objectId)
    
public  intgetPrimaryIndex(String id, int offset)
     Returns the owning index.
public  longgetSaveCount()
     Returns the total objects saved.
public  longgetSaveFailCount()
     Returns the objects which failed to save.
public  intgetSecondaryIndex(String id, int offset)
     Returns the backup index.
protected  intgetSelfIndex()
     Returns the self servers.
protected  ServerConnector[]getServerList()
     Returns the list of cluster servers.
public  StoregetStore(String storeId)
     Creates a ClusterObjectManager.
public  intgetTertiaryIndex(String id, int offset)
     Returns the backup index.
public  voidhandleAlarm(Alarm alarm)
     Handles a callback from an alarm, scheduling the timeout.
public  booleaninit()
     Called after any factory settings.
public  booleanisAlwaysLoad()
     Set true if the store should always try to load the object.
public  booleanisAlwaysSave()
     Set true if the store should always try to store the object.
protected  booleanisPrimary(String id)
     Returns true if this server is a primary for the given object id.
abstract protected  booleanload(ClusterObject clusterObject, Object obj)
     Loads object access time.
public  voidremove(ClusterObject obj)
     When the object is no longer valid, remove it from the backing store.
public  voidremove(Store store, String objectId)
     When the object is no longer valid, remove it from the backing store.
 ClusterObjectremoveClusterObject(String storeId, String id)
     Returns the cluster object.
public  StoreremoveStore(String storeId)
     Removes a Store.
public  voidsetAlwaysLoad(boolean alwaysLoad)
     Set true if the store should always try to load the object.
public  voidsetAlwaysSave(boolean alwaysSave)
     Set true if the store should always try to store the object.
public  voidsetCluster(Cluster cluster)
     Sets the cluster.
public  voidsetExpireInterval(String uniqueId, long expires)
     Sets the timef for the expires interval.
Parameters:
  uniqueId - the identifier of the object.
public  voidsetMaxIdleTime(Period maxIdleTime)
     Sets the length of time an idle object can remain in the store before being cleaned.
public  booleanstart()
     Called to start the store.
public  voidstore(Store store, String id, Object obj)
     Saves the object to the cluster.
abstract protected  voidstore(ClusterObject clusterObject, TempStream tempStream, long crc)
     Save the object to the store.
public  StringtoString()
    
public  voidupdate(String storeId, String objectId)
     When the object is no longer valid, remove it from the backing store.
public  voidupdateIdleCheckInterval(long idleCheckInterval)
     Sets the idle check interval for the alarm.
public  voidupdateOwner(String objectId, String uniqueId)
     Updates the owner object.

Field Detail
L
final static L10N L(Code)



_clusterObjects
protected LruCache<String, ClusterObject> _clusterObjects(Code)



_idleCheckInterval
protected long _idleCheckInterval(Code)



_isAlwaysLoad
protected boolean _isAlwaysLoad(Code)



_isAlwaysSave
protected boolean _isAlwaysSave(Code)



_loadCount
protected volatile long _loadCount(Code)



_loadFailCount
protected volatile long _loadFailCount(Code)



_maxIdleTime
protected long _maxIdleTime(Code)



_saveCount
protected volatile long _saveCount(Code)



_saveFailCount
protected volatile long _saveFailCount(Code)



_selfIndex
protected int _selfIndex(Code)



_storeMap
protected HashMap<String, Store> _storeMap(Code)



log
final protected static Logger log(Code)




Constructor Detail
StoreManager
protected StoreManager()(Code)




Method Detail
access
public void access(String uniqueId) throws Exception(Code)
Updates the object's access time.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to update.



access
public void access(Store store, String id) throws Exception(Code)
Updates the object's access time.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to update.



accessImpl
abstract public void accessImpl(String uniqueId) throws Exception(Code)
Updates the object's access time in the persistent store.
Parameters:
  uniqueId - the identifier of the object.



classLoaderDestroy
public void classLoaderDestroy(DynamicClassLoader loader)(Code)
Handles the case where the environment loader is dropped.



classLoaderInit
public void classLoaderInit(DynamicClassLoader loader)(Code)
Handles the case where the environment is activated.



clearOldObjects
public void clearOldObjects() throws Exception(Code)
Cleans old objects. Living objects corresponding to the old objects are not cleared, since their timeout should be less than the store timeout.



create
ClusterObject create(Store store, String id)(Code)
Creates the cluster object.



createClusterObject
ClusterObject createClusterObject(Store store, String id)(Code)
Returns the cluster object.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



createStore
public Store createStore(String storeId, ObjectManager objectManager)(Code)
Creates a Store. The Store manages persistent objects for a particular domain, like the sesions for the /foo URL.
Parameters:
  storeId - the persistent domain.



decode
static int decode(int code)(Code)



destroy
public void destroy()(Code)
Called at end of life.



environmentConfig
public void environmentConfig(EnvironmentClassLoader loader)(Code)
Handles the case where the environment is activated.



environmentStart
public void environmentStart(EnvironmentClassLoader loader)(Code)
Handles the case where the environment is activated.



environmentStop
public void environmentStop(EnvironmentClassLoader loader)(Code)
Handles the case where the environment loader is stops



getAccessWindowTime
public long getAccessWindowTime()(Code)
Returns the length of time an idle object can remain in the store before being cleaned.



getAdmin
public PersistentStoreMXBean getAdmin()(Code)
Returns the admin.



getCluster
public Cluster getCluster()(Code)
Gets the cluster.



getClusterObject
ClusterObject getClusterObject(Store store, String id)(Code)
Returns the cluster object.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



getClusterObject
ClusterObject getClusterObject(String storeId, String id)(Code)
Returns the cluster object.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



getClusterObject
ClusterObject getClusterObject(String uniqueId)(Code)
Returns the cluster object.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



getIdleCheckTime
public long getIdleCheckTime()(Code)
Sets the idle check interval for the alarm.



getLoadCount
public long getLoadCount()(Code)
Returns the total objects loaded.



getLoadFailCount
public long getLoadFailCount()(Code)
Returns the objects which failed to load.



getMaxIdleTime
public long getMaxIdleTime()(Code)
Returns the length of time an idle object can remain in the store before being cleaned.



getObjectCount
public long getObjectCount()(Code)
Returns the objects in the store



getOwningServer
protected ServerConnector getOwningServer(String objectId)(Code)
Returns the cluster server which owns the object



getPrimaryIndex
public int getPrimaryIndex(String id, int offset)(Code)
Returns the owning index.



getSaveCount
public long getSaveCount()(Code)
Returns the total objects saved.



getSaveFailCount
public long getSaveFailCount()(Code)
Returns the objects which failed to save.



getSecondaryIndex
public int getSecondaryIndex(String id, int offset)(Code)
Returns the backup index.



getSelfIndex
protected int getSelfIndex()(Code)
Returns the self servers.



getServerList
protected ServerConnector[] getServerList()(Code)
Returns the list of cluster servers.



getStore
public Store getStore(String storeId)(Code)
Creates a ClusterObjectManager. The ClusterObjectManager manages persistent objects for a particular domain, like the sesions for the /foo URL.
Parameters:
  storeId - the persistent domain.



getTertiaryIndex
public int getTertiaryIndex(String id, int offset)(Code)
Returns the backup index.



handleAlarm
public void handleAlarm(Alarm alarm)(Code)
Handles a callback from an alarm, scheduling the timeout.



init
public boolean init() throws Exception(Code)
Called after any factory settings.



isAlwaysLoad
public boolean isAlwaysLoad()(Code)
Set true if the store should always try to load the object.



isAlwaysSave
public boolean isAlwaysSave()(Code)
Set true if the store should always try to store the object.



isPrimary
protected boolean isPrimary(String id)(Code)
Returns true if this server is a primary for the given object id.



load
abstract protected boolean load(ClusterObject clusterObject, Object obj) throws Exception(Code)
Loads object access time.
Parameters:
  obj - the object to update.



remove
public void remove(ClusterObject obj) throws Exception(Code)
When the object is no longer valid, remove it from the backing store.
Parameters:
  obj - the object to remove



remove
public void remove(Store store, String objectId) throws Exception(Code)
When the object is no longer valid, remove it from the backing store.
Parameters:
  store - the identifier of the storeage group
Parameters:
  objectId - the identifier of the object to remove



removeClusterObject
ClusterObject removeClusterObject(String storeId, String id)(Code)
Returns the cluster object.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



removeStore
public Store removeStore(String storeId)(Code)
Removes a Store. The Store manages persistent objects for a particular domain, like the sesions for the /foo URL.
Parameters:
  storeId - the persistent domain.



setAlwaysLoad
public void setAlwaysLoad(boolean alwaysLoad)(Code)
Set true if the store should always try to load the object.



setAlwaysSave
public void setAlwaysSave(boolean alwaysSave)(Code)
Set true if the store should always try to store the object.



setCluster
public void setCluster(Cluster cluster)(Code)
Sets the cluster.



setExpireInterval
public void setExpireInterval(String uniqueId, long expires) throws Exception(Code)
Sets the timef for the expires interval.
Parameters:
  uniqueId - the identifier of the object. long the time in ms for the expire



setMaxIdleTime
public void setMaxIdleTime(Period maxIdleTime)(Code)
Sets the length of time an idle object can remain in the store before being cleaned.



start
public boolean start() throws Exception(Code)
Called to start the store.



store
public void store(Store store, String id, Object obj) throws IOException(Code)
Saves the object to the cluster.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



store
abstract protected void store(ClusterObject clusterObject, TempStream tempStream, long crc) throws Exception(Code)
Save the object to the store.
Parameters:
  storeId - the identifier of the storage group
Parameters:
  obj - the object to store.



toString
public String toString()(Code)



update
public void update(String storeId, String objectId) throws Exception(Code)
When the object is no longer valid, remove it from the backing store.
Parameters:
  storeId - the identifier of the storeage group
Parameters:
  objectId - the identifier of the object to remove



updateIdleCheckInterval
public void updateIdleCheckInterval(long idleCheckInterval)(Code)
Sets the idle check interval for the alarm.



updateOwner
public void updateOwner(String objectId, String uniqueId) throws Exception(Code)
Updates the owner object.
Parameters:
  uniqueId - the identifier of the storage group



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.