0N/A/*
2362N/A * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
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
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
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 *
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 *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.rmi.activation;
0N/A
0N/Aimport java.rmi.MarshalledObject;
0N/Aimport java.rmi.Remote;
0N/Aimport java.rmi.RemoteException;
0N/Aimport java.rmi.activation.UnknownObjectException;
0N/A
0N/A/**
0N/A * The <code>Activator</code> facilitates remote object activation. A
0N/A * "faulting" remote reference calls the activator's
0N/A * <code>activate</code> method to obtain a "live" reference to a
0N/A * "activatable" remote object. Upon receiving a request for activation,
0N/A * the activator looks up the activation descriptor for the activation
0N/A * identifier, <code>id</code>, determines the group in which the
0N/A * object should be activated initiates object re-creation via the
0N/A * group's <code>ActivationInstantiator</code> (via a call to the
0N/A * <code>newInstance</code> method). The activator initiates the
0N/A * execution of activation groups as necessary. For example, if an
0N/A * activation group for a specific group identifier is not already
0N/A * executing, the activator initiates the execution of a VM for the
0N/A * group. <p>
0N/A *
0N/A * The <code>Activator</code> works closely with
0N/A * <code>ActivationSystem</code>, which provides a means for registering
0N/A * groups and objects within those groups, and <code>ActivationMonitor</code>,
0N/A * which recives information about active and inactive objects and inactive
0N/A * groups. <p>
0N/A *
0N/A * The activator is responsible for monitoring and detecting when
0N/A * activation groups fail so that it can remove stale remote references
0N/A * to groups and active object's within those groups.<p>
0N/A *
0N/A * @author Ann Wollrath
0N/A * @see ActivationInstantiator
0N/A * @see ActivationGroupDesc
0N/A * @see ActivationGroupID
0N/A * @since 1.2
0N/A */
0N/Apublic interface Activator extends Remote {
0N/A /**
0N/A * Activate the object associated with the activation identifier,
0N/A * <code>id</code>. If the activator knows the object to be active
0N/A * already, and <code>force</code> is false , the stub with a
0N/A * "live" reference is returned immediately to the caller;
0N/A * otherwise, if the activator does not know that corresponding
0N/A * the remote object is active, the activator uses the activation
0N/A * descriptor information (previously registered) to determine the
0N/A * group (VM) in which the object should be activated. If an
0N/A * <code>ActivationInstantiator</code> corresponding to the
0N/A * object's group descriptor already exists, the activator invokes
0N/A * the activation group's <code>newInstance</code> method passing
0N/A * it the object's id and descriptor. <p>
0N/A *
0N/A * If the activation group for the object's group descriptor does
0N/A * not yet exist, the activator starts an
0N/A * <code>ActivationInstantiator</code> executing (by spawning a
0N/A * child process, for example). When the activator receives the
0N/A * activation group's call back (via the
0N/A * <code>ActivationSystem</code>'s <code>activeGroup</code>
0N/A * method) specifying the activation group's reference, the
0N/A * activator can then invoke that activation instantiator's
0N/A * <code>newInstance</code> method to forward each pending
0N/A * activation request to the activation group and return the
0N/A * result (a marshalled remote object reference, a stub) to the
0N/A * caller.<p>
0N/A *
0N/A * Note that the activator receives a "marshalled" object instead of a
0N/A * Remote object so that the activator does not need to load the
0N/A * code for that object, or participate in distributed garbage
0N/A * collection for that object. If the activator kept a strong
0N/A * reference to the remote object, the activator would then
0N/A * prevent the object from being garbage collected under the
0N/A * normal distributed garbage collection mechanism. <p>
0N/A *
0N/A * @param id the activation identifier for the object being activated
0N/A * @param force if true, the activator contacts the group to obtain
0N/A * the remote object's reference; if false, returning the cached value
0N/A * is allowed.
0N/A * @return the remote object (a stub) in a marshalled form
0N/A * @exception ActivationException if object activation fails
0N/A * @exception UnknownObjectException if object is unknown (not registered)
0N/A * @exception RemoteException if remote call fails
0N/A * @since 1.2
0N/A */
0N/A public MarshalledObject<? extends Remote> activate(ActivationID id,
0N/A boolean force)
0N/A throws ActivationException, UnknownObjectException, RemoteException;
0N/A
0N/A}