/* * @(#)IIOPPrimaryToContactInfo.java 1.4 04/07/26 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.corba.se.spi.transport; import java.util.List; import com.sun.corba.se.pept.transport.ContactInfo; /** * This interface is the "sticky manager" for IIOP failover. The default * ORB does NOT contain a sticky manager. One is registered by supplying * a class via the com.sun.CORBA.transport.ORBIIOPPrimaryToContactInfoClass. * * It uses the IIOP primary host/port (with a SocketInfo.IIOP_CLEAR_TEXT type) * as a key to map to the last ContactInfo that resulted in successful' * communication. * * It mainly prevents "fallback" - if a previously failed replica comes * back up we do NOT want to switch back to using it - particularly in the * case of statefull session beans. * * Note: This assumes static lists of replicas (e.g., AS 8.1 EE). * This does NOT work well with LOCATION_FORWARD. * * @author Harold Carr */ public interface IIOPPrimaryToContactInfo { /** * @param primary - clear any state relating to primary. */ public void reset(ContactInfo primary); /** * @param primary - the key. * @param previous - if null return true. Otherwise, find previous in * contactInfos and if another ContactInfo * follows it in the list then return true. Otherwise false. * @param contactInfos - the list of replicas associated with the * primary. */ public boolean hasNext(ContactInfo primary, ContactInfo previous, List contactInfos); /** * @param primary - the key. * @param previous - if null then map primary to failover. If failover is * empty then map primary to primary and return primary. If failover is * non-empty then return failover. If previous is non-null that * indicates that the previous failed. Therefore, find previous in * contactInfos. Map the ContactInfo following * previous to primary and return that ContactInfo. */ public ContactInfo next(ContactInfo primary, ContactInfo previous, List contactInfos); } // End of file.