376N/A/*
376N/A * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
376N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
376N/A *
376N/A * This code is free software; you can redistribute it and/or modify it
376N/A * under the terms of the GNU General Public License version 2 only, as
376N/A * published by the Free Software Foundation.
376N/A *
376N/A * This code is distributed in the hope that it will be useful, but WITHOUT
376N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376N/A * version 2 for more details (a copy is included in the LICENSE file that
376N/A * accompanied this code).
376N/A *
376N/A * You should have received a copy of the GNU General Public License version
376N/A * 2 along with this work; if not, write to the Free Software Foundation,
376N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
376N/A *
376N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
376N/A * or visit www.oracle.com if you need additional information or have any
376N/A * questions.
376N/A */
376N/A
376N/Aimport java.rmi.*;
376N/Aimport java.rmi.activation.*;
376N/A
376N/Apublic class ExtLoadedImpl implements CheckLoader {
376N/A
376N/A public ExtLoadedImpl(ActivationID id, MarshalledObject obj)
376N/A throws ActivationException, RemoteException
376N/A {
376N/A Activatable.exportObject(this, id, 0);
376N/A }
376N/A
376N/A public boolean isCorrectContextLoader() {
376N/A ClassLoader contextLoader =
376N/A Thread.currentThread().getContextClassLoader();
376N/A ClassLoader implLoader = this.getClass().getClassLoader();
376N/A if (contextLoader == implLoader) {
376N/A System.err.println("contextLoader same as implLoader");
376N/A return false;
376N/A } else if (contextLoader.getParent() == implLoader) {
376N/A System.err.println("contextLoader is child of implLoader");
376N/A return true;
376N/A } else {
376N/A System.err.println("unknown loader relationship");
376N/A return false;
376N/A }
376N/A }
376N/A}
376N/A