|
From: Michael R. <mr...@us...> - 2004-08-10 13:29:17
|
Update of /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dsi/poa In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7788/src/examples/org/openorb/orb/examples/dsi/poa Modified Files: Client.java Added Files: Server.java Removed Files: DynServer.java Log Message: Fixed the remaining checkstyle warnings --- NEW FILE: Server.java --- /* * Copyright (C) The Community OpenORB Project. All rights reserved. * * This software is published under the terms of The OpenORB Community Software * License version 1.0, a copy of which has been included with this distribution * in the LICENSE.txt file. */ package org.openorb.orb.examples.dsi.poa; public final class Server { // do not instantiate private Server() { } public static void main( String[] args ) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); org.omg.CORBA.Object objPoa = null; org.omg.PortableServer.POA rootPOA = null; try { objPoa = orb.resolve_initial_references( "RootPOA" ); } catch ( org.omg.CORBA.ORBPackage.InvalidName ex ) { System.out.println( "Couldn't find RootPOA!" ); System.exit( 1 ); } rootPOA = org.omg.PortableServer.POAHelper.narrow( objPoa ); DynSkeleton skeleton = new DynSkeleton( orb ); byte[] servantId = null; try { servantId = rootPOA.activate_object( skeleton ); } catch ( org.omg.PortableServer.POAPackage.WrongPolicy ex ) { ex.printStackTrace(); } catch ( org.omg.PortableServer.POAPackage.ServantAlreadyActive ex ) { ex.printStackTrace(); } org.omg.CORBA.Object obj = null; try { obj = rootPOA.id_to_reference( servantId ); } catch ( org.omg.PortableServer.POAPackage.WrongPolicy ex ) { ex.printStackTrace(); } catch ( org.omg.PortableServer.POAPackage.ObjectNotActive ex ) { ex.printStackTrace(); } String reference = orb.object_to_string( obj ); try { java.io.FileOutputStream file = new java.io.FileOutputStream( "ObjectId" ); java.io.PrintStream pfile = new java.io.PrintStream( file ); pfile.println( reference ); file.close(); } catch ( java.io.IOException ex ) { System.out.println( "File error" ); } try { rootPOA.the_POAManager().activate(); System.out.println( "The server is ready..." ); orb.run(); } catch ( Exception ex ) { ex.printStackTrace(); } } } Index: Client.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/examples/org/openorb/orb/examples/dsi/poa/Client.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Client.java 16 Feb 2004 09:41:53 -0000 1.3 +++ Client.java 10 Aug 2004 13:28:38 -0000 1.4 @@ -8,8 +8,13 @@ package org.openorb.orb.examples.dsi.poa; -public class Client +public final class Client { + // do not instantiate + private Client() + { + } + public static void main( String[] args ) { org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init( args, null ); --- DynServer.java DELETED --- |