KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Map JavaDoc;
28
29 import org.objectweb.dream.AbstractComponent;
30 import org.objectweb.dream.Push;
31 import org.objectweb.dream.PushException;
32 import org.objectweb.dream.message.Message;
33 import org.objectweb.dream.message.manager.MessageManager;
34 import org.objectweb.fractal.api.NoSuchInterfaceException;
35 import org.objectweb.fractal.api.control.IllegalBindingException;
36 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
37
38 /**
39  * Implementation of the BAK component. This component handles BAK messages.
40  * Upon message reception, it updates the <code>ProcessMembership</code>
41  * component.
42  */

43 public class BAKImpl extends AbstractComponent implements Push
44 {
45
46   // ---------------------------------------------------------------------------
47
// Fields of this class
48
// ---------------------------------------------------------------------------
49

50   /** The interface to retrieve process membership information. */
51   protected ProcessMembership processMembershipItf;
52
53   /** The interface to manage message lifecycle. */
54   protected MessageManager messageManagerItf;
55
56   // ---------------------------------------------------------------------------
57
// Constructor
58
// ---------------------------------------------------------------------------
59

60   /**
61    * Constructor.
62    */

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

71   /**
72    * @see org.objectweb.dream.Push#push(org.objectweb.dream.message.Message,
73    * java.util.Map)
74    */

75   public void push(Message message, Map JavaDoc context) throws PushException
76   {
77     // TODO Auto-generated method stub
78
}
79
80   // ---------------------------------------------------------------------------
81
// Implementation of the BindingController interface
82
// ---------------------------------------------------------------------------
83

84   /**
85    * @see org.objectweb.fractal.api.control.BindingController#bindFc(java.lang.String,
86    * java.lang.Object)
87    */

88   public void bindFc(String JavaDoc clientItfName, Object JavaDoc serverItf)
89       throws NoSuchInterfaceException, IllegalBindingException,
90       IllegalLifeCycleException
91   {
92     super.bindFc(clientItfName, serverItf);
93     if (clientItfName.equals(ProcessMembership.ITF_NAME))
94     {
95       processMembershipItf = (ProcessMembership) serverItf;
96     }
97     else if (clientItfName.equals(MessageManager.ITF_NAME))
98     {
99       messageManagerItf = (MessageManager) serverItf;
100     }
101   }
102
103   /**
104    * @see org.objectweb.fractal.api.control.BindingController#listFc()
105    */

106   public String JavaDoc[] listFc()
107   {
108     return new String JavaDoc[]{ProcessMembership.ITF_NAME, MessageManager.ITF_NAME};
109   }
110
111 }
Popular Tags