-------- Original Message --------
Subject: Re: [Patch] #9
Date: Tue, 27 May 2003 13:38:29 -0400
From: Berin Loritsch <[EMAIL PROTECTED]>
To: Anton Tagunov <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Anton Tagunov wrote:
Hello Berin! Hello Developers!
Uff.. This patch really does several things.
1. ContextManager
1.1 m_privateSourceResolver
The sourceresolver used to grab the configuration is no longer passed to the container implementation insed the create ServiceManager.
Justification: the user should have total control on the sourceresolver that is available to his application: he should be able to create sourceresolver with only file factory, or only resouce, be able to deside which factory is the default, etc.
Implementation: the sourceresolver needed to read the configurations has been made private to ContextManager.
:/ Interestingly enough my thoughts on this was that if a container wanted to define its own SourceResolver, it would create its own to override what was passed in.
This will break some code already using Fortress that relies on the default SourceResolver set up for you. It is good enough for most folks, and the ones that need something more should override it anyway.
1.2 initializeMetaInfoManager
We have had a round of discussion on this on the list, and a series of my own patches has already been applied on this. Now I'm proposing to sort of return to the original code (it's a bit different but the spirit is exactly what it was.)
Justification: we have desided on the list that child containers should have access to the parent's MetaInfoManager. It is more convinient to achieve this if the MetaInfoManager is created in ContextManager not in AbstractContianer (less code, more efficient code). Moreover, it is good practice if the Container does not manage itself but gets all it needs (including MetaInfoManager) from outside.
Nevertheless our patching round has not been useless: we have sharpened the contract of providing MetaInfoManager for the container and we have shaken out some inefficiency from the code (creating ServiceMetaManager twice). I believe in general the code has become simpler.
Implementation: as we desided that RoleManager is a going-away concept, even if the user has supplied a RoleManager or a roles file we do not expose them to the container implementation -- RoleManager is never visible via m_childContext.
:) I guess I'm smarter than I thought. Although, humility just went out the window with that comment ;P
1.4 InitializeInstrumentManager
I propose with this patch to create a NoopInstrumentManager if the user has supplied no DefaultInstrumentConfiguration.
Justification: it looks like if we have specified no port numbers to listen on (the case when there is no configuration) the DefaultInstrumentManager does nothing usefull.
Moreover, I beleive that this is a security issue: in fact, we should not listen on any ports unless explicitly ordered too.
Ok.
1.5 FortressRoleManager
As patch #8 has not been approved yet, ContextManager is still creating FortressRoleManager, but as soon as we have Fortress Meta Descriptors in datasource, xmlutil and monitor (Patch #8) it will be the right time to finally decomission FortressRoleManager :-)
We also need to re-release those components that are set to use it. The whole Patch #8 is IMO a stepping stone until we decouple the tools JAR from Fortress.
2. AbstractContainer
I propose to remove the code that creates the default MetaInfoManager from this class completely. This makes the MetaInfoManager a required dependecy that the invoker should provide.
Agreed.
3. Removal of Context/ServiceManager overlap
This probably the steepest part of the patch. However I would like you very much to really look into it :-)
I have found that
* LoggerManager
* PoolManager
* InstrumentManager
* MetaInfoManager
* LifecycleExtensionsManager
* Queue
are passed to the Container twice by the current DefaultContainerManager:
* as entries in the Context passed to the Container via contextualize() * as components passed to the Container via service()
In general unnecessary duplication is not a desired thing, for example we change one copy and not the other - and voi'la - a change for a bug to slip in ( for instance if our users start creating nesting containers overriding the passed-in values )
This duplication originated from having them *originally* passed in as context entries. Later, after looking at what these things really were, we determined that we were using a Context to access services. We should go the other way and make them only available via the service mechanism.
If we agree on eliminating this duplication we have two alternatives: * pass these objects via contextualize() only * or pass them via service() only
I propose the following ground for making this desing decision
* ServiceManager's user contract is that
ater we have .lookup()-ed something from it we shoud release() it
this is because we do not know if we're going to get ThreadSafe object, or a new one is going to be created each time for us, or it is going to be gaken out of a pool
This is the way we should go.
<snip type="patch content"/>
-- "You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, The Swiss hold the America's Cup, France is accusing the US of arrogance, and Germany doesn't want to go to war. And the 3 most powerful men in America are named 'Bush', 'Dick', and 'Colon' (sic)".
-----Chris Rock
-- "You know the world is going crazy when the best rapper is a white guy, the best golfer is a black guy, The Swiss hold the America's Cup, France is accusing the US of arrogance, and Germany doesn't want to go to war. And the 3 most powerful men in America are named 'Bush', 'Dick', and 'Colon' (sic)".
-----Chris Rock
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
