public static void main()

in src/main/java/org/apache/openejb/cts/UnboundIdLdapRunner.java [74:98]


    public static void main(String[] args) {
        int port = 11389;
        String ldifFile = null;
        if (args.length == 1) { // it's the file
            ldifFile = args[0];
        }
        if (args.length == 2) { // first is URL and second is port
            try {
                port = Integer.parseInt(args[1]);

            } catch (final NumberFormatException e) {
                System.out.println(String.format("Could not convert ports %s. Using the default port %s",
                                                 Join.join(", ", args), port));
            }
        }

        if (ldifFile == null) {
            throw new IllegalArgumentException("LDIF file is required as first argument");
        }

        final UnboundIdLdapRunner.LdapThread thread = new UnboundIdLdapRunner.LdapThread(ldifFile, port);
        thread.setDaemon(true);
        thread.setName("LdaplServerDaemon");
        thread.start();
    }