On Wed, Jan 19, 2011 at 10:17 PM, Shammi Jayasinghe <sha...@wso2.com> wrote:

>
>
> On Wed, Jan 19, 2011 at 7:44 PM, Sameera Jayasoma <same...@wso2.com>wrote:
>
>> On Tuesday, January 18, 2011, Shammi Jayasinghe <sha...@wso2.com> wrote:
>> > Hi ,
>> >
>> > In the process of providing multi tenant support for CEP , there are two
>> components (broker-manager and cep) that are needed to implement the
>> interface Axis2ConfigurationContextObserver.
>> > In that case,  i need to control the order of  invoking of these
>> implementations since CEP is depend on broker-manager and , broker manager
>> has to load some resources from registry which are needed for CEP.
>> >
>> >
>> > What is the possible way to do this ?
>>
>> Yea this is possible, this pattern is a common one in the carbon platform.
>>
>> You can implement this interface(Axis2ConfigurationContextObserver) in
>> the broker manager component and register it as an OSGi service. When
>> a new tenant is created, this service will be notified. This is the
>> white-board pattern that we have followed. Then you do all the work in
>> the broker manager component. Now you need to register another OSGi
>> service(say X) from the broker manager component. CEP component should
>> be listening to X services. When an X service is available, CEP
>> component will be triggered. This way you can order the initialization
>> of components.
>>
>
> Hi Sameera,
>
>  Actually CEP is depend on Broker-Manager and already Broker Manager
> publishes an OSGI Service and
> CEP triggered after that. This thing happen when the server is getting
> started, but what i want is some thing like bellow;
>
> -> Server is up and running
> -> Tenant A logs in to the system
> -> Broker manager loads broker configuration details specific to tenant A
> from Tenant A's registry
> -> CEP creates buckets for Tenant A ,using Tenant A's configuration details
> loaded by broker - manager component
>
> In the above case invoking for the implementation of
> Axis2ConfigurationContextObserver of broker-manager should happen
> before the implementation of CEP.
>

I think we can do something similar to the following.

Only the Broker Manager needs to implement
Axis2ConfigurationContextObserver. And CEP can publish an OSGi service(Say
Service A). When a tenant is loaded, Broker Manager is notified about that
event through Axis2ConfigurationContextObserver. Then you can run the code
which needs to be executed before the CEP and then lookup for the OSGi
service A published by CEP through a service tracker and invoke the
corresponding method.

Thanks,
Thilina



>
> Thanks
>
>
>> Thanks,
>> Sameera.
>> >
>> > Thanks
>> > --
>> > Best Regards,
>> >
>> > Shammi Jayasinghe
>> > Senior Software Engineer; WSO2, Inc.; http://wso2.com,
>> > mobile: +94 71 4493085
>> >
>> >
>> >
>>
>> --
>> Sameera Jayasoma
>> Technical Lead and Product Manager, WSO2 Carbon
>>
>> WSO2, Inc. (http://wso2.com)
>> email: same...@wso2.com
>> blog: http://tech.jayasoma.org
>>
>> Lean . Enterprise . Middleware
>> _______________________________________________
>> Carbon-dev mailing list
>> Carbon-dev@wso2.org
>> https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>>
>
>
>
> --
> Best Regards,*
>
> Shammi Jayasinghe*
> Senior Software Engineer; WSO2, Inc.; http://wso2.com,
> mobile: +94 71 4493085
>
>
>
> _______________________________________________
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 
Thilina Buddhika
Senior Software Engineer
WSO2 Inc. ; http://wso2.com
lean . enterprise . middleware

phone : +94 77 44 88 727
blog : http://blog.thilinamb.com
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to