1 7 8 package com.sun.corba.se.impl.presentation.rmi; 9 10 import java.rmi.Remote ; 11 import javax.rmi.CORBA.Tie ; 12 13 import javax.rmi.CORBA.Util ; 14 15 import org.omg.CORBA.CompletionStatus ; 16 17 import org.omg.CORBA.portable.IDLEntity ; 18 19 import com.sun.corba.se.spi.presentation.rmi.PresentationManager; 20 import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults; 21 22 import com.sun.corba.se.spi.orb.ORB; 23 24 import com.sun.corba.se.spi.logging.CORBALogDomains ; 25 26 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 27 28 public abstract class StubFactoryFactoryDynamicBase extends 29 StubFactoryFactoryBase 30 { 31 protected final ORBUtilSystemException wrapper ; 32 33 public StubFactoryFactoryDynamicBase() 34 { 35 wrapper = ORBUtilSystemException.get( 36 CORBALogDomains.RPC_PRESENTATION ) ; 37 } 38 39 public PresentationManager.StubFactory createStubFactory( 40 String className, boolean isIDLStub, String remoteCodeBase, 41 Class expectedClass, ClassLoader classLoader) 42 { 43 Class cls = null ; 44 45 try { 46 cls = Util.loadClass( className, remoteCodeBase, classLoader ) ; 47 } catch (ClassNotFoundException exc) { 48 throw wrapper.classNotFound3( 49 CompletionStatus.COMPLETED_MAYBE, exc, className ) ; 50 } 51 52 PresentationManager pm = ORB.getPresentationManager() ; 53 54 if (IDLEntity .class.isAssignableFrom( cls ) && 55 !Remote .class.isAssignableFrom( cls )) { 56 PresentationManager.StubFactoryFactory sff = 58 pm.getStubFactoryFactory( false ) ; 59 PresentationManager.StubFactory sf = 60 sff.createStubFactory( className, true, remoteCodeBase, 61 expectedClass, classLoader ) ; 62 return sf ; 63 } else { 64 PresentationManager.ClassData classData = pm.getClassData( cls ) ; 65 return makeDynamicStubFactory( pm, classData, classLoader ) ; 66 } 67 } 68 69 public abstract PresentationManager.StubFactory makeDynamicStubFactory( 70 PresentationManager pm, PresentationManager.ClassData classData, 71 ClassLoader classLoader ) ; 72 73 public Tie getTie( Class cls ) 74 { 75 PresentationManager pm = ORB.getPresentationManager() ; 76 return new ReflectiveTie( pm, wrapper ) ; 77 } 78 79 public boolean createsDynamicStubs() 80 { 81 return true ; 82 } 83 } 84 | Popular Tags |