KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > interop > rmi > iiop > compiler > SkelFactory


1 /**
2  *
3  * Copyright 2004-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.geronimo.interop.rmi.iiop.compiler;
19
20 import java.util.HashMap JavaDoc;
21
22 import org.apache.geronimo.interop.SystemException;
23 import org.apache.geronimo.interop.rmi.iiop.RemoteObject;
24 import org.apache.geronimo.interop.util.ThreadContext;
25
26 public class SkelFactory {
27     private static SkelFactory sf = new SkelFactory();
28
29     protected SkelFactory() {
30     }
31
32     public static SkelFactory getInstance() {
33         return sf;
34     }
35
36     private static HashMap JavaDoc skelClassMap;
37
38     protected void init() {
39         skelClassMap = new HashMap JavaDoc();
40     }
41
42     /*
43     protected Class loadStub(Class remoteInterface) {
44         String className = remoteInterface.getName();
45         String skelClassName = className + "_Skeleton";
46
47         Class sc = null;
48         try {
49             sc = Class.forName(skelClassName);
50             SkelCompiler skelCompiler = new SkelCompiler(sc);
51             sc = skelCompiler.getSkelClass();
52         } catch (Exception ex) {
53             throw new SystemException(ex);
54         }
55
56         return sc;
57     }
58     */

59
60     /*
61     public RemoteObject getSkel(Class remoteInterface) {
62         System.out.println("SkelFactory.getSkel(): remoteInterface: " + remoteInterface);
63         try {
64             Class sc = (Class) skelClassMap.get(remoteInterface);
65             if (sc == null) {
66                 synchronized (skelClassMap) {
67                     sc = (Class) skelClassMap.get(remoteInterface);
68                     if (sc == null) {
69                         sc = loadStub(remoteInterface);
70                         skelClassMap.put(remoteInterface, sc);
71                     }
72                 }
73             }
74             //return (ObjectRef)sc.getInstance.invoke(sc.skelClass, ArrayUtil.EMPTY_OBJECT_ARRAY);
75             return (RemoteObject) sc.newInstance();
76         } catch (Exception ex) {
77             throw new SystemException(ex);
78         }
79     }
80     */

81
82     /*
83     public Object getSkel(String remoteInterface) {
84         return getSkel(ThreadContext.loadClass(remoteInterface));
85     }
86     */

87 }
88
Popular Tags