KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > bugs > bug384 > BImpl


1 package org.jacorb.test.bugs.bug384;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2003 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import org.omg.CORBA.*;
24 import org.omg.PortableServer.*;
25
26 public class BImpl extends BPOA
27 {
28    public BImpl()
29    {
30    }
31
32    public static void main(String JavaDoc[] args)
33    {
34       System.setProperty ("jacorb.implname", "BImpl");
35
36       if( args.length != 0 )
37       {
38          System.out.println(
39             "Usage: jaco org.jacorb.test.bugs.bug384.BImpl");
40          System.exit( 1 );
41       }
42
43       try
44       {
45          //init ORB
46
ORB orb = ORB.init( args, null );
47
48          //init POA
49
POA poa =
50          POAHelper.narrow( orb.resolve_initial_references( "RootPOA" ));
51
52          poa.the_POAManager().activate();
53
54          BImpl s = new BImpl();
55
56          // create the object reference
57
org.omg.CORBA.Object JavaDoc obj =
58          poa.servant_to_reference( s );
59
60          String JavaDoc ior = orb.object_to_string( obj );
61
62          System.out.println( "IOR is " + ior );
63
64          // wait for requests
65
// orb.run();
66
}
67       catch( Exception JavaDoc e )
68       {
69          System.out.println( e );
70       }
71    }
72 }
73
Popular Tags