On Fri, Jan 21, 2011 at 9:51 AM, Amila Suriarachchi <am...@wso2.com> wrote:
> > > On Wed, Jan 19, 2011 at 10:53 PM, Thilina Buddhika <thili...@wso2.com>wrote: > >> >> >> 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. >> > > CEP has a service dependency for Broker. I.e broker component has to up > before the CEP. I think your solution put a cyclic dependency. > I suggested to use this service tracker only after Broker Manager receives a notification on a tenant loading event, which happens after the server is fully started. If I understand correct from the earlier posts, CEP has a dependency on Message Broker during the startup. Thanks, Thilina > > Isn't it possible to implement the Axis2ConfigurationContextObserver in the > order they get registered? > > In fact there is an order to which bundles are activated. (which is > controlled by the declarative services) If we can in invoke the observers in > the order they registered I think that solve many problems. > > thanks, > Amila. > > > >> 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 >> >> > > _______________________________________________ > 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