Hi Azeez, Thanks a lot... This is more clear... I'll go through the codes and will get back to you if i got any issues...
Thanks, Mohan On Sun, Jun 23, 2013 at 8:42 AM, Afkham Azeez <[email protected]> wrote: > We have this pattern in almost all components. Take a look at > org.wso2.carbon.core.internal.CarbonCoreServiceComponent in the > kernel/trunk/org.wso2.carbon.core module. That is where you get > notified when a service of a particular type gets registered. > > The following annotation declares (that is why it is called > declarative services) that there can be 0 to n instances of > org.wso2.carbon.core.ServerRestartHandler; > > @scr.reference name="serverRestartHandler" > interface="org.wso2.carbon.core.ServerRestartHandler" > * cardinality="0..n" policy="dynamic" bind="addServerRestartHandler" > unbind="removeServerRestartHandler" > > In the implementation method, addServerRestartHandler, you will add > the implementation to a List, and in removeServerRestartHandler, you > will remove it from the list. Please note that you have to override > the equals &hashCode methods in the implementation class of > org.wso2.carbon.core.ServerRestartHandler > > Now let's see how implementation instances of > org.wso2.carbon.core.ServerRestartHandler are registered; > > context.registerService(org.wso2.carbon.core.ServerRestartHandler.class, > new MyServerRestartHandler(), null); > > Here, MyServerRestartHandler is implemented in the bundle that > registers the service, in general. This OSGi service registration > could be done in the Bundle Activator or in the activate method of > another Service component. > > > Please feel free to ask any questions if anything is not clear &you > need further clarifications > > Azeez > > On Sat, Jun 22, 2013 at 11:21 AM, Mohanadarshan Vivekanandalingam > <[email protected]> wrote: > > Hi, > > > > Thanks for the link... I got the theoretical details of the pattern but i > > think, corresponding links of the examples are not working... > > > > Thanks, > > Mohan > > > > > > On Fri, Jun 21, 2013 at 7:05 PM, Sameera Jayasoma <[email protected]> > wrote: > >> > >> http://www.noway.es/OSGI-Declarative-Services-Components-Tutorial > >> > >> > >> On Fri, Jun 21, 2013 at 6:56 PM, Sameera Jayasoma <[email protected]> > >> wrote: > >>> > >>> Hi, > >>> > >>> There are bunch of place in Carbon kernel where we have used this > >>> pattern. You can implement this pattern using declarative service > >>> components. > >>> > >>> Thanks, > >>> Sameera. > >>> > >>> > >>> On Fri, Jun 21, 2013 at 6:33 PM, Mohanadarshan Vivekanandalingam > >>> <[email protected]> wrote: > >>>> > >>>> Hi, > >>>> > >>>> Is there any code reference where can find proper OSGI white board > >>>> pattern implemented (serviceTracker) ?? I have got this > >>>> http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf Is this correct > >>>> approach (create a thread and running continuously)... > >>>> > >>>> Thanks, > >>>> Mohan > >>>> > >>>> > >>>> -- > >>>> V. Mohanadarshan > >>>> Software Engineer, > >>>> Data Technologies Team, > >>>> WSO2, Inc. http://wso2.com > >>>> lean.enterprise.middleware. > >>>> > >>>> email: [email protected] > >>>> phone:(+94) 771117673 > >>>> > >>>> _______________________________________________ > >>>> Dev mailing list > >>>> [email protected] > >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev > >>>> > >>> > >>> > >>> > >>> -- > >>> Sameera Jayasoma, > >>> Architect, > >>> > >>> WSO2, Inc. (http://wso2.com) > >>> email: [email protected] > >>> blog: http://sameera.adahas.org > >>> twitter: https://twitter.com/sameerajayasoma > >>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections > >>> > >>> Lean . Enterprise . Middleware > >> > >> > >> > >> > >> -- > >> Sameera Jayasoma, > >> Architect, > >> > >> WSO2, Inc. (http://wso2.com) > >> email: [email protected] > >> blog: http://sameera.adahas.org > >> twitter: https://twitter.com/sameerajayasoma > >> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections > >> > >> Lean . Enterprise . Middleware > > > > > > > > > > -- > > V. Mohanadarshan > > Software Engineer, > > Data Technologies Team, > > WSO2, Inc. http://wso2.com > > lean.enterprise.middleware. > > > > email: [email protected] > > phone:(+94) 771117673 > > > > _______________________________________________ > > Dev mailing list > > [email protected] > > http://wso2.org/cgi-bin/mailman/listinfo/dev > > > > > > -- > Afkham Azeez > Director of Architecture; WSO2, Inc.; http://wso2.com > Member; Apache Software Foundation; http://www.apache.org/ > > email: [email protected] cell: +94 77 3320919 > blog: http://blog.afkham.org > twitter: http://twitter.com/afkham_azeez > linked-in: http://lk.linkedin.com/in/afkhamazeez > > Lean . Enterprise . Middleware > -- *V. Mohanadarshan* *Software Engineer,* *Data Technologies Team,* *WSO2, Inc. http://wso2.com * *lean.enterprise.middleware.* * * email: [email protected] phone:(+94) 771117673
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
