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.

实 例** public void postinvoke(org.omg.CORBA.Object target,* ServiceContext[] service_contexts, InputStream payload,* org.omg.CORBA.Environment env, Closure closure);** env 包 含 违 例 值 。*/public void receive_exception(ClientRequestInfo ri) throws ForwardRequest {System.out.println("=====> SampleClientInterceptor id " +ri.request_id() +" receive_exception => " + ri.operation() +": exception = " + ri.received_exception());}/*** 这 类 似 于 <strong>VisiBroker</strong> 4.x ClientRequestInterceptor,** public void postinvoke(org.omg.CORBA.Object target,* ServiceContext[] service_contexts, InputStream payload,* org.omg.CORBA.Environment env, Closure closure);** env 包 含 违 例 值 。*/public void receive_other(ClientRequestInfo ri) throws ForwardRequest {System.out.println("=====> SampleClientInterceptor id " +ri.request_id() +" receive_reply => " + ri.operation() +": exception = " + ri.received_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++:客 户 端 请 求 接 收 器 的 C++ 完 整 实 现// SampleClientInterceptor.h#include "PortableInterceptor_c.hh"#include "IOP_c.hh"20-24 <strong>VisiBroker</strong> 开 发 者 指 南

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

Saved successfully!

Ooh no, something went wrong!