1 21 package org.jacorb.transaction; 22 23 24 import org.omg.PortableInterceptor.*; 25 import org.omg.IOP.Codec ; 26 import org.omg.IOP.ServiceContext ; 27 import org.omg.IOP.TransactionService ; 28 29 37 38 public class ClientContextTransferInterceptor 39 extends org.omg.CORBA.LocalObject 40 implements ClientRequestInterceptor 41 { 42 43 private int slot_id = -1; 44 private Codec codec = null; 45 46 public ClientContextTransferInterceptor(int slot_id, Codec codec) 47 { 48 this.slot_id = slot_id; 49 this.codec = codec; 50 } 51 52 54 public String name() 55 { 56 return "ClientContextTransferInterceptor"; 57 } 58 59 public void destroy() 60 { 61 } 62 63 66 67 public void send_request( ClientRequestInfo ri ) 68 throws ForwardRequest 69 { 70 try 71 { 72 org.omg.CORBA.Any any = ri.get_slot(slot_id); 73 74 if (! (any.type().kind().value() == org.omg.CORBA.TCKind._tk_null)) 75 { 76 ServiceContext ctx = new ServiceContext (TransactionService.value, 77 codec.encode(any)); 78 79 ri.add_request_service_context(ctx, false); 80 } 81 } 82 catch (Exception e) 83 { 84 85 } 86 } 87 88 public void send_poll(ClientRequestInfo ri){ 89 } 90 91 public void receive_reply(ClientRequestInfo ri){ 92 } 93 94 public void receive_exception(ClientRequestInfo ri) 95 throws ForwardRequest{ 96 } 97 98 public void receive_other(ClientRequestInfo ri) 99 throws ForwardRequest{ 100 } 101 } 103 104 105 106 107 108 | Popular Tags |