~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to java/test/Ice/binding/Server.java

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
7
7
//
8
8
// **********************************************************************
9
9
 
10
 
public class Server
 
10
package test.Ice.binding;
 
11
 
 
12
public class Server extends test.Util.Application
11
13
{
12
 
    private static int
13
 
    run(String[] args, Ice.Communicator communicator)
 
14
    public int
 
15
    run(String[] args)
14
16
    {
15
 
        communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
 
17
        Ice.Communicator communicator = communicator();
16
18
        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
17
19
        Ice.Identity id = communicator.stringToIdentity("communicator");
18
20
        adapter.add(new RemoteCommunicatorI(), id);
19
21
        adapter.activate();
20
22
 
21
 
        communicator.waitForShutdown();
22
 
        return 0;
 
23
        return WAIT;
 
24
    }
 
25
 
 
26
    protected Ice.InitializationData getInitData(Ice.StringSeqHolder argsH)
 
27
    {
 
28
        Ice.InitializationData initData = new Ice.InitializationData();
 
29
        initData.properties = Ice.Util.createProperties(argsH);
 
30
        initData.properties.setProperty("Ice.Package.Test", "test.Ice.binding");
 
31
        initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
 
32
        return initData;
23
33
    }
24
34
 
25
35
    public static void
26
36
    main(String[] args)
27
37
    {
28
 
        int status = 0;
29
 
        Ice.Communicator communicator = null;
30
 
 
31
 
        try
32
 
        {
33
 
            communicator = Ice.Util.initialize(args);
34
 
            status = run(args, communicator);
35
 
        }
36
 
        catch(Exception ex)
37
 
        {
38
 
            ex.printStackTrace();
39
 
            status = 1;
40
 
        }
41
 
 
42
 
        if(communicator != null)
43
 
        {
44
 
            try
45
 
            {
46
 
                communicator.destroy();
47
 
            }
48
 
            catch(Ice.LocalException ex)
49
 
            {
50
 
                ex.printStackTrace();
51
 
                status = 1;
52
 
            }
53
 
        }
54
 
 
 
38
        Server app = new Server();
 
39
        int result = app.main("Server", args);
55
40
        System.gc();
56
 
        System.exit(status);
 
41
        System.exit(result);
57
42
    }
58
43
}