On Tue, 2003-01-21 at 12:28, Stephen McConnell wrote: > > > >Any sample code for running Merlin in Tomcat? > > > > Give me a couple of weeks - and yes. There is some refactoring I need > to take care of after which I will be able to provide some running > demonstrations. In the meantime you may want to take a look though the > following: > > http://www.osm.net/doc/gateway/
Cool, I was going to ask how you are embedding Tomcat. I'll look it over. Is the source code available? > There are several scenarios I've been dealing with: > > 1. componet has a depedency on a web-server - wants to register a > presentation app > 2. web application needs merlin to get component services to do its stuff > > The two are very differnet - in the first case I've been playing around > with meta attributes that describe presention policy but with mixed > success. In the second case - no problem. The second is the one that I am looking at right now. The basic layout of what I'm looking at is to have the servlet create the container. The container will create a ServiceSelector which will contain what I'm calling RequestHandlers. These are dependent on other services (for instance, a Authenticator and Authorizor, some kind of DAO(s), an order processor, etc). The servlet itself only needs access to the ServiceSelector for RequestHandlers, everything else is used by those handlers. That's one reason it would be nice to use the full blown Merlin is because there could be any number of handlers. So, the automagic abilities of Merlin could come in handy. Initially, the servlet and the services will all be on the same machine. If the load gets to high on that box, though all we do is replace the service implementations in the Merlin block configuration file with proxy implementations that communicate with the actual work components on another box (or a collection of boxes). I think embedding Merlin would make this change over extremely simple because other than creating the proxies and changing the Merlin block configuration no other code needs to be changed. Now comes the twist. The other part of the app is a SOAP interface. I'll be using the Axis servlet for that. Right now I'm not sure of how I'm going to integrate things together. I was thinking that since tomcat can run in merlin I could do that and have a Deployer service that would deploy the servlet and the web service at startup. The only question then is whether to have the Merlin embedded in the servlet create the actual work components and then web service use proxies to access them or if the top level Merlin container should create them. Then the servlet and soap service would have proxies that connect to the local instances. That way they are all still running in the same runtime so even having to do "remote" connections shouldn't be to much overhead. I guess it depends on the state of local optimizations with AltRMI. Something I have to ask Paul about. If it's not too much overhead I would rather the latter case. Then the web service would have an embedded merlin to automagically create the proxies for the services it needs and the servlet would do the same and neither would have to worry about the actual work components. Anyways, that's my complete scenario. In the end I could wind up using a mix of both of your scenarios above. > Ok - you not registering the protocol handler. > > > > >Any ideas what's causing this? > > > > The DefaultRegistry constructor handles the establishment of the > protocol handler. Seems to me like you not supply a registry which is > used when aggregating services available in a block. Anyway - you will > find the code for handler registration in the DefaultRegistry > constructor - in the meantime - a confession - theis are of > bootstrapping is probably the worst documented. Also I want to get in > test cases for embeeded loading - ... zutt - so much to do - so little time! > > :-) > Hmm... I thought the bootstrap code would take care of that stuff. I'll try and take a bit deeper of a look myself. > Give me a couple of weeks and I'll have a working demo in place. > Not sure where I'll put it - but I'll make sure something is available > either here at Avalon or over on osm.net. Looking forward to it. =) P.S. I just wanted to let you know that there seems to be a missing source file in the avalon-sandbox/merlin cvs repository. It's the src/java/org/apache/avalon/merlin/block/Library.java interface. I created one of my own locally from how it appeared to be used, but a clean checkout doesn't build because of it. -- Richard Wallace AIM, Inc. (www.a--i--m.com) Information Systems Consultants "Providing New Technology, the Old-Fashioned Way" -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>