synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Veithen <>
Subject Re: Do we really need two flavors of init methods in mediators?
Date Tue, 27 Jan 2009 21:14:11 GMT
As far as I can see, both methods are called from within
SynapseInitializationModule#init and the code inbetween the two

- deploys the Synapse service, the proxy services and the services
related to eventing;
- sets up some stuff related to hostnames.

What of these two things exactly causes the problem?

Or is the problem related to the possibility that an object (mediator
or endpoint) being initialized could interact with another object that
has not been initialized yet, and that therefore we need two passes?


PS: There is no need to use SynapseEnvironment#createMessageContext to
get hold of the ConfigurationContext since Axis2SynapseEnvironment has
a getAxis2ConfigurationContext method.

On Sat, Jan 24, 2009 at 17:22, Ruwan Linton <> wrote:
> I am sorry, we cannot remove this and use just the init method which accepts
> Synapse Env because, when you call init by passing the Synapse Env the
> ConfigurationContext is still being populated and the ConfigurationContext
> is sort of at an intermediate state. So if we try to use the
> SynapseEnv.createMC to get hold of the CfgCtx it night cause issues.
> This is because the Synapse initialization happens as a module for axis2 and
> it initializes while axis2 is in the process of initializing. I agree it is
> a little bit ugly to have two levels of initializations, but I think it is
> not that safe to just remove it and live with only one.
> We might come across issues on the loadbalaced and failover endpoints on the
> clustered enviorenment with a fair amount of load for the cluster.
> Thanks,
> Ruwan
> On Sat, Jan 24, 2009 at 12:40 AM, Asankha C. Perera <>
> wrote:
>> Hi Andreas
>>> Since you added the second init method, WDYT about this issue?
>>>>> I noticed that we have two different init methods for Synapse
>>>>> mediators:
>>>>> - One is defined by the optional ManagedLifecycle interface with the
>>>>> following signature:
>>>>> void init(SynapseEnvironment se)
>>>>> - The other is defined by AbstractMediator with the following
>>>>> signature:
>>>>> void init(ConfigurationContext cc)
>>>>> Is there any particular reason for this? It should be noted that the
>>>>> ConfigurationContext can be obtained from the SynapseEnvironment by
>>>>> casting it to Axis2SynapseEnvironment. Therefore I think that the
>>>>> second method should be eliminated. WDYT?
>> As I remember this was to accommodate endpoints that required access to
>>  the ConfigurationContext to operate in clustered environments, but which
>> could be defined anonymously within the scope of sequences. (See
>> AbstractEndpoint#init(cc))
>> If this could be safely removed, I have no objection for the removal of
>> the method from the AbstractMediator
>> cheers
>> asankha
>> --
>> Asankha C. Perera
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:
> --
> Ruwan Linton
> - "Oxygenating the Web Services Platform"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message