/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 4457683
* @summary After all of the remote objects (including a registry, if
* applicable) that had been exported with a given
* RMIServerSocketFactory value (including null) have been unexported,
* the server socket created for the exports should be closed (so that
* the local port is released).
* @author Peter Jones
*
* @library ../../testlibrary
* @build TestLibrary
*/
private CloseServerSocket() { }
/*
* The follow portion of this test is disabled temporarily
* because 4457683 was partially backed out because of
* 6269166; for now, only server sockets originally opened for
* exports on non-anonymous ports will be closed when all of
* the corresponding remote objects have been exported. A
* separate bug will be filed to represent the remainder of
* 4457683 for anonymous-port exports.
*/
// SSF ssf = new SSF();
// Remote impl = new CloseServerSocket();
// Remote stub = UnicastRemoteObject.exportObject(impl, 0, null, ssf);
// System.err.println("- exported object: " + stub);
// UnicastRemoteObject.unexportObject(impl, true);
// System.err.println("- unexported object");
// synchronized (ssf) {
// if (!ssf.serverSocketClosed) {
// throw new RuntimeException("TEST FAILED: " +
// "server socket not closed");
// }
// }
}
}
try {
} catch (BindException e) {
return;
}
}
boolean serverSocketClosed = false;
SSF() { };
}
super(port);
};
synchronized (SSF.this) {
serverSocketClosed = true;
}
super.close();
}
}
}
}