org.apache.avalon.cornerstone.services.store
Interface Store

All Superinterfaces:
ServiceSelector
All Known Implementing Classes:
RepositoryManager

public interface Store
extends ServiceSelector

Allows selection from a number of configured Repositories. Selection criterion is passed in as a Configuration object.

Author:
Federico Barbieri
See Also:
Repository, ObjectRepository, StreamRepository

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 java.lang.Object select(java.lang.Object policy)
          Selects a Repository configured for the given policy.
 
Methods inherited from interface org.apache.avalon.framework.service.ServiceSelector
isSelectable, release
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

select

public java.lang.Object select(java.lang.Object policy)
                        throws ServiceException
Selects a Repository configured for the given policy. The policy must be an instance of Configuration. The following attributes are used by the Store and thus are mandatory in the policy parameter:
 <repository destinationURL="[URL of this repository]"
             type="[repository type e.g. OBJECT, STREAM or MAIL]"
             model="[repository model e.g. PERSISTENT, CACHE]">
   [additional configuration]
 </repository>
 

The policy is used both to select the appropriate Repository and to configure it.

Specified by:
select in interface ServiceSelector
Parameters:
policy - a Configuration object identifying the sought Repository
Returns:
requested Repository
Throws:
ServiceException - if no repository matches policy


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.