-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHello_Stub.java
45 lines (40 loc) · 1.52 KB
/
Hello_Stub.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Decompiled by DJ v3.2.2.67 Copyright 2002 Atanas Neshkov Date: 1/22/03 1:40:21 AM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
import java.io.*;
import java.lang.*;
import java.lang.reflect.*;
import java.util.*;
import java.rmi.*;
import java.rmi.server.*;
import java.net.*;
public final class Hello_Stub extends NERemoteObjectStub implements HelloInterface, NERemote {
public String sayHello (String s) throws NERemoteException {
try {
Class<?>[] argTypes = { String.class };
Serializable[] arguments = { s };
NEMessageable message =
new NEMethodInvocation
(getKey (), HelloInterface.class, "sayHello", argTypes, arguments);
Socket reg = new Socket ("localhost", 5000);
NEMarshaller.marshal (message, reg.getOutputStream ());
Scanner inp = new Scanner (System.in);
inp.nextLine ();
ObjectInputStream in = new ObjectInputStream (reg.getInputStream ());
NEReturnValue rv = (NEReturnValue) in.readObject ();
String result = (String) NEDemarshaller.demarshalReturnValue (rv);
return result;
}
catch (RuntimeException runtimeexception) {
throw runtimeexception;
}
catch (NERemoteException remoteexception) {
throw remoteexception;
}
catch (Exception exception) {
//throw new UnexpectedException("undeclared checked exception", exception);
exception.printStackTrace ();
}
return null;
}
}