long but interesting information, thanks again. > >* How/When custom container could acquire reference to ready to use > >sub-component ? > > > > This is definitely in the area of a custom appliance. The appliance > code handles all of the things to do with dependency establishment > (assembly) - and the Block class (a specialization of Appliance) exists > to handle virtual services (i.e. turning a container into a component). > > Can you tell me some more about what your ultimate aim is - because in > principal you should not need to extend Appliance or Block unless your > getting in real deep (in fact an overarching objective within Merlin is > to provide sufficient parameterization points such that actual usage of > the API should not been needed except in really special cases).
Like I wrote in previous mail : http://marc.theaimsgroup.com/?l=avalon-users&m=105061293530441&w=2 I currently work on a little eai. Design concept are based on SEDA and Pipeline (ala Cocoon) approach : * Structure ** Have a config file that define the services and the graph of stage (may be like Cocoon sitemap + xconf) ** My Project Cocoon Stage --------------> Pipe Queue --------------> Generator Processor --------------> Transformer Dispatcher --------------> Serializer ** Stage, Queue, Processor, Dispatcher are interface * Ability to enhance Stage's components with some Design Pattern : ** Decorator/Interceptor *** decorate Queue with QueueLogger (to send notification, log) *** decorate Queue with QueuePersistancer (to manage stop(crash)/start, based on Prevayler concept) *** decorate Queue with QueueBounder (to limit size,...) ** Composite *** create Composite Queue to manage subQueue (like this I could maintain ordre and use ThreadPool,...) *** Stage is compose with : **** 1..1 queue (maybe a decorator or composite) **** 0..n processor (sorted) **** 0..1 Dispatcher (to So Stage : * construction ** need to define some context for queue, processor, disptacher (like the name, workdir...) ** assemble/chain the processor(s) and disptacher * life style/algo (simple version) ** receive message from any component : other stage (via its dispather, service X like a socket listener...) and enqueue it ** select a Thread and wait message from the Queue ** take message from Queue and submit it to the chain of processor ** if message processing and dispatching is ok then remove message from the queue (ack) Currently I've got a version running under Phoenix but with heavy configuration (Queue, Processor, Dispatcher are managed (lifecycle...) by Stage): * need 'cut and paste' stage's definition in assembly to be able to have several stage (with different name) * need to define Queue, Processor and Dispatcher dependencies has Stage dependencies, not very flexibeable : when I create a new Processor with other dependencies than the already exists in Stage, I need to modify the source of Stage (java generate .xinfo), all the defintion of stage instance in assembly.xml... And if I choose to try Merlin it's first because Merlin is presented has able to manage sub/custom container. (And I saw the source/config of larm : http://marc.theaimsgroup.com/?l=avalon-users&m=104554030111477&w=2) I've got also an other constraint : production is targetted to september. If you see some incompatibility, hard stuff... please tell me and may be give some direction to investigate (fortress ??, custom like Cocoon team done...). Thanks a lot for your help. > >>One problem in the above - Merlin 2.1 does not directly support the > >>Executable interface. Problem is that the semantics at the level of > >>the framework are fuzzy here - what to do if a component implements > >>Executable and Startable? My own thoughts are that this should > >>qualified as a deployment policy - such that policy (a) results in > >>invocation of Startable and policy (b) ignores startable and only > >>invokes Executable. Policies (a) and (b) should be mutually exclusive. > >> > >> > > > >One case when I have Startable and Executable : > >then component is scheduled (schedule actived with start) but I need the > >ability to run the action handly, so I use execute() (through JMX or other > >component). > > > > I've been thinking about this in more detail since I posted my reply and > I'm progressively moving towards the position that Executable and > Startable may be more problematic that what I suggested. The thing that > is bugging me is that while a particular component may have a deployment > policy relative to its deployment - we cannot use such a policy globally > because consumer components will need a fully deployed componet (which > means all dependents that are Startable must be started before we assign > references to the consumer). ok, what is consumer ? (ServiceManager) > As to the existence of Executable via JMX - that changes the picture > because we are taking about an management operation (as opposed to a > potentially inconsistent lifecycle operation). > > >I'm OK with you, Executable is out of the scope of the Container but aren't > >exclusive with Startable. > > > > Current conclusion (i.e. state of current thinking that is not > necessarily complete): > > * Given the existence of Startable and Executable within > a given component implementation, Startable shall be > applied and Executable shall be ignored. > > * A component that implements Executable but not Startable > shall be executed following Initialization. > > > >>I'll put together a tutorial that demonstrates a custom container. > >> > > > >Thanks. > >I wrote a HelloContainer but I don't see the difference between Container > >and component (if container couldn't use, compose sub-component). > > > > There is not any difference between a container and a component (as far > as a component implementation is concerned)- the difference rest on how > the component (acting as a container) is handled by its appliance. In > the case of a component acting as a container - it is handled by a Block > - which adds the notions of separation of published services from its > internal component structure (implementation). Internal component can't access services from outside the its container ? If so, Merlin isn't the solution for my case (this restruction is the main raison why I would leave Phoenix). Other point : may be I should need to create a custom Block, like this I could enforce check of stage. Because inter-stage dependencies is define at the configuration time when I configure the dispatcher of the Stage. > It may sound complex - but it makes deployment of all sorts of > components just plain easy and very reusable. lot of work for you ;-) Regards. -- -------------------------------------------------------------- David "Dwayne" Bernard Freelance Developer (Java) mailto:[EMAIL PROTECTED] \|/ http://dwayne.java-fan.com --o0O @.@ O0o------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
