> -----Original Message----- > From: Mathews Julien [mailto:[EMAIL PROTECTED] > Sent: Monday, January 19, 2004 8:21 PM > To: [EMAIL PROTECTED] > Subject: Re: Non component class as the starting point > > > Thanks for your reply > > How does a container know which component is the starting point of any > application. Does the root component in the block.xml specify that ? >
No, a component that wants to be executed or started by the container once its initialization phase has completed should implement the or.apache.avalon.framework.activity.Executable or the org.apache.avalon.framework.activity.Startable interface. > And how can we have container call a method on that component > which doesn't > implement any Framework interfaces. You will probably have to write a wrapper for such a non-avalon component. > > When I say starting point, I mean, like a gui application can > start from a > main program. So that main program would be the starting point of an > application. > > In my container, some component gotta be the starting point of my > application, right ? > > Or am on a wrong line of thinking. I think you have a problem many people have when trying to understand avalon/merlin. Avalon was probably conceived and developed by people who focused on client/server architectures, often obeying a request/response pattern. Such applications often simply start a listener thread once initialization has completed and wait for incoming requests. So apart from the code that creates the listener thread there's no easily identifiable "main" method. This does not mean that you cannot use merlin for, say, swing gui applications. I know that many people are using it that way. It only means that documentation does not necessarily address the need for such a "main" method. So if you already have a class that starts up your (gui) app you should probably write a wrapper component that implements either the Executable or the Startable lifecycle interface. Thus, once merlin has finished configuring your component it will either call its execute() (Executable) or its start() (Startable) method. Hope this helps, Olaf --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]