12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

实 例C++:void ORB_init(int& argc, char* const* argv, CORBA::ORB_ptr orb){if( _poa_interceptors_installed) return;SampleServerLoader *server = new SampleServerLoader();PortableInterceptor::register_orb_initializer(server);...Java:服 务 器 端 接 收 器 装 载 器 的 完 整 实 现 如 下 :// SampleServerLoader.javaimport org.omg.PortableInterceptor.*;import org.omg.PortableInterceptor.ORBInitInfoPackage.*;public class SampleServerLoader extends org.omg.CORBA.LocalObjectimplements ORBInitializer{public void pre_init(ORBInitInfo info) {try {info.add_server_request_interceptor(newSampleServerInterceptor());System.out.println("=====>SampleServerLoader: Interceptors loaded");}catch(DuplicateName dn) {System.out.println("Interceptor: " + dn.name + " already installed.");}catch(Exception e) {e.printStackTrace();throw new org.omg.CORBA.INITIALIZE(e.toString());}}public void post_init(ORBInitInfo info) {// 这 里 我 们 什 么 都 不 用 做 。}}C++:服 务 器 端 接 收 器 装 载 器 在 C++ 下 的 完 整 实 现 :// SampleServerLoader.C#include "PortableInterceptor_c.hh"#include "IOP_c.hh"#if defined( DLL_COMPILE )#include "vinit.h"#include "corba.h"#endif#include "SampleServerInterceptor.h"// USE_STD_NS 是 由 <strong>VisiBroker</strong> 为 使 用 std namespace 而 建 立 的 定 义USE_STD_NS class SampleServerLoader :{public PortableInterceptor::ORBInitializer使 用 可 移 植 接 收 器 20-19

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

Saved successfully!

Ooh no, something went wrong!