001/* POAManagerOperations.java --
002   Copyright (C) 2005 Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038
039package org.omg.PortableServer;
040
041import org.omg.PortableServer.POAManagerPackage.AdapterInactive;
042import org.omg.PortableServer.POAManagerPackage.State;
043
044/**
045 * Defines the operations, applicable to the {@link POAManager}.
046 * These operations can turn the associated POAs to and from holding,
047 * active and discarding states, but the incative state is irreversible.
048 * The inactivated POAs can only be recreated after they were destroyed.
049 *
050 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
051 */
052public interface POAManagerOperations
053{
054  /**
055   * Turns the associated POAs into active state, allowing them to receive
056   * and process requests.
057   *
058   * @throws AdapterInactive if the POAs are in the inactive state. If
059   * once inactivated, the POA cannot be activated again.
060   * This method can only be called to leave the holding or discarding state.
061   */
062  void activate()
063         throws AdapterInactive;
064
065  /**
066   * <p>
067   * Turns the asociated POAs into inactive state. The POAs in the incative
068   * state will reject new requests. A cliet, trying to invoke an
069   * object, belonging to the inactivated POA, will receive the remote exception
070   * ({@link org.omg.CORBA.OBJ_ADAPTER}, minor code 0x535503ea, incomplete).
071   * </p><p>
072   * If the POA is once inactivated, it cannot be activated again.
073   * The operation is used when the associated POAs are to be shut down.
074   * </p>
075   * <p>
076   * Some independent implementations may set the minor code of the
077   * OBJ_ADAPTER to 1, as recommended by OMG (formal/04-03-12).
078   * The interoperable systems should expect any of these two values.
079   * </p>
080   *
081   * @param etherealize_objects if true, the servant managers of the
082   * associated POAs, having RETAIN and USE_SERVANT_MANAGER policies,
083   * will receive a call of {@link ServantActivatorOperations#etherealize}.
084   *
085   * @param wait_for_completion if true, the method call suspends the current
086   * thread till POAs complete the requests they are currently processing. If
087   * false, the method returns immediately.
088   * <p>
089   *
090   * @specnote The 0x535503ea is a Sun specific minor exception code 1002,
091   * used for interoperability reasons.
092   *
093   * @throws AdapterInactive if the POAs are already in the inactive state.
094   *
095   * @see POAOperations#destroy
096   */
097  void deactivate(boolean etherealize_objects, boolean wait_for_completion)
098           throws AdapterInactive;
099
100  /**
101   * <p>
102   * Turns the associated POAs into discaring state. In this state, the POAs
103   * discard the incoming requests. This mode is used in situations when
104   * the server is flooded with requests. The client receives remote exception
105   * ({@link org.omg.CORBA.TRANSIENT}, minor code 0x535503e9, incomplete).
106   * </p><p>
107   * Some independent implementations may set the minor code of the
108   * TRANSIENT to 1, as recommended by OMG (formal/04-03-12).
109   * The interoperable systems should expect any of these two values.
110   * </p>
111   *
112   * @param wait_for_completion if true, the method call suspends the current
113   * thread till POAs complete the requests they are currently processing. If
114   * false, the method returns immediately.
115   *
116   * @specnote The 0x535503e9 is a Sun specific minor exception code 1001,
117   * used for interoperability reasons.
118   *
119   * @throws AdapterInactive if the POAs are in the inactive state.
120   */
121  void discard_requests(boolean wait_for_completion)
122                 throws AdapterInactive;
123
124  /**
125   * Get the state of the POA manager.
126   */
127  State get_state();
128
129  /**
130   * Turns the associated POAs into holding state. In this state, the POAs
131   * queue incoming requests but do not process them.
132   *
133   * @param wait_for_completion if true, the method call suspends the current
134   * thread till POAs complete the requests they are currently processing. If
135   * false, the method returns immediately.
136
137   * @throws AdapterInactive if the POAs are in the inactive state.
138   */
139  void hold_requests(boolean wait_for_completion)
140              throws AdapterInactive;
141}