Read only archive ; use https://github.com/JacORB/JacORB/issues for new issues
View | Details | Raw Unified | Return to bug 967
Collapse All | Expand All

(-)a/demo/hello/src/main/java/org/jacorb/demo/hello/Client.java (-18 / +23 lines)
Lines 36-67 public class Client Link Here
36
                System.exit( -1 );
36
                System.exit( -1 );
37
            }
37
            }
38
38
39
39
            Properties p = new Properties();
40
            p.setProperty ("jacorb.log.default.verbosity","4");
41
            // contra example
42
            // p.setProperty ("jacorb.connection.client.disconnect_after_systemexception", "false");
40
            // initialize the ORB.
43
            // initialize the ORB.
41
            ORB orb = ORB.init( args, null );
44
            ORB orb = ORB.init( args, p );
42
45
43
            BufferedReader br =
46
            BufferedReader br =
44
                new BufferedReader( new FileReader( f ));
47
                new BufferedReader( new FileReader( f ));
45
48
46
            // get object reference from command-line argument file
49
            String ior = br.readLine ();
47
            org.omg.CORBA.Object obj =
48
                orb.string_to_object( br.readLine() );
49
50
50
            br.close();
51
            br.close();
51
52
52
            // and narrow it to HelloWorld.GoodDay
53
            for (int i = 0; i < 5; i++)
53
            // if this fails, a BAD_PARAM will be thrown
54
              {
54
            GoodDay goodDay = GoodDayHelper.narrow( obj );
55
                org.omg.CORBA.Object obj = orb.string_to_object( ior );
55
56
                try
56
57
                  {
57
            // invoke the operation and print the result
58
                    GoodDay goodDay = GoodDayHelper.narrow( obj );
58
            System.out.println( goodDay.hello_simple() );
59
                    System.out.println( goodDay.hello_simple() );
59
60
                    Thread.sleep (10000);
60
            // invoke the operation again and print the wide string result
61
                  }
61
            System.out.println( "wide string: " +
62
                catch( OBJECT_NOT_EXIST one)
62
                    goodDay.hello_wide( "Hello World, from 1 2 3 0 *&^%$#@!@"));
63
                  {
63
64
                    Thread.sleep (5000);
64
            goodDay.shutdown ();
65
                    br = new BufferedReader( new FileReader( f ));
66
                    ior = br.readLine ();
67
                    br.close();
68
                  }
69
              }
65
        }
70
        }
66
        catch( Exception ex )
71
        catch( Exception ex )
67
        {
72
        {
(-)a/demo/hello/src/main/java/org/jacorb/demo/hello/Server.java (-1 / +5 lines)
Lines 1-6 Link Here
1
package org.jacorb.demo.hello;
1
package org.jacorb.demo.hello;
2
2
3
import java.io.*;
3
import java.io.*;
4
import java.util.Properties;
4
5
5
import org.omg.CORBA.*;
6
import org.omg.CORBA.*;
6
import org.omg.PortableServer.*;
7
import org.omg.PortableServer.*;
Lines 10-17 public class Server Link Here
10
{
11
{
11
    public static void main(String[] args) throws Exception
12
    public static void main(String[] args) throws Exception
12
    {
13
    {
14
        Properties p = new Properties();
15
        p.setProperty ("OAPort","9999");
16
13
        //init ORB
17
        //init ORB
14
        ORB orb = ORB.init( args, null );
18
        ORB orb = ORB.init( args, p );
15
19
16
        //init POA
20
        //init POA
17
        POA poa =
21
        POA poa =

Return to bug 967