KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dream > protocol > utobcast > LeaderFaultForwarderImpl


1 /**
2  * Dream
3  * Copyright (C) 2003-2004 INRIA Rhone-Alpes
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: dream@objectweb.org
20  *
21  * Initial developer(s): Vivien Quema
22  * Contributor(s):
23  */

24
25 package org.objectweb.dream.protocol.utobcast;
26
27 import org.objectweb.dream.AbstractComponent;
28 import org.objectweb.dream.Push;
29 import org.objectweb.dream.message.manager.MessageManager;
30 import org.objectweb.dream.protocol.Process;
31 import org.objectweb.fractal.api.NoSuchInterfaceException;
32 import org.objectweb.fractal.api.control.IllegalBindingException;
33 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
34
35 /**
36  * Implementation of the LeaderFaultForwarder component. This component is
37  * notified by the ProcessMembership component that the leader has crashed. Its
38  * role is to unblock push calls that are waiting in the PushWithReturn
39  * component by sending a "AllKey" message.
40  */

41 public class LeaderFaultForwarderImpl extends AbstractComponent
42     implements
43       ProcessMembershipUpdateNotification
44 {
45
46   // ---------------------------------------------------------------------------
47
// Fields of this class
48
// ---------------------------------------------------------------------------
49

50   /** The interface to send "AllKey" messages. */
51   protected Push outPushItf;
52
53   /** The interface to manage message lifecycle. */
54   protected MessageManager messageManagerItf;
55
56   // ---------------------------------------------------------------------------
57
// Constructor
58
// ---------------------------------------------------------------------------
59

60   /**
61    * Constructor.
62    */

63   public LeaderFaultForwarderImpl()
64   {
65   }
66
67   // ---------------------------------------------------------------------------
68
// Implementation of the ProcessMembershipUpdateNotification interface
69
// ---------------------------------------------------------------------------
70

71   /**
72    * @see org.objectweb.dream.protocol.utobcast.ProcessMembershipUpdateNotification#newBackup(org.objectweb.dream.protocol.Process)
73    */

74   public void newBackup(Process JavaDoc backup)
75   {
76     // TODO Auto-generated method stub
77

78   }
79
80   /**
81    * @see org.objectweb.dream.protocol.utobcast.ProcessMembershipUpdateNotification#newLeader(org.objectweb.dream.protocol.Process)
82    */

83   public void newLeader(Process JavaDoc leader)
84   {
85     // TODO Auto-generated method stub
86

87   }
88
89   /**
90    * @see org.objectweb.dream.protocol.utobcast.ProcessMembershipUpdateNotification#newProcesses(org.objectweb.dream.protocol.Process[])
91    */

92   public void newProcesses(Process JavaDoc[] processes)
93   {
94     // TODO Auto-generated method stub
95

96   }
97
98   // ---------------------------------------------------------------------------
99
// Implementation of the BindingController interface
100
// ---------------------------------------------------------------------------
101

102   /**
103    * @see org.objectweb.fractal.api.control.BindingController#bindFc(java.lang.String,
104    * java.lang.Object)
105    */

106   public void bindFc(String JavaDoc clientItfName, Object JavaDoc serverItf)
107       throws NoSuchInterfaceException, IllegalBindingException,
108       IllegalLifeCycleException
109   {
110     super.bindFc(clientItfName, serverItf);
111     if (clientItfName.equals(Push.OUT_PUSH_ITF_NAME))
112     {
113       outPushItf = (Push) serverItf;
114     }
115     else if (clientItfName.equals(MessageManager.ITF_NAME))
116     {
117       messageManagerItf = (MessageManager) serverItf;
118     }
119   }
120
121   /**
122    * @see org.objectweb.fractal.api.control.BindingController#listFc()
123    */

124   public String JavaDoc[] listFc()
125   {
126     return new String JavaDoc[]{Push.OUT_PUSH_ITF_NAME, MessageManager.ITF_NAME};
127   }
128
129 }
Popular Tags