Saturday, September 28, 2013

DUDU.... - The Monkey Business of Pure Altruism

Eh um figura. Quanto mais reza "mais assombração" aparece, du dudu e edu... Sei de dois que podem estar ricos, um com certeza, o outro "talvez" nao vi desenrolar da estoria dele. Mas eu sei que os dois querem que eu "vah tomah no cuh", continuam uns judeus mão de vaca.

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;
}

}