jdk/test/javax/management/remote/mandatory/connection/ReconnectTest.java
changeset 4156 acaa49a2768a
parent 1247 b4c26443dee5
child 5506 202f599c92aa
equal deleted inserted replaced
4155:460e37d40f12 4156:acaa49a2768a
     1 /*
     1 /*
     2  * Copyright 2003-2008 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    31  * @run main ReconnectTest
    31  * @run main ReconnectTest
    32  */
    32  */
    33 
    33 
    34 import java.util.*;
    34 import java.util.*;
    35 import java.net.MalformedURLException;
    35 import java.net.MalformedURLException;
       
    36 import java.io.IOException;
    36 
    37 
    37 import javax.management.*;
    38 import javax.management.*;
    38 import javax.management.remote.*;
    39 import javax.management.remote.*;
    39 import javax.management.remote.rmi.RMIConnectorServer;
       
    40 
    40 
    41 public class ReconnectTest {
    41 public class ReconnectTest {
    42     private static final String[] protocols = {"rmi", "iiop", "jmxmp"};
    42     private static final String[] protocols = {"rmi", "iiop", "jmxmp"};
    43     private static final MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    43     private static final MBeanServer mbs = MBeanServerFactory.createMBeanServer();
    44 
    44 
    46 
    46 
    47     static {
    47     static {
    48         String timeout = "1000";
    48         String timeout = "1000";
    49         env.put("jmx.remote.x.server.connection.timeout", timeout);
    49         env.put("jmx.remote.x.server.connection.timeout", timeout);
    50         env.put("jmx.remote.x.client.connection.check.period", timeout);
    50         env.put("jmx.remote.x.client.connection.check.period", timeout);
    51         env.put(RMIConnectorServer.DELEGATE_TO_EVENT_SERVICE, "false");
       
    52     }
    51     }
    53 
    52 
    54     public static void main(String[] args) throws Exception {
    53     public static void main(String[] args) throws Exception {
    55         System.out.println(">>> test to reconnect.");
    54         System.out.println(">>> test to reconnect.");
    56 
    55