1 23 24 package com.sun.enterprise.iiop; 25 26 import org.omg.PortableInterceptor.ClientRequestInfo ; 27 28 import com.sun.enterprise.*; 29 import com.sun.corba.ee.spi.legacy.interceptor.RequestInfoExt; 30 import com.sun.corba.ee.spi.legacy.connection.Connection; 31 import com.sun.enterprise.iiop.security.SecurityMechanismSelector; 32 import com.sun.enterprise.iiop.security.ConnectionContext; 33 import com.sun.corba.ee.spi.presentation.rmi.StubAdapter; 34 import java.util.logging.*; 35 import com.sun.logging.*; 36 37 public class ClientConnectionInterceptor extends org.omg.CORBA.LocalObject 38 implements org.omg.PortableInterceptor.ClientRequestInterceptor , 39 Comparable 40 { 41 private static Logger _logger=null; 42 static{ 43 _logger=LogDomains.getLogger(LogDomains.CORBA_LOGGER); 44 } 45 public String name; 46 public int order; 47 48 53 public ClientConnectionInterceptor(String name, int order) 54 { 55 this.name = name; 56 this.order = order; 57 } 58 59 public int compareTo(Object o) 60 { 61 int otherOrder = -1; 62 if(o instanceof ClientConnectionInterceptor) { 63 otherOrder = ((ClientConnectionInterceptor)o).order; 64 } 65 if (order < otherOrder) { 66 return -1; 67 } else if (order == otherOrder) { 68 return 0; 69 } 70 return 1; 71 } 72 73 77 public String name() { 78 return name; 79 } 80 81 82 public void send_request(ClientRequestInfo cri) 83 { 84 Object target = cri.effective_target(); 86 J2EETransactionManager tm = Switch.getSwitch().getTransactionManager(); 87 if ( tm != null ) 88 tm.checkTransactionExport(StubAdapter.isLocal(target)); 89 90 Connection c = ((RequestInfoExt)cri).connection(); 92 if(c != null) { 93 SecurityMechanismSelector sms = new SecurityMechanismSelector(); 94 ConnectionContext cc = sms.getClientConnectionContext(); 95 if(_logger.isLoggable(Level.FINE)){ 96 _logger.log(Level.FINE,"SENDING request on connection: " + c); 97 } 98 if(cc != null) { 99 cc.setSocket(c.getSocket()); 100 } 101 } 102 } 103 104 public void destroy() { 105 } 106 107 public void send_poll(ClientRequestInfo cri) { 108 } 109 110 public void receive_reply(ClientRequestInfo cri) { 111 } 112 113 public void receive_exception(ClientRequestInfo cri) { 114 } 115 116 public void receive_other(ClientRequestInfo cri) { 117 } 118 } 119 120 | Popular Tags |