0N/A/*
157N/A * Copyright (c) 2004, 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
157N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
157N/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 *
157N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
157N/A * or visit www.oracle.com if you need additional information or have any
157N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.corba.se.spi.transport;
0N/A
0N/Aimport java.util.List;
0N/A
0N/Aimport com.sun.corba.se.pept.transport.ContactInfo;
0N/A
0N/A/**
0N/A * This interface is the "sticky manager" for IIOP failover. The default
0N/A * ORB does NOT contain a sticky manager. One is registered by supplying
0N/A * a class via the com.sun.CORBA.transport.ORBIIOPPrimaryToContactInfoClass.
0N/A *
0N/A * It uses the IIOP primary host/port (with a SocketInfo.IIOP_CLEAR_TEXT type)
0N/A * as a key to map to the last ContactInfo that resulted in successful'
0N/A * communication.
0N/A *
0N/A * It mainly prevents "fallback" - if a previously failed replica comes
0N/A * back up we do NOT want to switch back to using it - particularly in the
0N/A * case of statefull session beans.
0N/A *
0N/A * Note: This assumes static lists of replicas (e.g., AS 8.1 EE).
0N/A * This does NOT work well with LOCATION_FORWARD.
0N/A *
0N/A * @author Harold Carr
0N/A */
0N/Apublic interface IIOPPrimaryToContactInfo
0N/A{
0N/A /**
0N/A * @param primary - clear any state relating to primary.
0N/A */
0N/A public void reset(ContactInfo primary);
0N/A
0N/A /**
0N/A * @param primary - the key.
0N/A * @param previous - if null return true. Otherwise, find previous in
0N/A * <code>contactInfos</code> and if another <code>ContactInfo</code>
0N/A * follows it in the list then return true. Otherwise false.
0N/A * @param contactInfos - the list of replicas associated with the
0N/A * primary.
0N/A */
0N/A public boolean hasNext(ContactInfo primary,
0N/A ContactInfo previous,
0N/A List contactInfos);
0N/A
0N/A /**
0N/A * @param primary - the key.
0N/A * @param previous - if null then map primary to failover. If failover is
0N/A * empty then map primary to primary and return primary. If failover is
0N/A * non-empty then return failover. If previous is non-null that
0N/A * indicates that the previous failed. Therefore, find previous in
0N/A * contactInfos. Map the <code>ContactInfo</code> following
0N/A * previous to primary and return that <code>ContactInfo</code>.
0N/A */
0N/A public ContactInfo next(ContactInfo primary,
0N/A ContactInfo previous,
0N/A List contactInfos);
0N/A
0N/A}
0N/A
0N/A// End of file.