Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/rmi/activation/ActivationInstantiator.java
38918 views
/*1* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.rmi.activation;2627import java.rmi.MarshalledObject;28import java.rmi.Remote;29import java.rmi.RemoteException;3031/**32* An <code>ActivationInstantiator</code> is responsible for creating33* instances of "activatable" objects. A concrete subclass of34* <code>ActivationGroup</code> implements the <code>newInstance</code>35* method to handle creating objects within the group.36*37* @author Ann Wollrath38* @see ActivationGroup39* @since 1.240*/41public interface ActivationInstantiator extends Remote {4243/**44* The activator calls an instantiator's <code>newInstance</code>45* method in order to recreate in that group an object with the46* activation identifier, <code>id</code>, and descriptor,47* <code>desc</code>. The instantiator is responsible for: <ul>48*49* <li> determining the class for the object using the descriptor's50* <code>getClassName</code> method,51*52* <li> loading the class from the code location obtained from the53* descriptor (using the <code>getLocation</code> method),54*55* <li> creating an instance of the class by invoking the special56* "activation" constructor of the object's class that takes two57* arguments: the object's <code>ActivationID</code>, and the58* <code>MarshalledObject</code> containing object specific59* initialization data, and60*61* <li> returning a MarshalledObject containing the stub for the62* remote object it created </ul>63*64* @param id the object's activation identifier65* @param desc the object's descriptor66* @return a marshalled object containing the serialized67* representation of remote object's stub68* @exception ActivationException if object activation fails69* @exception RemoteException if remote call fails70* @since 1.271*/72public MarshalledObject<? extends Remote> newInstance(ActivationID id,73ActivationDesc desc)74throws ActivationException, RemoteException;75}767778