Eric,

Please see my comments inline;

>
> Does this correctly reflect your idea Ruwan?
>
>
>
> What about this slight modification?
>
>
>
> 1 SynapseServer.main()
>
>
>
> 1.1
> ServerConfigurationInformationFactory.createServerConfigurationInformation(args);
>
>
>
> 1.2 ServerManager.getInstance();
>
>
>
> 1.3 ServerManager.init()
>
> 1.3.1
> SynapseControllerFactory.createSynapseController(configurationInformation);
>
> 1.3.2 ServerManager.doInit()
>
> 1.3.2.1 Axis2SynapseController.init()
>
> 1.3.2.1.1 Axis2SynapseController.createNewInstance()
>
> 1.3.2.1.1.1
> Axis2SynapseController.createConfigurationContextFromFileSystem()
>
> 1.3.2.1.2 create and Init Listener Manager
>
> 1.3.2.1.3 add transports without starting them
>
> 1.3.2.2 Axis2SynapseController.initDefaults()
>
> 1.3.2.2.1
> Axis2SynapseController.addDefaultBuildersAndFormatters(configurationContext.getAxisConfiguration());
>
> 1.3.2.2.2 Axis2SynapseController.loadMediatorExtensions();
>
> 1.3.2.2.3 Axis2SynapseController.setupDataSources();
>
>
>
> 1.4 ServerManager.start()
>
> 1.4.1 ServerManager.assertInitialized()
>
> 1.4.2 ServerManager.doInit()
>
> 1.4.3 ServerManager.doStart()
>
> 1.4.3.1 Axis2SynapseController.preStart() ß add to interface
>
> 1.4.3.1.1 Axis2SynapseController.createSynapseConfiguration(); ß remove
> from interface, protected
>
> 1.4.3.1.2 Axis2SynapseController.createSynapseEnvironment(); ß remove from
> interface, protected
>
> 1.4.3.1.2.1 Axis2SynapseController.setupSynapse()
>
> 1.4.3.1.2.1.1 Axis2SynapseController.addServerIPAndHostEnrties();
>
> 1.4.3.1.2.1.2 Axis2SynapseController.setupMainMediation();
>
> 1.4.3.1.2.1.3 Axis2SynapseController.setupProxyServiceMediation();
>
> 1.4.3.1.2.1.4 Axis2SynapseController.setupEventSources();
>
> 1.4.3.1.2.2 SynapseConfiguration.init()
>
> 1.4.3.1.2.2.1 init registry, init endpoints, init managed mediators, init
> proxies
>
> 1.4.3.2 Axis2SynapseController.start() ß add to interface
>
> 1.4.3.2.1 start Listener Manager which in turn start all registered
> transports
>
> 1.4.3.3 Axis2SynapseController.postStart() ß add to interface
>
> 1.4.3.3.1 start tasks
>
What I meant in my original proposal is exactly this, but without preStart I
think preStart is equivalent to the init, but we need postStart or some
other meaning full method to do post startup tasks. This may not be just the
tasks but also some mediators which requires to fetch some data from outside
going through the transport senders at the startup??

So if we add a new method to the ManagedLifecycle called start you could,
support these post startup work in a general manner rather than treating
tasks starting as a special case.


>
>
> Regarding the question whether to extend the existing ManagedLifecycle
> interface or using a new one, I’m not sure whether I understand the
> reasoning. What would be the benefit for a managed mediator to know when the
> listener is started? Any implementor would need to provide an
> implementation. Not sure if this makes sense. Please also remember that
> there is already an interface called Startup extending ManagedLifecycle!
>
>
>
> Ah, now I think I got your point you think of splitting the current
> implementation of SimpleQuartz.init() in .init() and start() calling the
> init() as we are doing it now from SynapseConfiguration.init() and calling
> the start() after start of the listeners. Then we could also only add
> start() to the Startup interface. Any implementor needing this callback
> could choose to implement Startup instead of ManagedLifecycle. I would
> prefer this to adding the method to MangedLifecycle directly.
>
Exactly this is what I meant.

>
>
> Yes, after thinking a bit about it I’m +1 on your suggestion.
>
>
>
> Other thoughts?
>
>
>
> Regards,
>
>    Eric
>   ------------------------------
>
> *From:* Ruwan Linton [mailto:[email protected]]
> *Sent:* Friday, April 03, 2009 12:45 PM
> *To:* [email protected]
> *Subject:* Re: startup order - correct place to start transport listeners
>
>
>
> Here is my proposal,
>
>
> We introduce a start method to the SynapseController so that we can init
> the Axis2 environment in the init method of the controller and then
> initialize the Synapse environment after creating the SynapseConfiguration
> and call this introducing start method.
>
> init method of the controller initializes the listener manager and add all
> the listeners parsing true to not to start the listeners upon adding them to
> the listener manager.
>
> In the start method we start the listener manager which intern will start
> all the listeners.
>
> Further, post starting tasks like starting the Tasks and so on has to be
> handled with a different call after the start call. We may come up with a
> different interface for these or introduce a method to the ManagedLifecycle
> interface called start, apart from the init and destroy methods so that the
> start method will be called after starting the listener manager, from the
> ServerManager class.
>
> This resolves the issue...
>
> WDYT?
>
> Thanks,
> Ruwan
>
> On Fri, Apr 3, 2009 at 3:19 PM, Hubert, Eric <[email protected]>
> wrote:
>
> I am trying to come up with a proposal to implement this. When we do a
> considerable change, it is better to discuss things before commiting to
> implement that even though we are operating on CTR model.
>
>
>
> Ruwan, I fully agree. While reading the dev list I noticed quite often that
> the final result of a discussed solution profited a lot from valuable input
> of other developers. For me this is simply a combined (team) strength which
> could be used even more actively.
>
>
>
> Regards,
>
>    Eric
>
>
>
>
>
>
> --
> Ruwan Linton
> Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
> WSO2 Inc.; http://wso2.org
> email: [email protected]; cell: +94 77 341 3097
> blog: http://ruwansblog.blogspot.com
>



-- 
Ruwan Linton
Senior Software Engineer & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Reply via email to