KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > core > ICache


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.core;
12
13 /**
14  * A cache that is associated with a synchronization that allows clients
15  * to cache synchronization state related to their model for the duration of the
16  * operation. When the context is disposed, the cache will be disposed and any
17  * listeners notified.
18  * <p>
19  * This interface is not intended to be implemented by clients.
20  *
21  * @since 3.2
22  */

23 public interface ICache {
24
25     /**
26      * Cache the given object with this context.
27      * @param name the name that uniquely identifies the object
28      * @param value the value to be cached.
29      */

30     void put(String JavaDoc name, Object JavaDoc value);
31     
32     /**
33      * Retrieve an object that has been cached with the context
34      * @param name the name of the object
35      * @return the object associated with the name or <code>null</code>
36      */

37     Object JavaDoc get(String JavaDoc name);
38     
39     /**
40      * Remove the named object from the cache
41      * @param name the name
42      */

43     void remove(String JavaDoc name);
44     
45     /**
46      * Add a listener to the cache that will receive notification
47      * when the cache is disposed. Adding a listener that has already
48      * been added has no effect.
49      * @param listener the listener to add
50      */

51     void addCacheListener(ICacheListener listener);
52     
53     /**
54      * Remove the listener. Removing a listener that is not registered
55      * has no effect.
56      * @param listener the listener to remove
57      * @since 3.3
58      */

59     void removeCacheListener(ICacheListener listener);
60     
61     /**
62      * Remove the listener. Removing a listener that is not registered
63      * has no effect.
64      * @param listener the listener to remove
65      * @deprecated use {@link #removeCacheListener(ICacheListener)}
66      */

67     void removeDisposeListener(ICacheListener listener);
68     
69 }
70
Popular Tags