Source Code Cross Referenced for CacheManagerEventListener.java in  » Cache » ehcache » net » sf » ehcache » event » 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
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Cache » ehcache » net.sf.ehcache.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Copyright 2003-2007 Luck Consulting Pty Ltd
003:         *
004:         *  Licensed under the Apache License, Version 2.0 (the "License");
005:         *  you may not use this file except in compliance with the License.
006:         *  You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         *  Unless required by applicable law or agreed to in writing, software
011:         *  distributed under the License is distributed on an "AS IS" BASIS,
012:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         *  See the License for the specific language governing permissions and
014:         *  limitations under the License.
015:         */package net.sf.ehcache.event;
016:
017:        import net.sf.ehcache.CacheException;
018:        import net.sf.ehcache.Status;
019:
020:        /**
021:         * Allows implementers to register callback methods that will be executed when a
022:         * <code>CacheManager</code> event occurs.
023:         *
024:         * The lifecycle events are:
025:         * <ol>
026:         * <li>init
027:         * <li>dispose
028:         * </ol>
029:         *
030:         *
031:         * CacheManager change events are:
032:         * <ol>
033:         * <li>adding a <code>Cache</code>
034:         * <li>removing a <code>Cache</code>
035:         * </ol>
036:         *
037:         * Note that the caches that are part of the initial configuration are not considered "changes".
038:         * It is only caches added or removed beyond the initial config.
039:         *
040:         * Callbacks to these methods are synchronous and unsynchronized. It is the responsibility of
041:         * the implementer to safely handle the potential performance and thread safety issues
042:         * depending on what their listener is doing.
043:         * @author Greg Luck
044:         * @version $Id: CacheManagerEventListener.java 519 2007-07-27 07:11:45Z gregluck $
045:         * @since 1.2
046:         * @see CacheEventListener
047:         */
048:        public interface CacheManagerEventListener {
049:
050:            /**
051:             * Call to start the listeners and do any other required initialisation.
052:             * init should also handle any work to do with the caches that are part of the initial configuration.
053:             * @throws CacheException - all exceptions are wrapped in CacheException
054:             */
055:            void init() throws CacheException;
056:
057:            /**
058:             * Returns the listener status.
059:             * @return the status at the point in time the method is called
060:             */
061:            Status getStatus();
062:
063:            /**
064:             * Stop the listener and free any resources.
065:             * @throws CacheException - all exceptions are wrapped in CacheException
066:             */
067:            void dispose() throws CacheException;
068:
069:            /**
070:             * Called immediately after a cache has been added and activated.
071:             * <p/>
072:             * Note that the CacheManager calls this method from a synchronized method. Any attempt to
073:             * call a synchronized method on CacheManager from this method will cause a deadlock.
074:             * <p/>
075:             * Note that activation will also cause a CacheEventListener status change notification
076:             * from {@link net.sf.ehcache.Status#STATUS_UNINITIALISED} to
077:             * {@link net.sf.ehcache.Status#STATUS_ALIVE}. Care should be taken on processing that
078:             * notification because:
079:             * <ul>
080:             * <li>the cache will not yet be accessible from the CacheManager.
081:             * <li>the addCaches methods which cause this notification are synchronized on the
082:             * CacheManager. An attempt to call {@link net.sf.ehcache.CacheManager#getEhcache(String)}
083:             * will cause a deadlock.
084:             * </ul>
085:             * The calling method will block until this method returns.
086:             * <p/>
087:             * @param cacheName the name of the <code>Cache</code> the operation relates to
088:             * @see CacheEventListener
089:             */
090:            void notifyCacheAdded(String cacheName);
091:
092:            /**
093:             * Called immediately after a cache has been disposed and removed. The calling method will
094:             * block until this method returns.
095:             * <p/>
096:             * Note that the CacheManager calls this method from a synchronized method. Any attempt to
097:             * call a synchronized method on CacheManager from this method will cause a deadlock.
098:             * <p/>
099:             * Note that a {@link CacheEventListener} status changed will also be triggered. Any
100:             * attempt from that notification to access CacheManager will also result in a deadlock.
101:             * @param cacheName the name of the <code>Cache</code> the operation relates to
102:             */
103:            void notifyCacheRemoved(String cacheName);
104:
105:        }
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.