Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/rmi/activation/ActivationSystem.java
38918 views
/*1* Copyright (c) 1997, 2003, 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.Remote;28import java.rmi.RemoteException;29import java.rmi.activation.UnknownGroupException;30import java.rmi.activation.UnknownObjectException;3132/**33* The <code>ActivationSystem</code> provides a means for registering34* groups and "activatable" objects to be activated within those groups.35* The <code>ActivationSystem</code> works closely with the36* <code>Activator</code>, which activates objects registered via the37* <code>ActivationSystem</code>, and the <code>ActivationMonitor</code>,38* which obtains information about active and inactive objects,39* and inactive groups.40*41* @author Ann Wollrath42* @see Activator43* @see ActivationMonitor44* @since 1.245*/46public interface ActivationSystem extends Remote {4748/** The port to lookup the activation system. */49public static final int SYSTEM_PORT = 1098;5051/**52* The <code>registerObject</code> method is used to register an53* activation descriptor, <code>desc</code>, and obtain an54* activation identifier for a activatable remote object. The55* <code>ActivationSystem</code> creates an56* <code>ActivationID</code> (a activation identifier) for the57* object specified by the descriptor, <code>desc</code>, and58* records, in stable storage, the activation descriptor and its59* associated identifier for later use. When the <code>Activator</code>60* receives an <code>activate</code> request for a specific identifier, it61* looks up the activation descriptor (registered previously) for62* the specified identifier and uses that information to activate63* the object. <p>64*65* @param desc the object's activation descriptor66* @return the activation id that can be used to activate the object67* @exception ActivationException if registration fails (e.g., database68* update failure, etc).69* @exception UnknownGroupException if group referred to in70* <code>desc</code> is not registered with this system71* @exception RemoteException if remote call fails72* @since 1.273*/74public ActivationID registerObject(ActivationDesc desc)75throws ActivationException, UnknownGroupException, RemoteException;7677/**78* Remove the activation id and associated descriptor previously79* registered with the <code>ActivationSystem</code>; the object80* can no longer be activated via the object's activation id.81*82* @param id the object's activation id (from previous registration)83* @exception ActivationException if unregister fails (e.g., database84* update failure, etc).85* @exception UnknownObjectException if object is unknown (not registered)86* @exception RemoteException if remote call fails87* @since 1.288*/89public void unregisterObject(ActivationID id)90throws ActivationException, UnknownObjectException, RemoteException;9192/**93* Register the activation group. An activation group must be94* registered with the <code>ActivationSystem</code> before objects95* can be registered within that group.96*97* @param desc the group's descriptor98* @return an identifier for the group99* @exception ActivationException if group registration fails100* @exception RemoteException if remote call fails101* @since 1.2102*/103public ActivationGroupID registerGroup(ActivationGroupDesc desc)104throws ActivationException, RemoteException;105106/**107* Callback to inform activation system that group is now108* active. This call is made internally by the109* <code>ActivationGroup.createGroup</code> method to inform110* the <code>ActivationSystem</code> that the group is now111* active.112*113* @param id the activation group's identifier114* @param group the group's instantiator115* @param incarnation the group's incarnation number116* @return monitor for activation group117* @exception UnknownGroupException if group is not registered118* @exception ActivationException if a group for the specified119* <code>id</code> is already active and that group is not equal120* to the specified <code>group</code> or that group has a different121* <code>incarnation</code> than the specified <code>group</code>122* @exception RemoteException if remote call fails123* @since 1.2124*/125public ActivationMonitor activeGroup(ActivationGroupID id,126ActivationInstantiator group,127long incarnation)128throws UnknownGroupException, ActivationException, RemoteException;129130/**131* Remove the activation group. An activation group makes this call back132* to inform the activator that the group should be removed (destroyed).133* If this call completes successfully, objects can no longer be134* registered or activated within the group. All information of the135* group and its associated objects is removed from the system.136*137* @param id the activation group's identifier138* @exception ActivationException if unregister fails (e.g., database139* update failure, etc).140* @exception UnknownGroupException if group is not registered141* @exception RemoteException if remote call fails142* @since 1.2143*/144public void unregisterGroup(ActivationGroupID id)145throws ActivationException, UnknownGroupException, RemoteException;146147/**148* Shutdown the activation system. Destroys all groups spawned by149* the activation daemon and exits the activation daemon.150* @exception RemoteException if failed to contact/shutdown the activation151* daemon152* @since 1.2153*/154public void shutdown() throws RemoteException;155156/**157* Set the activation descriptor, <code>desc</code> for the object with158* the activation identifier, <code>id</code>. The change will take159* effect upon subsequent activation of the object.160*161* @param id the activation identifier for the activatable object162* @param desc the activation descriptor for the activatable object163* @exception UnknownGroupException the group associated with164* <code>desc</code> is not a registered group165* @exception UnknownObjectException the activation <code>id</code>166* is not registered167* @exception ActivationException for general failure (e.g., unable168* to update log)169* @exception RemoteException if remote call fails170* @return the previous value of the activation descriptor171* @see #getActivationDesc172* @since 1.2173*/174public ActivationDesc setActivationDesc(ActivationID id,175ActivationDesc desc)176throws ActivationException, UnknownObjectException,177UnknownGroupException, RemoteException;178179/**180* Set the activation group descriptor, <code>desc</code> for the object181* with the activation group identifier, <code>id</code>. The change will182* take effect upon subsequent activation of the group.183*184* @param id the activation group identifier for the activation group185* @param desc the activation group descriptor for the activation group186* @exception UnknownGroupException the group associated with187* <code>id</code> is not a registered group188* @exception ActivationException for general failure (e.g., unable189* to update log)190* @exception RemoteException if remote call fails191* @return the previous value of the activation group descriptor192* @see #getActivationGroupDesc193* @since 1.2194*/195public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,196ActivationGroupDesc desc)197throws ActivationException, UnknownGroupException, RemoteException;198199/**200* Returns the activation descriptor, for the object with the activation201* identifier, <code>id</code>.202*203* @param id the activation identifier for the activatable object204* @exception UnknownObjectException if <code>id</code> is not registered205* @exception ActivationException for general failure206* @exception RemoteException if remote call fails207* @return the activation descriptor208* @see #setActivationDesc209* @since 1.2210*/211public ActivationDesc getActivationDesc(ActivationID id)212throws ActivationException, UnknownObjectException, RemoteException;213214/**215* Returns the activation group descriptor, for the group216* with the activation group identifier, <code>id</code>.217*218* @param id the activation group identifier for the group219* @exception UnknownGroupException if <code>id</code> is not registered220* @exception ActivationException for general failure221* @exception RemoteException if remote call fails222* @return the activation group descriptor223* @see #setActivationGroupDesc224* @since 1.2225*/226public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id)227throws ActivationException, UnknownGroupException, RemoteException;228}229230231