Written a blog post with basic details : http://mohanadarshan.wordpress.com/2013/06/23/osgi-white-board-pattern-with-a-sample/
Regards, Mohan On Sun, Jun 23, 2013 at 10:51 AM, Mohanadarshan Vivekanandalingam < [email protected]> wrote: > Oh i see... Thanks... Will write a blog ASAP since i couldn't also find a > proper blog post with a sample... > > Regards, > Mohan > > > On Sun, Jun 23, 2013 at 10:41 AM, Afkham Azeez <[email protected]> wrote: > >> Another way to implement the pattern is through ServiceListener >> ( >> http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceListener.html >> ) >> >> You can also use ServiceTracker. However, we have found that >> declarative services is the most easy way to implement this for the >> majority of our components. >> >> Please write a detailed blog post with a sample, so that if you search >> for "Carbon OSGi service pattern", your blogpost is easily found. >> >> Azeez >> >> On Sun, Jun 23, 2013 at 10:30 AM, Mohanadarshan Vivekanandalingam >> <[email protected]> wrote: >> > Hi, >> > >> > After going through the code... I got the idea and it is working fine... >> > even-though we have implemented this pattern in >> > our code already i didn't know this what actually mean by white-board >> > pattern :( ,because the pdf that i sent, implemented this >> > pattern in different manner with a thread which is not efficient... >> > >> > Thanks for pointing me out... I'll go through the blog also... Thanks a >> > lot.. >> > >> > >> > Regards, >> > Mohan >> > >> > >> > On Sun, Jun 23, 2013 at 10:08 AM, Afkham Azeez <[email protected]> wrote: >> >> >> >> >> >> >> http://pradeepfernando.blogspot.com/2013/02/patterns-in-osgi-programming-white.html >> >> is a good read. Also read the comment from OSGi pioneer & guru Peter >> >> Kriens. >> >> >> >> Azeez >> >> >> >> On Sun, Jun 23, 2013 at 10:01 AM, Mohanadarshan Vivekanandalingam >> >> <[email protected]> wrote: >> >> > 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 >> >> >> >> >> >> >> >> -- >> >> 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 >> >> >> >> -- >> 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://twitter.com/afkham_azeezlinked-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 > -- *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
