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

« back to all changes in this revision

Viewing changes to java/test/Ice/package/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
 
// **********************************************************************
2
 
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
4
 
//
5
 
// This copy of Ice is licensed to you under the terms described in the
6
 
// ICE_LICENSE file included in this distribution.
7
 
//
8
 
// **********************************************************************
9
 
 
10
 
public class Server
11
 
{
12
 
    private static int
13
 
    run(String[] args, Ice.Communicator communicator)
14
 
    {
15
 
        communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010 -t 10000");
16
 
        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
17
 
        Ice.Object object = new InitialI();
18
 
        adapter.add(object, communicator.stringToIdentity("initial"));
19
 
        adapter.activate();
20
 
        communicator.waitForShutdown();
21
 
        return 0;
22
 
    }
23
 
 
24
 
    public static void
25
 
    main(String[] args)
26
 
    {
27
 
        int status = 0;
28
 
        Ice.Communicator communicator = null;
29
 
 
30
 
        try
31
 
        {
32
 
            communicator = Ice.Util.initialize(args);
33
 
            status = run(args, communicator);
34
 
        }
35
 
        catch(Exception ex)
36
 
        {
37
 
            ex.printStackTrace();
38
 
            status = 1;
39
 
        }
40
 
 
41
 
        if(communicator != null)
42
 
        {
43
 
            try
44
 
            {
45
 
                communicator.destroy();
46
 
            }
47
 
            catch(Ice.LocalException ex)
48
 
            {
49
 
                ex.printStackTrace();
50
 
                status = 1;
51
 
            }
52
 
        }
53
 
 
54
 
        System.gc();
55
 
        System.exit(status);
56
 
    }
57
 
}