1 7 15 16 package com.sun.corba.se.impl.protocol; 17 18 import com.sun.corba.se.pept.protocol.MessageMediator; 19 20 import com.sun.corba.se.spi.ior.IOR; 21 import com.sun.corba.se.spi.ior.ObjectKey; 22 import com.sun.corba.se.spi.orb.ORB; 23 import com.sun.corba.se.spi.logging.CORBALogDomains; 24 import com.sun.corba.se.spi.protocol.CorbaServerRequestDispatcher; 25 import com.sun.corba.se.spi.protocol.CorbaMessageMediator; 26 27 import com.sun.corba.se.impl.orbutil.ORBUtility; 28 import com.sun.corba.se.impl.logging.ORBUtilSystemException; 29 30 38 public class INSServerRequestDispatcher 39 implements CorbaServerRequestDispatcher 40 { 41 42 private ORB orb = null; 43 private ORBUtilSystemException wrapper ; 44 45 public INSServerRequestDispatcher( ORB orb ) { 46 this.orb = orb; 47 this.wrapper = ORBUtilSystemException.get( orb, 48 CORBALogDomains.RPC_PROTOCOL ) ; 49 } 50 51 public IOR locate(ObjectKey okey) { 53 String insKey = new String ( okey.getBytes(orb) ); 56 return getINSReference( insKey ); 57 } 58 59 public void dispatch(MessageMediator mediator) 60 { 61 CorbaMessageMediator request = (CorbaMessageMediator) mediator; 62 String insKey = new String ( request.getObjectKey().getBytes(orb) ); 65 request.getProtocolHandler() 66 .createLocationForward(request, getINSReference( insKey ), null); 67 return; 68 } 69 70 73 private IOR getINSReference( String insKey ) { 74 IOR entry = ORBUtility.getIOR( orb.getLocalResolver().resolve( insKey ) ) ; 75 if( entry != null ) { 76 return entry; 79 } 80 81 throw wrapper.servantNotFound() ; 82 } 83 } 84 | Popular Tags |