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

All Superinterfaces:
org.apache.avalon.framework.service.ServiceSelector

public interface Store
extends org.apache.avalon.framework.service.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

static final java.lang.String ROLE
Method Detail

select

java.lang.Object select(java.lang.Object policy)
                        throws org.apache.avalon.framework.service.ServiceException
Selects a Repository configured for the given policy. The policy must be an instance of org.apache.avalon.framework.configuration.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 org.apache.avalon.framework.service.ServiceSelector
Parameters:
policy - a org.apache.avalon.framework.configuration.Configuration object identifying the sought Repository
Returns:
requested Repository
Throws:
org.apache.avalon.framework.service.ServiceException - if no repository matches policy


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.