-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReverseClient.java
44 lines (32 loc) · 1.14 KB
/
ReverseClient.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
// Client
import ReverseModule.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CORBA.*;
import java.io.*;
class ReverseClient
{
public static void main(String args[])
{
Reverse ReverseImpl=null;
try
{
// initialize the ORB object request broker
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService");
NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef);
String name = "Reverse";
// narrow converts generic object into string type
ReverseImpl = ReverseHelper.narrow(ncRef.resolve_str(name));
System.out.println("Enter String=");
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str= br.readLine();
String tempStr= ReverseImpl.reverse_string(str);
System.out.println(tempStr);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}