1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43:
44: import ;
45: import ;
46: import ;
47: import ;
48:
49: public class Util
50: {
51:
52: private static UtilDelegate delegate;
53: static
54: {
55: try
56: {
57: delegate = (UtilDelegate)DelegateFactory.getInstance("Util");
58: }
59: catch(GetDelegateInstanceException e)
60: {
61: delegate = null;
62: }
63: }
64:
65: private Util()
66: {
67: }
68:
69:
70: public static Object copyObject(Object obj, javax.rmi.ORB orb)
71: throws RemoteException
72: {
73: if(delegate != null)
74: return delegate.copyObject(obj, orb);
75: else
76: return null;
77: }
78:
79:
80: public static Object[] copyObjects(Object obj[], javax.rmi.ORB orb)
81: throws RemoteException
82: {
83: if(delegate != null)
84: return delegate.copyObjects(obj, orb);
85: else
86: return null;
87: }
88:
89: public static ValueHandler createValueHandler()
90: {
91: if(delegate != null)
92: return delegate.createValueHandler();
93: else
94: return null;
95: }
96:
97: public static String getCodebase(Class clz)
98: {
99: if(delegate != null)
100: return delegate.getCodebase(clz);
101: else
102: return null;
103: }
104:
105: public static Tie getTie(Remote target)
106: {
107: if(delegate != null)
108: return delegate.getTie(target);
109: else
110: return null;
111: }
112:
113: public static boolean isLocal(Stub stub)
114: throws RemoteException
115: {
116: if(delegate != null)
117: return delegate.isLocal(stub);
118: else
119: return false;
120: }
121:
122: public static Class loadClass(String className, String remoteCodebase, ClassLoader loader)
123: throws ClassNotFoundException
124: {
125: if(delegate != null)
126: return delegate.loadClass(className, remoteCodebase, loader);
127: else
128: throw new ClassNotFoundException(className + ": delegate == null");
129: }
130:
131: public static RemoteException mapSystemException(SystemException ex)
132: {
133: if(delegate != null)
134: return delegate.mapSystemException(ex);
135: else
136: return null;
137: }
138:
139: public static Object readAny(InputStream in)
140: {
141: if(delegate != null)
142: return delegate.readAny(in);
143: else
144: return null;
145: }
146:
147: public static void registerTarget(Tie tie, Remote target)
148: {
149: if(delegate != null)
150: delegate.registerTarget(tie, target);
151: }
152:
153: public static void unexportObject(Remote target)
154: {
155: if(delegate != null)
156: delegate.unexportObject(target);
157: }
158:
159: public static RemoteException wrapException(Throwable orig)
160: {
161: if(delegate != null)
162: return delegate.wrapException(orig);
163: else
164: return null;
165: }
166:
167: public static void writeAbstractObject(OutputStream out, Object obj)
168: {
169: if(delegate != null)
170: delegate.writeAbstractObject(out, obj);
171: }
172:
173: public static void writeAny(OutputStream out, Object obj)
174: {
175: if(delegate != null)
176: delegate.writeAny(out, obj);
177: }
178:
179: public static void writeRemoteObject(OutputStream out, Object obj)
180: {
181: if(delegate != null)
182: delegate.writeRemoteObject(out, obj);
183: }
184:
185: }