ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/ClientMain.java
Revision: 1.1
Committed: Sat Feb 3 04:51:50 2001 UTC (23 years, 3 months ago) by tdb
Branch: MAIN
Log Message:
Basic starting files for the Local Clients.

File Contents

# User Rev Content
1 tdb 1.1 package uk.ac.ukc.iscream.client;
2    
3     import uk.ac.ukc.iscream.client.*;
4     import uk.ac.ukc.iscream.clientinterface.*;
5     import uk.ac.ukc.iscream.componentmanager.*;
6     import org.omg.CosNaming.*;
7     import org.omg.CORBA.*;
8     import org.omg.PortableServer.*;
9    
10     public class ClientMain {
11     public static void main(String args[]) {
12     System.setProperty("org.omg.CORBA.ORBClass","jacorb.orb.ORB");
13     System.setProperty("org.omg.CORBA.ORBSingletonClass","jacorb.orb.ORBSingleton");
14     try {
15     ReferenceManager _refman = ReferenceManager.getInstance();
16     _refman.activatePOA();
17    
18     ClientServant corbaServant = new ClientServant();
19     org.omg.CORBA.Object o = _refman.getRootPOA().servant_to_reference(corbaServant);
20     Client client = ClientHelper.narrow(o);
21    
22     o = _refman.getCORBARef("iscream.ClientInterface.CorbaListener");
23     CorbaClientListener lRef = CorbaClientListenerHelper.narrow(o);
24    
25     boolean result;
26     CorbaHandler handler = lRef.connect("CorbaTest", client);
27     result = handler.startData();
28     System.out.println(result);
29     Thread.sleep(15000);
30     result = handler.stopData();
31     System.out.println(result);
32    
33     _refman.getORB().run();
34    
35     }
36     catch (Exception e) {
37     System.out.println("ERROR : " + e);
38     e.printStackTrace(System.out);
39     }
40     }
41    
42     }