org.apache.avalon.cornerstone.blocks.masterstore
Class RepositoryManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager
All Implemented Interfaces:
Configurable, Contextualizable, LogEnabled, Serviceable, ServiceSelector, Store

public class RepositoryManager
extends AbstractLogEnabled
implements Store, Contextualizable, Serviceable, Configurable

Author:
Federico Barbieri
Component:
name="repository-manager" lifestyle="singleton"
Service Export:
type="org.apache.avalon.cornerstone.services.store.Store"

Field Summary
protected  HashMap m_classes
           
protected  Context m_context
           
protected  HashMap m_models
           
protected  HashMap m_repositories
           
protected  ServiceManager m_serviceManager
           
 
Fields inherited from interface org.apache.avalon.cornerstone.services.store.Store
ROLE
 
Constructor Summary
RepositoryManager()
           
 
Method Summary
 void configure(Configuration configuration)
           
 void contextualize(Context context)
           
static String getName()
           
 boolean isSelectable(Object policy)
           
 void registerRepository(Configuration repConf)
           
 void release(Object service)
           
 Object select(Object policy)
          Selects a Repository configured for the given policy.
 void service(ServiceManager serviceManager)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_repositories

protected HashMap m_repositories

m_models

protected HashMap m_models

m_classes

protected HashMap m_classes

m_serviceManager

protected ServiceManager m_serviceManager

m_context

protected Context m_context
Constructor Detail

RepositoryManager

public RepositoryManager()
Method Detail

contextualize

public void contextualize(Context context)
Specified by:
contextualize in interface Contextualizable
Context Entry:
key="urn:avalon:name" alias="block.name", key="urn:avalon:partition" alias="app.name", key="urn:avalon:home" type="java.io.File" alias="app.home"

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Specified by:
configure in interface Configurable
Throws:
ConfigurationException

registerRepository

public void registerRepository(Configuration repConf)
                        throws ConfigurationException
Throws:
ConfigurationException

release

public void release(Object service)
Specified by:
release in interface ServiceSelector

isSelectable

public boolean isSelectable(Object policy)
Specified by:
isSelectable in interface ServiceSelector

select

public Object select(Object policy)
              throws ServiceException
Description copied from interface: Store
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 Store
Parameters:
policy - a Configuration object identifying the sought Repository
Returns:
requested Repository
Throws:
ServiceException - if no repository matches policy

getName

public static final String getName()


Copyright © Apache Software Foundation. All Rights Reserved.