6237-remote-object-problem.diff
src/com/goldencode/p2j/client/UnitTestExports.java 2022-09-27 12:52:55 +0000 | ||
---|---|---|
1 |
/** |
|
2 |
* |
|
3 |
*/ |
|
4 |
package com.goldencode.p2j.client; |
|
5 | ||
6 |
/** |
|
7 |
* Interface to support FWD unit testing engine remote operation. |
|
8 |
*/ |
|
9 |
public interface UnitTestExports |
|
10 |
{ |
|
11 |
/** |
|
12 |
* Temporary, as an experiment |
|
13 |
*/ |
|
14 |
public void sayHello(); |
|
15 |
|
|
16 |
} |
src/com/goldencode/p2j/main/ClientCore.java 2022-09-27 16:56:48 +0000 | ||
---|---|---|
121 | 121 |
import java.util.logging.*; |
122 | 122 | |
123 | 123 |
import com.goldencode.p2j.cfg.*; |
124 |
import com.goldencode.p2j.client.*; |
|
124 | 125 |
import com.goldencode.p2j.net.*; |
125 | 126 |
import com.goldencode.p2j.directory.*; |
126 | 127 |
import com.goldencode.p2j.security.SecurityManager; |
... | ... | |
357 | 358 |
// set up current user name for client session |
358 | 359 |
ThinClient.getInstance().setUserName(params.osUserName); |
359 | 360 | |
361 |
// This remote call goes OK |
|
362 |
final RemoteErrorData red = (RemoteErrorData) RemoteObject |
|
363 |
.obtainNetworkInstance(RemoteErrorData.class); |
|
364 |
red.isSilent(); |
|
365 |
|
|
366 |
// And this one throws "Unresolvable remote export..." error |
|
367 |
final BatchProcess bp = (BatchProcess) RemoteObject |
|
368 |
.obtainNetworkInstance(BatchProcess.class); |
|
369 |
try |
|
370 |
{ |
|
371 |
bp.launch("bla-bla"); |
|
372 |
} |
|
373 |
catch (Throwable e) |
|
374 |
{ |
|
375 |
System.err.println(e); |
|
376 |
} |
|
377 |
|
|
378 |
// This one either throws "Unresolvable remote export.." error |
|
379 |
final UnitTestExports unitTestSupport = (UnitTestExports) RemoteObject |
|
380 |
.obtainNetworkInstance(UnitTestExports.class, session); |
|
381 |
try { |
|
382 |
unitTestSupport.sayHello(); |
|
383 |
} catch (Throwable e) { |
|
384 |
System.err.println(e); |
|
385 |
} |
|
386 |
|
|
360 | 387 |
// call the application |
361 | 388 |
running = main.standardEntry(); |
362 | 389 |
|
src/com/goldencode/p2j/main/StandardServer.java 2022-09-27 13:50:08 +0000 | ||
---|---|---|
271 | 271 |
import com.goldencode.p2j.cfg.*; |
272 | 272 |
import com.goldencode.p2j.cfg.Configuration; |
273 | 273 |
import com.goldencode.p2j.classloader.*; |
274 |
import com.goldencode.p2j.client.*; |
|
274 | 275 |
import com.goldencode.p2j.directory.*; |
275 | 276 |
import com.goldencode.p2j.net.*; |
276 | 277 |
import com.goldencode.p2j.persist.*; |
... | ... | |
280 | 281 |
import com.goldencode.p2j.security.*; |
281 | 282 |
import com.goldencode.p2j.security.SecurityManager; |
282 | 283 |
import com.goldencode.p2j.soap.*; |
284 |
import com.goldencode.p2j.testengine.*; |
|
283 | 285 |
import com.goldencode.p2j.ui.*; |
284 | 286 |
import com.goldencode.p2j.util.*; |
285 | 287 |
import com.goldencode.p2j.util.ErrorManager; |
... | ... | |
985 | 987 |
|
986 | 988 |
ifaces = new Class[] { ServerPropertiesInspector.class }; |
987 | 989 |
RemoteObject.registerStaticNetworkServer(ifaces, ServerPropertiesDaemon.class); |
988 |
|
|
990 |
|
|
991 |
RemoteObject.registerStaticNetworkServer(new Class[] { UnitTestExports.class }, UnitTestServer.class); |
|
992 | ||
989 | 993 |
AdminServerImpl.initialize(); |
990 | 994 |
|
991 | 995 |
DirectoryManager.initServer(); |
... | ... | |
1107 | 1111 |
* @param ds |
1108 | 1112 |
* The directory service. |
1109 | 1113 |
*/ |
1110 |
private void initClassLoaders(DirectoryService ds) |
|
1114 |
private static void initClassLoaders(DirectoryService ds)
|
|
1111 | 1115 |
{ |
1112 | 1116 |
// initialize the class loaders for the jars defined in the directory |
1113 | 1117 |
String path = Utils.findDirectoryNodePath(ds, |
src/com/goldencode/p2j/testengine/UnitTestServer.java 2022-09-27 13:50:09 +0000 | ||
---|---|---|
1 |
package com.goldencode.p2j.testengine; |
|
2 | ||
3 |
import com.goldencode.p2j.client.*; |
|
4 | ||
5 |
/** |
|
6 |
* FWD unit testing engine remote operation server-side implementation. |
|
7 |
* Contains static method implementing {@link UnitTestExports} interface. |
|
8 |
*/ |
|
9 |
public class UnitTestServer |
|
10 |
{ |
|
11 | ||
12 |
/** |
|
13 |
* |
|
14 |
*/ |
|
15 |
public static void sayHello() |
|
16 |
{ |
|
17 |
System.err.println("Hello!"); |
|
18 |
} |
|
19 | ||
20 |
} |