12.07.2015 Views

VisiBroker Edition

VisiBroker Edition

VisiBroker Edition

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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

实 例}": exception = " + ri.sending_exception() +", reply status = " + getReplyStatus(ri));/*** 这 类 似 于 <strong>VisiBroker</strong> 4.x ServerRequestInterceptor,** public void postinvoke_premarshal(org.omg.CORBA.Object target,* ServiceContextListHolder service_contexts_holder,* org.omg.CORBA.Environment env, Closure closure);** env 包 含 违 例 值 。*/public void send_other(ServerRequestInfo ri) throws ForwardRequest {System.out.print("=====> SampleServerInterceptor id " + ri.request_id() +" send_other =>" + ri.operation() +": exception = " + ri.sending_exception() +", reply status = " + getReplyStatus(ri));}protected String getReplyStatus(RequestInfo ri) {switch(ri.reply_status()) {case SUCCESSFUL.value:return "SUCCESSFUL";case SYSTEM_EXCEPTION.value:return "SYSTEM_EXCEPTION";case USER_EXCEPTION.value:return "USER_EXCEPTION";case LOCATION_FORWARD.value:return "LOCATION_FORWARD";case TRANSPORT_RETRY.value:return "TRANSPORT_RETRY";default:return "invalid reply status id";}}}服 务 器 端 请 求 接 收 器 的 完 整 的 C++ 实 现 :SampleServerInterceptor.c++:C++:// SampleServerInterceptor.h#include "PortableInterceptor_c.hh"#include "IOP_c.hh"// USE_STD_NS 是 由 <strong>VisiBroker</strong> 建 立 的 使 用 namespace 的 定 义USE_STD_NSclass SampleServerInterceptor :public PortableInterceptor::ServerRequestInterceptor{private:char *_name;20-30 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!