Diogo Saad wrote:
Hi Siegfried..
My name is Diogo and I'm trying to use YAAFI as my container.
There is a sample in "How To" page that is:
Logger logger = new Log4JLogger(
org.apache.log4j.Logger.getLogger("YAAFI");
ServiceContainer container = null;
ServiceContainerConfiguration config = new
ServiceContainerConfiguration();
config.setLogger( logger );
config.setComponentRolesLocation( "./src/test/TestRoleConfig.xml" );
config.setComponentConfigurationLocation(
"./src/test/TestComponentConfig.xml" );
config.setParametersLocation( "./src/test/TestParameters.properties"
);
container = ServiceContainerFactory.create( config );
I guess this code is not in sync with the jar available for download
ause I could not find the ServiceContainerFactory class in the jar.
you are right ... the documentation is newer than the JARs from
http://jakarta.apache.org/turbine/repo/ ... :-(
I upload the JARs to the repo and write another mail when I'm done with it
I found another class which I understood is similar to it,
ServiceManagerFactory. Both should create a ServiceContainer instance,
am I right??
ServiceContainerFactory is the one to use - then name
"ServiceManagerFactory" was sort of misleading and was therefore renamed
to ServiceContainerFactory .
I got another doubt, serviceContainer.initialize() is the same of
ContainerUtil.initialize(serviceContainer) ??
Well, ContainerUtil.initialize(serviceContainer) is a helper class from
the avalon-framework and calls in turn serviceContainer.initialize().
But the preferred way to get an instance of YAAFI is using
ServiceContainerFactory since I encapsulate a lot of low level coding.
Thanks in advance..
Diogo Saad