You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Hiranya Jayathilaka <hi...@gmail.com> on 2009/07/27 10:41:31 UTC

Registering Synapse Observers at Startup

Hi Folks,

I have added the SynapseObserver interface and the AbstractSynapseObserver
class to the trunk as well as the 1.3 branch. I was thinking that it would
be great if we can provide a mechanism to register an observer with the
SynapseConfiguration before it gets populated by various entries by the
configuration builder. In other words a mechanism to register an observer
right after a SynapseConfiguration object is constructed using the 'new'
keyword. That way, one can write an observer which monitors the
configuration right from the configuration build time. I had a look at the
existing code and it seems it is not easy to provide such a mechanism with
the current design. So I would like to get some ideas from you all regarding
this.

I think we'll need to introduce a factory class which constructs
SynapseConfiguration objects with the necessary observers registered.
Configuration builders can use the factory to get a fresh
SynapseConfiguration and start populating it. WDYT? Your ideas are highly
appreciated.


Thanks
-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: Registering Synapse Observers at Startup

Posted by Hiranya Jayathilaka <hi...@gmail.com>.
On Mon, Jul 27, 2009 at 2:45 PM, indika kumara <in...@gmail.com>wrote:

> Hi Hiranya
>
> If a user needs to add an Observer implementation, how he can specify
> that? - There must be a configurable option.


Absolutely. User should be able to register an observer implementation he
desires.


> If you expect to allow a
> configurable option as synapse.properties file, then using
> SynapsePropertiesLoader at any location you want. Then, you can load
> properties and creates Observers and add. This will be simple and will
> not need any API changes.


Thanks Indika. I'll look into this.

Thanks,
Hiranya

>
>
> Thanks
> Indika
>
> On Mon, Jul 27, 2009 at 2:11 PM, Hiranya
> Jayathilaka<hi...@gmail.com> wrote:
> > Hi Folks,
> >
> > I have added the SynapseObserver interface and the
> AbstractSynapseObserver
> > class to the trunk as well as the 1.3 branch. I was thinking that it
> would
> > be great if we can provide a mechanism to register an observer with the
> > SynapseConfiguration before it gets populated by various entries by the
> > configuration builder. In other words a mechanism to register an observer
> > right after a SynapseConfiguration object is constructed using the 'new'
> > keyword. That way, one can write an observer which monitors the
> > configuration right from the configuration build time. I had a look at
> the
> > existing code and it seems it is not easy to provide such a mechanism
> with
> > the current design. So I would like to get some ideas from you all
> regarding
> > this.
> >
> > I think we'll need to introduce a factory class which constructs
> > SynapseConfiguration objects with the necessary observers registered.
> > Configuration builders can use the factory to get a fresh
> > SynapseConfiguration and start populating it. WDYT? Your ideas are highly
> > appreciated.
> >
> >
> > Thanks
> > --
> > Hiranya Jayathilaka
> > Software Engineer;
> > WSO2 Inc.;  http://wso2.org
> > E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> > Blog: http://techfeast-hiranya.blogspot.com
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Hiranya Jayathilaka
Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com

Re: Registering Synapse Observers at Startup

Posted by indika kumara <in...@gmail.com>.
Hi Hiranya

If a user needs to add an Observer implementation, how he can specify
that? - There must be a configurable option. If you expect to allow a
configurable option as synapse.properties file, then using
SynapsePropertiesLoader at any location you want. Then, you can load
properties and creates Observers and add. This will be simple and will
not need any API changes.

Thanks
Indika

On Mon, Jul 27, 2009 at 2:11 PM, Hiranya
Jayathilaka<hi...@gmail.com> wrote:
> Hi Folks,
>
> I have added the SynapseObserver interface and the AbstractSynapseObserver
> class to the trunk as well as the 1.3 branch. I was thinking that it would
> be great if we can provide a mechanism to register an observer with the
> SynapseConfiguration before it gets populated by various entries by the
> configuration builder. In other words a mechanism to register an observer
> right after a SynapseConfiguration object is constructed using the 'new'
> keyword. That way, one can write an observer which monitors the
> configuration right from the configuration build time. I had a look at the
> existing code and it seems it is not easy to provide such a mechanism with
> the current design. So I would like to get some ideas from you all regarding
> this.
>
> I think we'll need to introduce a factory class which constructs
> SynapseConfiguration objects with the necessary observers registered.
> Configuration builders can use the factory to get a fresh
> SynapseConfiguration and start populating it. WDYT? Your ideas are highly
> appreciated.
>
>
> Thanks
> --
> Hiranya Jayathilaka
> Software Engineer;
> WSO2 Inc.;  http://wso2.org
> E-mail: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org