From: Marc P. <ma...@an...> - 2003-03-26 21:18:03
|
On Wed, 26 Mar 2003 12:57:37 -0800, Brian Goetz <br...@qu...> wrote: > Actually, it was a sequence of decision. The ones I made were > attempts to clean up the refuse of those made before me... :) > Obviously I was only partially successful. Well don't beat yourself up - I dread to think what it was like before :) [snip] > In a servlet container with multiple web apps, there WILL be multiple > sets of WM configurations, as configuration can be loaded from the web > app or from the deployment descriptor. So yes, you need to support > partitions if you want to put the WM.jar in the container-wide > classpath. OK I see that. Though I have never thought of using WM like that, since webapps came along. >> How many apps create multiple WM instances that exactly the same broker? > > Any site that deploys more than one WM-based web-app in a servlet > container. ...but only if they use a shared WM in the container /lib right? If WM's jar is in each webapp's own /lib then they will all be on separate classloaders and there will be no crosstalk between webapps and their WM settings/brokers. >> I would have made it so that everything uses its own new broker by >> default, and only uses a "shared" broker if it is explicitly passed >> to the WM constructor. i.e. >> >> Broker mySharedBroker = Broker.findBroker( mySharedKey); >> WM wm = new WM(mySharedBroker); >> >> ...rather than having using this hidden "sharing" mechanism. > > What I want is to say: > > WM wm = getWM(Servlet) > or > WM wm = getWM(config-file) > > There can be an explicit sharing mechanism if you want to roll your own, > say a WM tht gets its config from a Properties. OK. >> Hmm... how about a new ctor for WM that takes an Object that is the >> WM/broker partition "key". I think this can be done quite easily by >> passing this key to the static getBroker methods on Broker and >> ServletBroker (and 22 and 20 Broker). > > This is part of it. > >> FWIW I have always cursed the fact that WM could not init from a >> Properties object! > > Me too. You'd need an explicit naming/sharing mechanism for this. > > Here's what I want to see: > > - create an abstraction called "WMInstance". It will export some, but > not > all, of the Broker interface. - make a sharing repository that lets you > find WM instances. - make factory methods that replace the functionality > of new WM(Servlet) > and friends. > - make the new WM() constructors work with that, but mark them clearly as > convenience wrappers only. > > Then, behind the scenes, we can break up Broker. OK... I see this I think, though it sounds a lot more work than the proposal I have made to augment the current system... -- Marc Palmer |