0N/A/*
2362N/A * Copyright (c) 1997, 2003, 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.Remote;
0N/Aimport java.rmi.RemoteException;
0N/Aimport java.rmi.activation.UnknownGroupException;
0N/Aimport java.rmi.activation.UnknownObjectException;
0N/A
0N/A/**
0N/A * The <code>ActivationSystem</code> provides a means for registering
0N/A * groups and "activatable" objects to be activated within those groups.
0N/A * The <code>ActivationSystem</code> works closely with the
0N/A * <code>Activator</code>, which activates objects registered via the
0N/A * <code>ActivationSystem</code>, and the <code>ActivationMonitor</code>,
0N/A * which obtains information about active and inactive objects,
0N/A * and inactive groups.
0N/A *
0N/A * @author Ann Wollrath
0N/A * @see Activator
0N/A * @see ActivationMonitor
0N/A * @since 1.2
0N/A */
0N/Apublic interface ActivationSystem extends Remote {
0N/A
0N/A /** The port to lookup the activation system. */
0N/A public static final int SYSTEM_PORT = 1098;
0N/A
0N/A /**
0N/A * The <code>registerObject</code> method is used to register an
0N/A * activation descriptor, <code>desc</code>, and obtain an
0N/A * activation identifier for a activatable remote object. The
0N/A * <code>ActivationSystem</code> creates an
0N/A * <code>ActivationID</code> (a activation identifier) for the
0N/A * object specified by the descriptor, <code>desc</code>, and
0N/A * records, in stable storage, the activation descriptor and its
0N/A * associated identifier for later use. When the <code>Activator</code>
0N/A * receives an <code>activate</code> request for a specific identifier, it
0N/A * looks up the activation descriptor (registered previously) for
0N/A * the specified identifier and uses that information to activate
0N/A * the object. <p>
0N/A *
0N/A * @param desc the object's activation descriptor
0N/A * @return the activation id that can be used to activate the object
0N/A * @exception ActivationException if registration fails (e.g., database
0N/A * update failure, etc).
0N/A * @exception UnknownGroupException if group referred to in
0N/A * <code>desc</code> is not registered with this system
0N/A * @exception RemoteException if remote call fails
0N/A * @since 1.2
0N/A */
0N/A public ActivationID registerObject(ActivationDesc desc)
0N/A throws ActivationException, UnknownGroupException, RemoteException;
0N/A
0N/A /**
0N/A * Remove the activation id and associated descriptor previously
0N/A * registered with the <code>ActivationSystem</code>; the object
0N/A * can no longer be activated via the object's activation id.
0N/A *
0N/A * @param id the object's activation id (from previous registration)
0N/A * @exception ActivationException if unregister fails (e.g., database
0N/A * update failure, etc).
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 void unregisterObject(ActivationID id)
0N/A throws ActivationException, UnknownObjectException, RemoteException;
0N/A
0N/A /**
0N/A * Register the activation group. An activation group must be
0N/A * registered with the <code>ActivationSystem</code> before objects
0N/A * can be registered within that group.
0N/A *
0N/A * @param desc the group's descriptor
0N/A * @return an identifier for the group
0N/A * @exception ActivationException if group registration fails
0N/A * @exception RemoteException if remote call fails
0N/A * @since 1.2
0N/A */
0N/A public ActivationGroupID registerGroup(ActivationGroupDesc desc)
0N/A throws ActivationException, RemoteException;
0N/A
0N/A /**
0N/A * Callback to inform activation system that group is now
0N/A * active. This call is made internally by the
0N/A * <code>ActivationGroup.createGroup</code> method to inform
0N/A * the <code>ActivationSystem</code> that the group is now
0N/A * active.
0N/A *
0N/A * @param id the activation group's identifier
0N/A * @param group the group's instantiator
0N/A * @param incarnation the group's incarnation number
0N/A * @return monitor for activation group
0N/A * @exception UnknownGroupException if group is not registered
0N/A * @exception ActivationException if a group for the specified
0N/A * <code>id</code> is already active and that group is not equal
0N/A * to the specified <code>group</code> or that group has a different
0N/A * <code>incarnation</code> than the specified <code>group</code>
0N/A * @exception RemoteException if remote call fails
0N/A * @since 1.2
0N/A */
0N/A public ActivationMonitor activeGroup(ActivationGroupID id,
0N/A ActivationInstantiator group,
0N/A long incarnation)
0N/A throws UnknownGroupException, ActivationException, RemoteException;
0N/A
0N/A /**
0N/A * Remove the activation group. An activation group makes this call back
0N/A * to inform the activator that the group should be removed (destroyed).
0N/A * If this call completes successfully, objects can no longer be
0N/A * registered or activated within the group. All information of the
0N/A * group and its associated objects is removed from the system.
0N/A *
0N/A * @param id the activation group's identifier
0N/A * @exception ActivationException if unregister fails (e.g., database
0N/A * update failure, etc).
0N/A * @exception UnknownGroupException if group is not registered
0N/A * @exception RemoteException if remote call fails
0N/A * @since 1.2
0N/A */
0N/A public void unregisterGroup(ActivationGroupID id)
0N/A throws ActivationException, UnknownGroupException, RemoteException;
0N/A
0N/A /**
0N/A * Shutdown the activation system. Destroys all groups spawned by
0N/A * the activation daemon and exits the activation daemon.
0N/A * @exception RemoteException if failed to contact/shutdown the activation
0N/A * daemon
0N/A * @since 1.2
0N/A */
0N/A public void shutdown() throws RemoteException;
0N/A
0N/A /**
0N/A * Set the activation descriptor, <code>desc</code> for the object with
0N/A * the activation identifier, <code>id</code>. The change will take
0N/A * effect upon subsequent activation of the object.
0N/A *
0N/A * @param id the activation identifier for the activatable object
0N/A * @param desc the activation descriptor for the activatable object
0N/A * @exception UnknownGroupException the group associated with
0N/A * <code>desc</code> is not a registered group
0N/A * @exception UnknownObjectException the activation <code>id</code>
0N/A * is not registered
0N/A * @exception ActivationException for general failure (e.g., unable
0N/A * to update log)
0N/A * @exception RemoteException if remote call fails
0N/A * @return the previous value of the activation descriptor
0N/A * @see #getActivationDesc
0N/A * @since 1.2
0N/A */
0N/A public ActivationDesc setActivationDesc(ActivationID id,
0N/A ActivationDesc desc)
0N/A throws ActivationException, UnknownObjectException,
0N/A UnknownGroupException, RemoteException;
0N/A
0N/A /**
0N/A * Set the activation group descriptor, <code>desc</code> for the object
0N/A * with the activation group identifier, <code>id</code>. The change will
0N/A * take effect upon subsequent activation of the group.
0N/A *
0N/A * @param id the activation group identifier for the activation group
0N/A * @param desc the activation group descriptor for the activation group
0N/A * @exception UnknownGroupException the group associated with
0N/A * <code>id</code> is not a registered group
0N/A * @exception ActivationException for general failure (e.g., unable
0N/A * to update log)
0N/A * @exception RemoteException if remote call fails
0N/A * @return the previous value of the activation group descriptor
0N/A * @see #getActivationGroupDesc
0N/A * @since 1.2
0N/A */
0N/A public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
0N/A ActivationGroupDesc desc)
0N/A throws ActivationException, UnknownGroupException, RemoteException;
0N/A
0N/A /**
0N/A * Returns the activation descriptor, for the object with the activation
0N/A * identifier, <code>id</code>.
0N/A *
0N/A * @param id the activation identifier for the activatable object
0N/A * @exception UnknownObjectException if <code>id</code> is not registered
0N/A * @exception ActivationException for general failure
0N/A * @exception RemoteException if remote call fails
0N/A * @return the activation descriptor
0N/A * @see #setActivationDesc
0N/A * @since 1.2
0N/A */
0N/A public ActivationDesc getActivationDesc(ActivationID id)
0N/A throws ActivationException, UnknownObjectException, RemoteException;
0N/A
0N/A /**
0N/A * Returns the activation group descriptor, for the group
0N/A * with the activation group identifier, <code>id</code>.
0N/A *
0N/A * @param id the activation group identifier for the group
0N/A * @exception UnknownGroupException if <code>id</code> is not registered
0N/A * @exception ActivationException for general failure
0N/A * @exception RemoteException if remote call fails
0N/A * @return the activation group descriptor
0N/A * @see #setActivationGroupDesc
0N/A * @since 1.2
0N/A */
0N/A public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id)
0N/A throws ActivationException, UnknownGroupException, RemoteException;
0N/A}