public class MyContainer extends DefaultContainer {
protected org.apache.avalon.framework.context.Context provideComponentContext(org.apache.avalon.framework.context.Context parent)
throws Exception
{
return wantedConext; }
}
the problem is, I have the wantedContext object in a class that has the container like this
class BootStrapClass
{public static void main(String[] args)
{ Context wantedContext;
Configuration sysConfig = builder.build("system.xconf");
fConfig.setContainerConfiguration(sysConfig);
Configuration roleConfig = builder.build("report.roles");
fConfig.setRoleManagerConfiguration(roleConfig);
//this is our own container
fConfig.setContainerClass("MyContainer"); ContainerManager cm = new
DefaultContainerManager(fConfig.getContext());
ContainerUtil.initialize( cm );
container = (DefaultContainer)cm.getContainer();
rmanager = container.getServiceManager();} }
Before ContainerUtil.initialize( cm ), you get a null object using container = (DefaultContainer)cm.getContainer(); and after it, the m_componentContext has been set to all the service implementations contained in the container, so I guess the only way is to provide the "wantedContext" to MyContainer in class BootStrapClass, but how? since we use FortressConfig.setContainerClass(String) method, there isnt then a MyContainer object.
Anyone can help me?
Thanks Mike
_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
