KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > transport > IIOPPrimaryToContactInfo


1 /*
2  * @(#)IIOPPrimaryToContactInfo.java 1.4 04/07/26
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.transport;
9
10 import java.util.List JavaDoc;
11
12 import com.sun.corba.se.pept.transport.ContactInfo;
13
14 /**
15  * This interface is the "sticky manager" for IIOP failover. The default
16  * ORB does NOT contain a sticky manager. One is registered by supplying
17  * a class via the com.sun.CORBA.transport.ORBIIOPPrimaryToContactInfoClass.
18  *
19  * It uses the IIOP primary host/port (with a SocketInfo.IIOP_CLEAR_TEXT type)
20  * as a key to map to the last ContactInfo that resulted in successful'
21  * communication.
22  *
23  * It mainly prevents "fallback" - if a previously failed replica comes
24  * back up we do NOT want to switch back to using it - particularly in the
25  * case of statefull session beans.
26  *
27  * Note: This assumes static lists of replicas (e.g., AS 8.1 EE).
28  * This does NOT work well with LOCATION_FORWARD.
29  *
30  * @author Harold Carr
31  */

32 public interface IIOPPrimaryToContactInfo
33 {
34     /**
35      * @param primary - clear any state relating to primary.
36      */

37     public void reset(ContactInfo primary);
38
39     /**
40      * @param primary - the key.
41      * @param previous - if null return true. Otherwise, find previous in
42      * <code>contactInfos</code> and if another <code>ContactInfo</code>
43      * follows it in the list then return true. Otherwise false.
44      * @param contactInfos - the list of replicas associated with the
45      * primary.
46      */

47     public boolean hasNext(ContactInfo primary,
48                ContactInfo previous,
49                List JavaDoc contactInfos);
50
51     /**
52      * @param primary - the key.
53      * @param previous - if null then map primary to failover. If failover is
54      * empty then map primary to primary and return primary. If failover is
55      * non-empty then return failover. If previous is non-null that
56      * indicates that the previous failed. Therefore, find previous in
57      * contactInfos. Map the <code>ContactInfo</code> following
58      * previous to primary and return that <code>ContactInfo</code>.
59      */

60     public ContactInfo next(ContactInfo primary,
61                 ContactInfo previous,
62                 List JavaDoc contactInfos);
63
64 }
65
66 // End of file.
67

68
Popular Tags