DownloadParameterClass.java revision 0
0N/A * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * @summary The class loader used to load classes for parameter types sent in 0N/A * an RMI call to an activatable object should delegate to the class loader 0N/A * that loaded the class of the activatable object itself, to maximize the 0N/A * likelihood of type compatibility between downloaded parameter types and 0N/A * supertypes shared with the activatable object. 0N/A * @author Peter Jones (much code taken from Ann Wollrath's activation tests) 0N/A * @library ../../../testlibrary 0N/A * @build TestLibrary RMID ActivationLibrary 0N/A * @build DownloadParameterClass 0N/A * @build FooReceiverImpl 0N/A * @build FooReceiverImpl_Stub 0N/A * The interface can't actually declare that the method takes a 0N/A * Foo, because then Foo would have to be in the test's CLASSPATH, 0N/A * which might get propagated to the group VM's CLASSPATH, which 0N/A * would nullify the test (the Foo supertype must be loaded in the 0N/A * group VM only through the class loader that loaded the 0N/A * activatable object). 0N/A * Install classes to be seen by the activatable object's class 0N/A * loader in the "codebase1" subdirectory of working directory, and 0N/A * install the subtype to be downloaded into the activatable object 0N/A * into the "codebase2" subdirectory. 0N/A /* Cause activation groups to have a security policy that will 0N/A * allow security managers to be downloaded and installed 0N/A // activation groups 0N/A p.
put(
"java.security.manager",
0N/A * Create and register descriptors for activatable object in a 0N/A * group other than this VM's group, so that another VM will be 0N/A * spawned with the object is activated. 0N/A * Create an instance of the subtype to be downloaded by the 0N/A * activatable object. The codebase must be a path including 0N/A * "codebase1" as well as "codebase2" because the supertype 0N/A * must be visible here as well; the supertype cannot be 0N/A * installed in both codebases (like it would be in a typical 0N/A * setup) because of the trivial installation mechanism used 0N/A * below, and see the comment above for why it can't be in 0N/A * the test's CLASSPATH.