20.2.6 インタセプタオブジェクトの生成

ここで,インタセプタのインスタンスを生成し,それをBorland Enterprise Server VisiBroker ORBに登録するファクトリクラスをインプリメントする必要があります。ファクトリクラスはServiceLoaderインタフェース(Java)をインプリメントしなければなりません。

コードサンプル20-7 ServiceLoaderインタフェース(Java)

package com.inprise.vbroker.interceptor;
public interface ServiceLoader {
  //This method is called by the ORB when ORB.init()is called.
  public abstract void init(org.omg.CORBA.ORB orb);

  //Called after ORB.init()is done but control hasn't been returned to
  //the user.Can be used to disable certain resources that were only
  //made available to other service inits.
  public abstract void init_complete(org.omg.CORBA.ORB orb);

  //Called when the orb is being shutdown.
  public abstract void shutdown(org.omg.CORBA.ORB orb);
}

次の例のように,インタセプタの新しいインスタンスを生成し,それを別のインタセプタからBorland Enterprise Server VisiBroker ORBに登録することもできます。