Hi Senaka, On Fri, Mar 16, 2012 at 5:32 PM, Senaka Fernando <[email protected]> wrote:
> Hi Nirmal, > > We did agree on a convention for registering declarative services for > Carbon sometime back, and if you have a look into few bundles in the carbon > kernel, and take a look at files ending with *ServiceComponent.java, you > should be able to understand this. I'm not sure whether there is any > documentation on this, but if you pay attention into a few, you'll notice > that the convention includes, naming of packages, classes etc as well. > I already had a look at some components and noticed the use of *ServiceComponent.java classes. But in my case, this service isn't referencing (consuming) any other service, and I found there's nothing to put inside a separate class. So, I am wondering whether there's a need to add such a class in my case (i.e. when you only exposing a service) ? I'm glad that you bring out the 'packaging structure convention' here, as far as I see, there's no consistent convention among components (as an example some components put '*Exception.java' classes directly under root (service) package, but some under a new 'exception' package. Latter is what I followed. I think, it would be helpful to everyone if we compose a document, on this little, but important things. WDYT? > > Thanks, > Senaka. > > On Fri, Mar 16, 2012 at 10:17 AM, Nirmal Fernando <[email protected]> wrote: > >> Hi All, >> >> I want to make a service implementation, to an OSGi declarative service. >> >> What I did was following. >> >> public interface IMyService{ ... } >> >> /** >> * @scr.component name="a.b.service" immediate="true" >> * @scr.service value="a.b.service.IMyService" >> */ >> public class MyServiceImpl implements IMyService{ ... } >> >> And all works fine! But is this the recommended way? >> If not what is the recommended way and why we use that way instead of >> this? >> >> An explanation would be highly appreciated! >> >> -- >> >> Thanks & regards, >> Nirmal >> >> Software Engineer- Platform Technologies Team, WSO2 Inc. >> Mobile: +94715779733 >> Blog: http://nirmalfdo.blogspot.com/ >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Senaka Fernando* > Product Manager - WSO2 Governance Registry; > Associate Technical Lead; WSO2 Inc.; http://wso2.com* > Member; Apache Software Foundation; http://apache.org > > E-mail: senaka AT wso2.com > **P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818 > Linked-In: http://linkedin.com/in/senakafernando > > *Lean . Enterprise . Middleware > > -- Thanks & regards, Nirmal Software Engineer- Platform Technologies Team, WSO2 Inc. Mobile: +94715779733 Blog: http://nirmalfdo.blogspot.com/
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
