But, figuring out some problems with the interfaces, they need to be more specialized, definindo a cascade of "roles" on system.
package org.nanotek.lucene;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
public class LuceneIndexService implements IndexService , ApplicationContextAware{
private ApplicationContext ctx;
private String contextServiceRef = "luceneIndexService";
public LuceneIndexService() {
}
public LuceneIndexService(String contextServiceRef) {
this.contextServiceRef = contextServiceRef;
}
@Override
public IndexService getIndexService() {
IndexService ref;
assert (ctx !=null);
ref = (IndexService) ctx.getBean(contextServiceRef);
return ref;
}
@Override
public void setApplicationContext(ApplicationContext arg0)
throws BeansException {
this.ctx = arg0;
}
}