test/java/rmi/activation/ActivationSystem/unregisterGroup/UnregisterGroup.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 72,82 **** private static Exception exception = null; private static String error = null; private static boolean done = false; private static ActivateMe lastResortExitObj = null; private static final int NUM_OBJECTS = 10; ! private static int PORT = 2006; public UnregisterGroup(ActivationID id, MarshalledObject mobj) throws Exception { super(id, 0); --- 72,82 ---- private static Exception exception = null; private static String error = null; private static boolean done = false; private static ActivateMe lastResortExitObj = null; private static final int NUM_OBJECTS = 10; ! private static int registryPort = -1; public UnregisterGroup(ActivationID id, MarshalledObject mobj) throws Exception { super(id, 0);
*** 114,124 **** ActivationLibrary.deactivate(this, getID()); System.err.println("\tActivationLibrary.deactivate returned"); try { CallbackInterface cobj = ! (CallbackInterface)Naming.lookup("//:" + PORT + "/Callback"); cobj.inc(); } catch (Exception e) { System.err.println("cobj.inc exception"); e.printStackTrace(); } --- 114,124 ---- ActivationLibrary.deactivate(this, getID()); System.err.println("\tActivationLibrary.deactivate returned"); try { CallbackInterface cobj = ! (CallbackInterface)Naming.lookup("//:" + registryPort + "/Callback"); cobj.inc(); } catch (Exception e) { System.err.println("cobj.inc exception"); e.printStackTrace(); }
*** 233,243 **** // Wait for the object deactivation to take place first try { // create reg and export callback object ! registry = LocateRegistry.createRegistry(PORT); Callback robj = new Callback(); registry.bind("Callback", robj); //get the callback object int maxwait=30; --- 233,244 ---- // Wait for the object deactivation to take place first try { // create reg and export callback object ! registry = TestLibrary.createRegistryOnUnusedPort(); ! registryPort = TestLibrary.getRegistryPort(registry); Callback robj = new Callback(); registry.bind("Callback", robj); //get the callback object int maxwait=30;