Eclipse Platform
Release 3.2

org.eclipse.team.core
Interface ICache


public interface ICache

A cache that is associated with a synchronization that allows clients to cache synchronization state related to their model for the duration of the operation. When the context is disposed, the cache will be disposed and any listeners notified.

This interface is not intended to be implemented by clients.

Since:
3.2

Method Summary
 void addCacheListener(ICacheListener listener)
          Add a listener to the cache that will receive notification when the cache is disposed.
 Object get(String name)
          Retrieve an object that has been cached with the context
 void put(String name, Object value)
          Cache the given object with this context.
 void remove(String name)
          Remove the named object from the cache
 void removeDisposeListener(ICacheListener listener)
          Remove the listener.
 

Method Detail

put

public void put(String name,
                Object value)
Cache the given object with this context.

Parameters:
name - the name that uniquely identifies the object
value - the value to be cached.

get

public Object get(String name)
Retrieve an object that has been cached with the context

Parameters:
name - the name of the object
Returns:
the object associated with the name or null

remove

public void remove(String name)
Remove the named object from the cache

Parameters:
name - the name

addCacheListener

public void addCacheListener(ICacheListener listener)
Add a listener to the cache that will receive notification when the cache is disposed. Adding a listener that has already been added has no effect.

Parameters:
listener - the listener to add

removeDisposeListener

public void removeDisposeListener(ICacheListener listener)
Remove the listener. Removing a listener that is not registered has no effect.

Parameters:
listener - the listener to remove

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.