Suivez ce tutoriel pour installer l'ensemble protobuf-java-2.4.0a-bundle.jar et l'ensemble de plug-in ProtoBufSamplePlugins-1.0.0.jar en utilisant la console OSGi Equinox OSGi.
osgi> install file:///wxs_sample_osgi_root/lib/com.google.protobuf_2.4.0a.jar
La sortie suivante s'affiche :
Bundle ID is 21
L'exemple OSGi inclut cinq exemples d'ensembles qui contiennent les plug-in eXtreme Scale, notamment un plug-in personnalisé ObjectGridEventListener et un plug-in MapSerializerPlugin. Le plug-in MapSerializerPlugin utilise l'exemple Google Protocol Buffers et les messages fournis par l'exemple MapSerializerPlugin.
Les ensembles suivants se trouvent dans le répertoire wxs_sample_osgi_root/lib : ProtoBufSamplePlugins-1.0.0.jar et ProtoBufSamplePlugins-2.0.0.jar.
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean id="myShardListener" class="com.ibm.websphere.samples.xs.proto.osgi.MyShardListenerFactory"/>
<service ref="myShardListener" interface="com.ibm.websphere.objectgrid.plugins.osgi.PluginServiceFactory" ranking="1">
</service>
<bean id="myProtoBufSerializer" class="com.ibm.websphere.samples.xs.proto.osgi.ProtoMapSerializerFactory">
<property name="keyType" value="com.ibm.websphere.samples.xs.serializer.app.proto.DataObjects1$OrderKey" />
<property name="valueType" value="com.ibm.websphere.samples.xs.serializer.app.proto.DataObjects1$Order" />
</bean>
<service ref="myProtoBufSerializer" interface="com.ibm.websphere.objectgrid.plugins.osgi.PluginServiceFactory"
ranking="1">
</service>
</blueprint>
Le fichier XML Blueprint exporte les deux services myShardListener et myProtoBufSerializer. Ces deux services sont référencés dans le fichier protoBufObjectgrid.xml.
Procédez comme suit pour installer l'ensemble ProtoBufSamplePlugins-1.0.0.jar.
osgi> install file:///wxs_sample_osgi_root/lib/ProtoBufSamplePlugins-1.0.0.jar
La sortie suivante s'affiche :
Bundle ID is 22
Dans cette leçon, vous avez installé l'ensemble protobuf-java-2.4.0a-bundle.jar et l'ensemble de plug-in ProtoBufSamplePlugins-1.0.0.jar.