001/* ForwardRequest.java --
002   Copyright (C) 2005, 2006 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
019Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02002110-1301 USA.
021
022
023Linking this library statically or dynamically with other modules is
024making a combined work based on this library.  Thus, the terms and
025conditions of the GNU General Public License cover the whole
026combination.
027
028As a special exception, the copyright holders of this library give you
029permission to link this library with independent modules to produce an
030executable, regardless of the license terms of these independent
031modules, and to copy and distribute the resulting executable under
032terms of your choice, provided that you also meet, for each linked
033independent module, the terms and conditions of the license of that
034module.  An independent module is a module which is not derived from
035or based on this library.  If you modify this library, you may extend
036this exception to your version of the library, but you are not
037obligated to do so.  If you do not wish to do so, delete this
038exception statement from your version. */
039
040
041package org.omg.PortableServer;
042
043import org.omg.CORBA.UserException;
044import org.omg.CORBA.portable.IDLEntity;
045
046import java.io.Serializable;
047
048/**
049 * <p>
050 * This exception is raised by {@link ServantManager} to indicate that the
051 * invocation target has moved to another known location. In this case,
052 * the client will receive a redirection (LOCATION_FORWARD) message and should
053 * resend the request to the new target. The exception contains the object
054 * reference, indicating the new location.
055 * </p><p>
056 * The exception can be thrown both by servant locators and servant activators.
057 * If the exception is raised anywhere else than in the ServantManager
058 * methods, it is handled as an ordinary user excepton.
059 * </p>
060 *
061 * @author Audrius Meskauskas, Lithuania (AudriusA@Bioinformatics.org)
062*/
063public final class ForwardRequest
064  extends UserException
065  implements IDLEntity, Serializable
066{
067  /**
068   * Use serialVersionUID (v1.4) for interoperability.
069   */
070  private static final long serialVersionUID = -4159318367582473975L;
071
072  /**
073   * The object reference, indicating the new location of the invocation target.
074   */
075  public org.omg.CORBA.Object forward_reference;
076
077  /**
078   * Create ForwardRequest with no explaining message and stating the
079   * new location is <code>null</code>.
080   */
081  public ForwardRequest()
082  {
083  }
084
085  /**
086   * Create the ForwardRequest with explaining message and
087   * initialising the object reference to the given value.
088   *
089   * @param why a string, explaining, why this exception has been thrown.
090   * @param a_forward_reference a value for forward_reference.
091   */
092  public ForwardRequest(String why, org.omg.CORBA.Object a_forward_reference)
093  {
094    super(why);
095    this.forward_reference = a_forward_reference;
096  }
097
098  /**
099   * Create the ForwardRequest without explaining
100   * message and initialising the object reference to the given value.
101   *
102   * @param a_forward_reference a value for forward_reference.
103   */
104  public ForwardRequest(org.omg.CORBA.Object a_forward_reference)
105  {
106    this.forward_reference = a_forward_reference;
107  }
108}