Java Doc for CacheFactoryStrategy.java in  » Net » openfire » org » jivesoftware » util » cache » 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 » Net » openfire » org.jivesoftware.util.cache 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.jivesoftware.util.cache.CacheFactoryStrategy

All known Subclasses:   org.jivesoftware.util.cache.DefaultLocalCacheStrategy,
CacheFactoryStrategy
public interface CacheFactoryStrategy (Code)
Implementation of CacheFactory that relies on the specific clustering solution.
author:
   Gaston Dombiak




Method Summary
 CachecreateCache(String name)
     Creates a new cache for the cache name specified.
 voiddestroyCache(Cache cache)
     Destroys the supplied cache.
 voiddoClusterTask(ClusterTask task)
     Invokes a task on other cluster members in an asynchronous fashion.
 booleandoClusterTask(ClusterTask task, byte[] nodeID)
     Invokes a task on other the specified cluster member in an asynchronous fashion.
 Collection<Object>doSynchronousClusterTask(ClusterTask task, boolean includeLocalMember)
     Invokes a task on other cluster members synchronously and returns the result as a Collection (method will not return until the task has been executed on each cluster member). The task will not be executed on the local cluster member.
 ObjectdoSynchronousClusterTask(ClusterTask task, byte[] nodeID)
     Invokes a task on a given cluster member synchronously and returns the result of the remote operation.
 byte[]getClusterMemberID()
     Returns a byte[] that uniquely identifies this member within the cluster or null when not in a cluster.
 Collection<ClusterNodeInfo>getClusterNodesInfo()
     Returns basic information about the current members of the cluster or an empty collection if not running in a cluster.
 intgetMaxClusterNodes()
     Returns the maximum number of cluster members allowed.
 byte[]getSeniorClusterMemberID()
     Returns a byte[] that uniquely identifies this senior cluster member or null when not in a cluster.
 booleanisSeniorClusterMember()
     Returns true if this node is the maste node of the cluster.
 voidlockKey(Object key, long timeout)
     Locks the specified key in the locking map.
 booleanstartCluster()
     Returns true if the cluster has been started.
 voidstopCluster()
     Stops the cluster.
 voidunlockKey(Object key)
     Unlocks the specified key in the locking map.
 voidupdateCacheStats(Map<String, Cache> caches)
     Updates the statistics of the specified caches and publishes them into a cache for statistics.



Method Detail
createCache
Cache createCache(String name)(Code)
Creates a new cache for the cache name specified. The created cache is already configured. Different implementations could store the cache configuration in different ways. It is recommended to store the cache configuration in an external file so it is easier for customers to change the default configuration.
Parameters:
  name - name of the cache to create. newly created and configured cache.



destroyCache
void destroyCache(Cache cache)(Code)
Destroys the supplied cache.
Parameters:
  cache - the cache to destroy.



doClusterTask
void doClusterTask(ClusterTask task)(Code)
Invokes a task on other cluster members in an asynchronous fashion. The task will not be executed on the local cluster member. If clustering is not enabled, this method will do nothing.
Parameters:
  task - the task to be invoked on all other cluster members.



doClusterTask
boolean doClusterTask(ClusterTask task, byte[] nodeID)(Code)
Invokes a task on other the specified cluster member in an asynchronous fashion. If clustering is not enabled, this method will do nothing.
Parameters:
  task - the task to be invoked on the specified cluster member.
Parameters:
  nodeID - the byte array that identifies the target cluster member. false if not in a cluster or specified cluster node was not found.



doSynchronousClusterTask
Collection<Object> doSynchronousClusterTask(ClusterTask task, boolean includeLocalMember)(Code)
Invokes a task on other cluster members synchronously and returns the result as a Collection (method will not return until the task has been executed on each cluster member). The task will not be executed on the local cluster member. If clustering is not enabled, this method will return an empty collection.
Parameters:
  task - the ClusterTask object to be invoked on all other cluster members.
Parameters:
  includeLocalMember - true to run the task on the local member, false otherwise collection with the result of the execution.



doSynchronousClusterTask
Object doSynchronousClusterTask(ClusterTask task, byte[] nodeID)(Code)
Invokes a task on a given cluster member synchronously and returns the result of the remote operation. If clustering is not enabled, this method will return null.
Parameters:
  task - the ClusterTask object to be invoked on a given cluster member.
Parameters:
  nodeID - the byte array that identifies the target cluster member. result of remote operation or null if operation failed or operation returned null.
throws:
  IllegalStateException - if requested node was not found.



getClusterMemberID
byte[] getClusterMemberID()(Code)
Returns a byte[] that uniquely identifies this member within the cluster or null when not in a cluster. a byte[] that uniquely identifies this member within the cluster or null when not in a cluster.



getClusterNodesInfo
Collection<ClusterNodeInfo> getClusterNodesInfo()(Code)
Returns basic information about the current members of the cluster or an empty collection if not running in a cluster. information about the current members of the cluster or an emptycollection if not running in a cluster.



getMaxClusterNodes
int getMaxClusterNodes()(Code)
Returns the maximum number of cluster members allowed. A value of 0 will be returned when clustering is not allowed. the maximum number of cluster members allowed or 0 if clustering is not allowed.



getSeniorClusterMemberID
byte[] getSeniorClusterMemberID()(Code)
Returns a byte[] that uniquely identifies this senior cluster member or null when not in a cluster. a byte[] that uniquely identifies this senior cluster member or null when not in a cluster.



isSeniorClusterMember
boolean isSeniorClusterMember()(Code)
Returns true if this node is the maste node of the cluster. When not running in cluster mode a value of true should be returned. true if this node is the maste node of the cluster.



lockKey
void lockKey(Object key, long timeout)(Code)
Locks the specified key in the locking map. The map should be clusterable thus locking a key is visible to the cluster. When not in cluster mode the lock is only visible to this JVM.
Parameters:
  key - the key to lock.
Parameters:
  timeout - number of milliseconds to wait to obtain the lock. -1 means wait forever.



startCluster
boolean startCluster()(Code)
Returns true if the cluster has been started. When running in local mode a true value should be returned.

An error should be logged when the cluster fails to be started. true if the cluster has been started.




stopCluster
void stopCluster()(Code)
Stops the cluster. When not running in a cluster this request will be ignored.



unlockKey
void unlockKey(Object key)(Code)
Unlocks the specified key in the locking map. The map should be clusterable thus locking a key is visible to the cluster. When not in cluster mode the lock is only visible to this JVM.
Parameters:
  key - the key to unlock.



updateCacheStats
void updateCacheStats(Map<String, Cache> caches)(Code)
Updates the statistics of the specified caches and publishes them into a cache for statistics. The statistics cache is already known to the application but this could change in the future (?). When not in cluster mode then do nothing.

The statistics cache must contain a long array of 5 positions for each cache with the following content:

  1. cache.getCacheSize()
  2. cache.getMaxCacheSize()
  3. cache.size()
  4. cache.getCacheHits()
  5. cache.getCacheMisses()

Parameters:
  caches - caches to get their stats and publish them in a statistics cache.



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