KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > presentation > rmi > StubFactoryProxyImpl


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
8 package com.sun.corba.se.impl.presentation.rmi ;
9
10 import java.lang.reflect.Proxy JavaDoc ;
11
12 import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
13 import com.sun.corba.se.spi.presentation.rmi.DynamicStub ;
14
15 import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ;
16 import com.sun.corba.se.spi.orbutil.proxy.LinkedInvocationHandler ;
17
18 public class StubFactoryProxyImpl extends StubFactoryDynamicBase
19 {
20     public StubFactoryProxyImpl( PresentationManager.ClassData classData,
21     ClassLoader JavaDoc loader )
22     {
23     super( classData, loader ) ;
24     }
25
26     public org.omg.CORBA.Object JavaDoc makeStub()
27     {
28     // Construct the dynamic proxy that implements this stub
29
// using the composite handler
30
InvocationHandlerFactory factory = classData.getInvocationHandlerFactory() ;
31     LinkedInvocationHandler handler =
32         (LinkedInvocationHandler)factory.getInvocationHandler() ;
33     Class JavaDoc[] interfaces = factory.getProxyInterfaces() ;
34     DynamicStub stub = (DynamicStub)Proxy.newProxyInstance( loader, interfaces,
35         handler ) ;
36     handler.setProxy( (Proxy JavaDoc)stub ) ;
37     return stub ;
38     }
39 }
40
Popular Tags