16.01.2014 Views

Diploma Thesis Santiago Gómez Sáez - IAAS

Diploma Thesis Santiago Gómez Sáez - IAAS

Diploma Thesis Santiago Gómez Sáez - IAAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6. Implementation<br />

the bundle activation process, the OSGi container creates one instance of the class which<br />

implements the BundleActivator interface, and executes its operations. The class OSGIHandler<br />

of the MySQL Proxy OSGi bundle implements those operations, and allows us to instantiate<br />

the classes which are used in the component, its properties, and the references to third party<br />

OSGi bundles. Furthermore, it loads the server properties file from the bundle package. The<br />

instantiation of Java classes packed in third party bundles can be done by looking up the<br />

associated bundle service in the OSGi registry. The lookup can be done either by accessing<br />

with Java code the BundleContext operations (see Listing 6.1), or using Spring functionalities.<br />

Spring enables the properties setting and the external bundle reference in XML format (see<br />

Listing 6.1), in the beans.xml file. We utilize this feature to reference to the following OSGi<br />

bundles: the NMR API shipped with ServiceMix, and the JBI ServiceMix Registry developed<br />

by Uralov [Ura12].<br />

1 -- Spring --<br />

2<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!