Difference between revisions of "Creating your own service"
From RifidiWiki
| Line 1: | Line 1: | ||
| + | ----  | ||
| + | <div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">  | ||
| + | ----  | ||
| + | =[http://ukusypumi.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=  | ||
| + | ----  | ||
| + | =[http://ukusypumi.co.cc CLICK HERE]=  | ||
| + | ----  | ||
| + | </div>  | ||
* create a new OSGi Bundle.  | * create a new OSGi Bundle.  | ||
* Create an interface for your service.  | * Create an interface for your service.  | ||
| Line 9: | Line 17: | ||
  				new CablingServiceImpl(), null);  |   				new CablingServiceImpl(), null);  | ||
  }  |   }  | ||
| − | And that's it. Your service is available as soon as the first class from your bundle is loaded.  | + | And that's it. Your service is available as soon as the first class from your bundle is loaded.<br/>  | 
Revision as of 23:18, 23 November 2010
- create a new OSGi Bundle.
 - Create an interface for your service.
 - Implement the interface.
 - Register the service in the activator:
 
public void start(BundleContext context) throws Exception {
	super.start(context);
	plugin = this;
	context.registerService(CablingService.class.getName(),
				new CablingServiceImpl(), null);
}
And that's it. Your service is available as soon as the first class from your bundle is loaded.<br/>