このチュートリアルでは、Equinox OSGi コンソールを使用して、protobuf-java-2.4.0a-bundle.jar バンドルと ProtoBufSamplePlugins-1.0.0.jar プラグイン・バンドルをインストールします。
osgi> install file:///wxs_sample_osgi_root/lib/com.google.protobuf_2.4.0a.jar
以下の出力が表示されます。
Bundle ID is 21
OSGi サンプルには、カスタム ObjectGridEventListener や MapSerializerPlugin プラグインなどの eXtreme Scale プラグインを含む 5 つのサンプル・バンドルが含まれています。MapSerializerPlugin プラグインは Google Protocol Buffers サンプルと、MapSerializerPlugin サンプルが提供するメッセージを使用します。
次のバンドル、ProtoBufSamplePlugins-1.0.0.jar と ProtoBufSamplePlugins-2.0.0.jar は、wxs_sample_osgi_root/lib ディレクトリーにあります。
<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>
Blueprint XML ファイルは 2 つの サービス、myShardListener と myProtoBufSerializer をエクスポートします。 これら 2 つのサービスは、protoBufObjectgrid.xml ファイル内で参照されます。
次のステップを実行して、ProtoBufSamplePlugins-1.0.0.jar バンドルをインストールします。
osgi> install file:///wxs_sample_osgi_root/lib/ProtoBufSamplePlugins-1.0.0.jar
以下の出力が表示されます。
Bundle ID is 22
このレッスンでは、protobuf-java-2.4.0a-bundle.jar バンドルと ProtoBufSamplePlugins-1.0.0.jar プラグイン・バンドルをインストールしました。