1. /*
  2. * @(#)StubFactoryProxyImpl.java 1.11 04/06/21
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.corba.se.impl.presentation.rmi ;
  8. import java.lang.reflect.Proxy ;
  9. import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
  10. import com.sun.corba.se.spi.presentation.rmi.DynamicStub ;
  11. import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ;
  12. import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ;
  13. public class StubFactoryProxyImpl extends StubFactoryDynamicBase
  14. {
  15. public StubFactoryProxyImpl( PresentationManager.ClassData classData,
  16. ClassLoader loader )
  17. {
  18. super( classData, loader ) ;
  19. }
  20. public org.omg.CORBA.Object makeStub()
  21. {
  22. // Construct the dynamic proxy that implements this stub
  23. // using the composite handler
  24. InvocationHandlerFactory factory = classData.getInvocationHandlerFactory() ;
  25. LinkedInvocationHandler handler =
  26. (LinkedInvocationHandler)factory.getInvocationHandler() ;
  27. Class[] interfaces = factory.getProxyInterfaces() ;
  28. DynamicStub stub = (DynamicStub)Proxy.newProxyInstance( loader, interfaces,
  29. handler ) ;
  30. handler.setProxy( (Proxy)stub ) ;
  31. return stub ;
  32. }
  33. }