KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > notification > perf > EchoServerImpl


1 package org.jacorb.test.notification.perf;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1999-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
24 import org.jacorb.test.notification.EchoServerPOA;
25 import org.omg.CORBA.Any JavaDoc;
26 import org.omg.CORBA.ORB JavaDoc;
27 import org.omg.PortableServer.POA JavaDoc;
28 import org.omg.PortableServer.POAHelper JavaDoc;
29
30 /**
31  * EchoServerImpl.java
32  *
33  *
34  * Created: Mon Apr 7 15:38:18 2003
35  *
36  * @author Alphonse Bendt
37  * @version $Id: EchoServerImpl.java,v 1.2 2004/08/01 17:55:28 alphonse.bendt Exp $
38  */

39
40 public class EchoServerImpl extends EchoServerPOA
41 {
42
43     public void acceptAny( Any JavaDoc any )
44     {}
45
46     public static void main( String JavaDoc[] args ) throws Exception JavaDoc
47     {
48         ORB JavaDoc _orb = ORB.init( args, null );
49         POA _poa = POAHelper.narrow( _orb.resolve_initial_references( "RootPOA" ) );
50
51         _poa.the_POAManager().activate();
52
53         EchoServerImpl _server = new EchoServerImpl();
54
55         // create the object reference
56
org.omg.CORBA.Object JavaDoc obj = _poa.servant_to_reference( _server );
57
58
59         // NamingContextExt _nc =
60
// NamingContextExtHelper.narrow( _orb.resolve_initial_references( "NameService" ) );
61

62         // String _factoryName = "EchoServer";
63

64         // _nc.rebind( _nc.to_name( _factoryName ), obj );
65

66
67
68         System.out.println( _orb.object_to_string( obj ) );
69         System.out.flush();
70
71         // wait for requests
72
_orb.run();
73     }
74
75 } // EchoServerImpl
76
Popular Tags