KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > invalidation > InvalidationBridgeListener


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.cache.invalidation;
23
24 import java.io.Serializable JavaDoc;
25
26 /**
27  * InvalidationManager (IM) represents locally managed caches and invaliders. To be able
28  * to do distributed invalidations, it is necessary to bridge these IM to forward
29  * cache invalidation messages.
30  * The InvalidationBridgeListener provides the way for any transport mechanism to
31  * be used to forward cache invalidation messages accross a network/cluster.
32  * @see InvalidationManagerMBean
33  * @author <a HREF="mailto:sacha.labourey@cogito-info.ch">Sacha Labourey</a>.
34  * @version $Revision: 37459 $
35  *
36  * <p><b>Revisions:</b>
37  *
38  * <p><b>24 septembre 2002 Sacha Labourey:</b>
39  * <ul>
40  * <li> First implementation </li>
41  * </ul>
42  */

43
44 public interface InvalidationBridgeListener
45 {
46    /**
47     * Called when a set of invalidations, concerning more than one IG, should be forwarded
48     * accross the bridge.
49     * It is the bridge responsability to determine:
50     * - which IG must be bridged (some IG may not exist on other nodes, in this case
51     * the bridge may decide to drop these invalidations messages to reduce the
52     * serialization cost and network usage)
53     * - to which other nodes the invalidations must be communicated. This can be done
54     * by any mean (automatic discovery, configuration file, etc.)
55     * @param invalidations BatchInvalidation messages containing invalidations
56     * @param asynchronous Determine the best-effort indication to be used to communicate invalidations
57     */

58    public void batchInvalidate (BatchInvalidation[] invalidations, boolean asynchronous);
59    
60    /**
61     * Called when a single invalidation, concerning a single IG, should be forwarded
62     * accross the bridge.
63     * It is the bridge responsability to determine:
64     * - which IG must be bridged (some IG may not exist on other nodes, in this case
65     * the bridge may decide to drop these invalidations messages to reduce the
66     * serialization cost and network usage)
67     * - to which other nodes the invalidations must be communicated. This can be done
68     * by any mean (automatic discovery, configuration file, etc.)
69     * @param invalidationGroupName InvalidationGroup name
70     * @param key Key to be invalidated
71     * @param asynchronous Best effort communication setting
72     */

73    public void invalidate (String JavaDoc invalidationGroupName, Serializable JavaDoc key, boolean asynchronous);
74    
75    /** Called when a set of invalidations, concerning a single IG, should be forwarded
76     * accross the bridge.
77     * It is the bridge responsability to determine:
78     * - which IG must be bridged (some IG may not exist on other nodes, in this case
79     * the bridge may decide to drop these invalidations messages to reduce the
80     * serialization cost and network usage)
81     * - to which other nodes the invalidations must be communicated. This can be done
82     * by any mean (automatic discovery, configuration file, etc.)
83     * @param invalidationGroupName Name of the InvalidationGroup to which is linked the invalidation message
84     * @param keys Keys to be invalidated
85     * @param asynchronous Best effort communication setting
86     */

87    public void invalidate (String JavaDoc invalidationGroupName, Serializable JavaDoc[] keys, boolean asynchronous);
88
89    /**
90     * Issues invalidate all event to other nodes.
91     * @param groupName group's name
92     * @param asynchronous mode
93     */

94    public void invalidateAll(String JavaDoc groupName, boolean asynchronous);
95    
96    /**
97     * Called when an InvocationGroup is dropped (because no cache and invalider are
98     * using it anymore).
99     * For bridge implementations that automatically discover which IG should be
100     * bridged, this callback can be used to communicate to the other nodes that this
101     * node is no more interested in invalidation for this group.
102     * @param groupInvalidationName Name of the InvalidationGroup being dropped
103     */

104    public void groupIsDropped (String JavaDoc groupInvalidationName);
105    
106    /**
107     * Called when an InvocationGroup is created.
108     * For bridge implementations that automatically discover which IG should be
109     * bridged, this callback can be used to communicate to the other nodes that this
110     * node is now interested in invalidation for this group.
111     * @param groupInvalidationName Name of the InvalidationGroup just being created
112     */

113    public void newGroupCreated (String JavaDoc groupInvalidationName);
114    
115 }
116
Popular Tags