< prev index next >

test/javax/management/remote/mandatory/connection/MultiThreadDeadLockTest.java

Print this page
rev 11832 : 8078896: Add @modules as needed to the jdk_svc tests
Reviewed-by: alanb, mchung
   1 /*
   2  * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  28 import java.rmi.server.RMIClientSocketFactory;
  29 import java.util.HashMap;
  30 import javax.management.MBeanServer;
  31 import javax.management.MBeanServerFactory;
  32 import javax.management.Notification;
  33 import javax.management.NotificationBroadcasterSupport;
  34 import javax.management.NotificationListener;
  35 import javax.management.ObjectName;
  36 import javax.management.remote.JMXConnector;
  37 import javax.management.remote.JMXConnectorFactory;
  38 import javax.management.remote.JMXConnectorServer;
  39 import javax.management.remote.JMXConnectorServerFactory;
  40 import javax.management.remote.JMXServiceURL;
  41 import javax.management.remote.rmi.RMIConnectorServer;
  42 
  43 /*
  44  * @test
  45  * @bug 6697180
  46  * @summary test on a client notification deadlock.
  47  * @author Shanliang JIANG

  48  * @run clean MultiThreadDeadLockTest
  49  * @run build MultiThreadDeadLockTest
  50  * @run main MultiThreadDeadLockTest
  51  */
  52 
  53 public class MultiThreadDeadLockTest {
  54 
  55     private static long serverTimeout = 500L;
  56 
  57     public static void main(String[] args) throws Exception {
  58         print("Create the MBean server");
  59         MBeanServer mbs = MBeanServerFactory.createMBeanServer();
  60 
  61         print("Initialize environment map");
  62         HashMap env = new HashMap();
  63 
  64         print("Specify a client socket factory to control socket creation.");
  65         env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
  66                 clientFactory);
  67 


   1 /*
   2  * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */


  28 import java.rmi.server.RMIClientSocketFactory;
  29 import java.util.HashMap;
  30 import javax.management.MBeanServer;
  31 import javax.management.MBeanServerFactory;
  32 import javax.management.Notification;
  33 import javax.management.NotificationBroadcasterSupport;
  34 import javax.management.NotificationListener;
  35 import javax.management.ObjectName;
  36 import javax.management.remote.JMXConnector;
  37 import javax.management.remote.JMXConnectorFactory;
  38 import javax.management.remote.JMXConnectorServer;
  39 import javax.management.remote.JMXConnectorServerFactory;
  40 import javax.management.remote.JMXServiceURL;
  41 import javax.management.remote.rmi.RMIConnectorServer;
  42 
  43 /*
  44  * @test
  45  * @bug 6697180
  46  * @summary test on a client notification deadlock.
  47  * @author Shanliang JIANG
  48  * @modules java.management
  49  * @run clean MultiThreadDeadLockTest
  50  * @run build MultiThreadDeadLockTest
  51  * @run main MultiThreadDeadLockTest
  52  */
  53 
  54 public class MultiThreadDeadLockTest {
  55 
  56     private static long serverTimeout = 500L;
  57 
  58     public static void main(String[] args) throws Exception {
  59         print("Create the MBean server");
  60         MBeanServer mbs = MBeanServerFactory.createMBeanServer();
  61 
  62         print("Initialize environment map");
  63         HashMap env = new HashMap();
  64 
  65         print("Specify a client socket factory to control socket creation.");
  66         env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE,
  67                 clientFactory);
  68 


< prev index next >