Methods Summary |
---|
public void | configure(org.apache.avalon.framework.configuration.Configuration configuration)
this.configuration = configuration;
|
public void | contextualize(org.apache.avalon.framework.context.Context context)
this.context = context;
|
public org.apache.james.services.UsersRepository | getRepository(java.lang.String name)Get the repository, if any, whose name corresponds to
the argument parameter
UsersRepository response = (UsersRepository) repositories.get(name);
if ((response == null) && (getLogger().isWarnEnabled())) {
getLogger().warn("No users repository called: " + name);
}
return response;
|
public java.util.Iterator | getRepositoryNames()Yield an Iterator over the set of repository
names managed internally by this store.
return this.repositories.keySet().iterator();
|
public void | initialize()
getLogger().info("AvalonUsersStore init...");
repositories = new HashMap();
Configuration[] repConfs = configuration.getChildren("repository");
ClassLoader theClassLoader = null;
for ( int i = 0; i < repConfs.length; i++ )
{
Configuration repConf = repConfs[i];
String repName = repConf.getAttribute("name");
String repClass = repConf.getAttribute("class");
if (getLogger().isDebugEnabled()) {
getLogger().debug("Starting " + repClass);
}
if (theClassLoader == null) {
theClassLoader = this.getClass().getClassLoader();
}
UsersRepository rep = (UsersRepository) theClassLoader.loadClass(repClass).newInstance();
setupLogger(rep);
ContainerUtil.contextualize(rep,context);
ContainerUtil.service(rep,manager);
if (rep instanceof Composable) {
final String error = "no implementation in place to support Composable";
getLogger().error( error );
throw new IllegalArgumentException( error );
}
ContainerUtil.configure(rep,repConf);
ContainerUtil.initialize(rep);
repositories.put(repName, rep);
if (getLogger().isInfoEnabled()) {
StringBuffer logBuffer =
new StringBuffer(64)
.append("UsersRepository ")
.append(repName)
.append(" started.");
getLogger().info(logBuffer.toString());
}
}
getLogger().info("AvalonUsersStore ...init");
|
public void | service(org.apache.avalon.framework.service.ServiceManager manager)
this.manager = manager;
|