02/28/2005
 

com.vignette.portal.cache
Interface CacheFactory


public interface CacheFactory

Creates and looks up Cache instances. Obtain an instance via your context, using CacheFactory.CONTEXT_URI for a lookup key.

E.g.,

      PortalInitialContext context = new PortalInitialContext();
      CacheFactory factory = (CacheFactory) context.lookup(CacheFactory.CONTEXT_URI);
  


Field Summary
static String CONTEXT_URI
          Key to lookup global instance within context.
 
Method Summary
 BroadcastingStrategy createBroadcastingStrategy()
          Creates a new BroadcastingStrategy that is appropriate for this factory's context.
 Cache createCache(String name, List strategies)
          Creates a new Cache within the scope of this factory.
 Cache createCache(String name, List strategies, CacheDataSource dataSource)
          Creates a new Cache within the scope of this factory.
 Cache getCache(String name)
          Looks for a matching Cache within the scope of this factory.
 

Field Detail

CONTEXT_URI

public static final String CONTEXT_URI
Key to lookup global instance within context.
Method Detail

createCache

public Cache createCache(String name,
                         List strategies)
                  throws CacheException
Creates a new Cache within the scope of this factory. The new cache is not connected to any data source, except maybe via one of the strategies passed in.
Parameters:
name - Name of the new Cache object. Must be unique within this factory.
strategies - CacheStrategy instances for use by the new Cache object. None of the them can use used by anotherCache object.
Returns:
the newly created Cache object.

createCache

public Cache createCache(String name,
                         List strategies,
                         CacheDataSource dataSource)
                  throws CacheException
Creates a new Cache within the scope of this factory. The new cache is not connected to any data source, except maybe via one of the strategies passed in.
Parameters:
name - Name of the new Cache object. Must be unique within this factory.
strategies - CacheStrategy instances for use by the new Cache object. None of the them can use used by anotherCache object.
dataSource - CacheDataSource to connect the new Cache to a data source. Can be null, in which case the new Cache is not connected to any data source.
Returns:
the newly created Cache object.

createBroadcastingStrategy

public BroadcastingStrategy createBroadcastingStrategy()
                                                throws CacheException
Creates a new BroadcastingStrategy that is appropriate for this factory's context. This new strategy can then be passed to the createCache methods for use by a Cache object.
Returns:
the newly created BroadcastingStrategy

getCache

public Cache getCache(String name)
               throws CacheException
Looks for a matching Cache within the scope of this factory. Throws an exception if if cannot find any.
Parameters:
name - Name of the desired Cache object.
Returns:
the matching Cache object.

02/28/2005
 

Copyright and Trademark Notices