1 /* 2 * @(#)ActivationInstantiator.java 1.15 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.rmi.activation; 9 10 import java.rmi.MarshalledObject; 11 import java.rmi.Remote; 12 import java.rmi.RemoteException; 13 14 /** 15 * An <code>ActivationInstantiator</code> is responsible for creating 16 * instances of "activatable" objects. A concrete subclass of 17 * <code>ActivationGroup</code> implements the <code>newInstance</code> 18 * method to handle creating objects within the group. 19 * 20 * @author Ann Wollrath 21 * @version 1.15, 12/19/03 22 * @see ActivationGroup 23 * @since 1.2 24 */ 25 public interface ActivationInstantiator extends Remote { 26 27 /** 28 * The activator calls an instantiator's <code>newInstance</code> 29 * method in order to recreate in that group an object with the 30 * activation identifier, <code>id</code>, and descriptor, 31 * <code>desc</code>. The instantiator is responsible for: <ul> 32 * 33 * <li> determining the class for the object using the descriptor's 34 * <code>getClassName</code> method, 35 * 36 * <li> loading the class from the code location obtained from the 37 * descriptor (using the <code>getLocation</code> method), 38 * 39 * <li> creating an instance of the class by invoking the special 40 * "activation" constructor of the object's class that takes two 41 * arguments: the object's <code>ActivationID</code>, and the 42 * <code>MarshalledObject</code> containing object specific 43 * initialization data, and 44 * 45 * <li> returning a MarshalledObject containing the stub for the 46 * remote object it created </ul> 47 * 48 * @param id the object's activation identifier 49 * @param desc the object's descriptor 50 * @return a marshalled object containing the serialized 51 * representation of remote object's stub 52 * @exception ActivationException if object activation fails 53 * @exception RemoteException if remote call fails 54 * @since 1.2 55 */ 56 public MarshalledObject newInstance(ActivationID id, ActivationDesc desc) 57 throws ActivationException, RemoteException; 58 59 } 60