KickJava   Java API By Example, From Geeks To Geeks.

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


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.Pull;
31 import org.objectweb.dream.PullException;
32 import org.objectweb.dream.Push;
33 import org.objectweb.dream.PushException;
34 import org.objectweb.dream.message.Message;
35 import org.objectweb.dream.message.manager.MessageManager;
36 import org.objectweb.fractal.api.NoSuchInterfaceException;
37 import org.objectweb.fractal.api.control.IllegalBindingException;
38 import org.objectweb.fractal.api.control.IllegalLifeCycleException;
39
40 /**
41  * Implementation of the PendingMessagesDataStructure component. This component
42  * stores pending messages. It is accessed by the REP and ACK components.
43  */

44 public class PendingMessagesDataStructureImpl extends AbstractComponent
45     implements
46       Push,
47       ReceiveAck,
48       Pull
49 {
50
51   // ---------------------------------------------------------------------------
52
// Fields of this class
53
// ---------------------------------------------------------------------------
54

55   /**
56    * The commonly used name to refer to the <code>pendingMessageOutItf</code>
57    * interface.
58    */

59   public static final String JavaDoc PENDING_MESSAGES_OUT_ITF_NAME = "pending-messages-out";
60
61   /** The interface to retrieve process membership information. */
62   protected ProcessMembership processMembershipItf;
63
64   /** The interface to manage message lifecycle. */
65   protected MessageManager messageManagerItf;
66
67   // ---------------------------------------------------------------------------
68
// Constructor
69
// ---------------------------------------------------------------------------
70

71   /**
72    * Constructor.
73    */

74   public PendingMessagesDataStructureImpl()
75   {
76   }
77
78   // ---------------------------------------------------------------------------
79
// Implementation of the Push interface
80
// ---------------------------------------------------------------------------
81

82   /**
83    * @see org.objectweb.dream.Push#push(org.objectweb.dream.message.Message,
84    * java.util.Map)
85    */

86   public void push(Message message, Map JavaDoc context) throws PushException
87   {
88     // TODO Auto-generated method stub
89
}
90
91   // ---------------------------------------------------------------------------
92
// Implementation of the Pull interface
93
// ---------------------------------------------------------------------------
94

95   /**
96    * @see org.objectweb.dream.Pull#pull(java.util.Map)
97    */

98   public Message pull(Map JavaDoc context) throws PullException
99   {
100     // TODO Auto-generated method stub
101
return null;
102   }
103
104   // ---------------------------------------------------------------------------
105
// Implementation of the ReceiveAck interface
106
// ---------------------------------------------------------------------------
107

108   /**
109    * @see ReceiveAck#receiveAck(Message)
110    */

111   public void receiveAck(Message message)
112   {
113     // TODO Auto-generated method stub
114
}
115
116   // ---------------------------------------------------------------------------
117
// Implementation of the BindingController interface
118
// ---------------------------------------------------------------------------
119

120   /**
121    * @see org.objectweb.fractal.api.control.BindingController#bindFc(java.lang.String,
122    * java.lang.Object)
123    */

124   public void bindFc(String JavaDoc clientItfName, Object JavaDoc serverItf)
125       throws NoSuchInterfaceException, IllegalBindingException,
126       IllegalLifeCycleException
127   {
128     super.bindFc(clientItfName, serverItf);
129     if (clientItfName.equals(ProcessMembership.ITF_NAME))
130     {
131       processMembershipItf = (ProcessMembership) serverItf;
132     }
133     else if (clientItfName.equals(MessageManager.ITF_NAME))
134     {
135       messageManagerItf = (MessageManager) serverItf;
136     }
137
138   }
139
140   /**
141    * @see org.objectweb.fractal.api.control.BindingController#listFc()
142    */

143   public String JavaDoc[] listFc()
144   {
145     return new String JavaDoc[]{ProcessMembership.ITF_NAME, MessageManager.ITF_NAME};
146   }
147
148 }
Popular Tags