KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > Containers > MetaInformation > PublisherPortInstanceImpl


1 /*====================================================================
2
3 created on 21 mars 2003
4
5 OpenCCM: The Open CORBA Component Model Platform
6 Copyright (C) 2001-2002 USTL - LIFL - GOAL
7 Contact: openccm-team@objectweb.org
8
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2.1 of the License, or any later version.
13
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public
20 License along with this library; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA
23
24 Initial developer(s): Hameau Fabien.
25 Contributor(s): ______________________________________.
26
27 */

28
29 package org.objectweb.openccm.Containers.MetaInformation;
30
31 import org.objectweb.ccm.util.Table;
32 import org.omg.Components.Cookie;
33 import org.omg.Components.InvalidConnection;
34 import org.omg.Components.SubscriberDescription;
35
36
37 /**
38  * @author hameau
39  */

40 public class PublisherPortInstanceImpl
41 extends EventPortInstanceImpl
42 implements PublisherPortInstance{
43
44   protected Table _subscribers;
45
46   public PublisherPortInstanceImpl()
47   {
48     _subscribers = new Table();
49   }
50
51   /* (non-Javadoc)
52    * @see org.objectweb.openccm.Containers.MetaInformation.PublisherPortInstanceOperations#subscribers()
53    */

54   public SubscriberDescription[] subscribers()
55   {
56     return (SubscriberDescription[]) _subscribers.values().toArray(new SubscriberDescription[0]);
57   }
58
59   /* (non-Javadoc)
60    * @see org.objectweb.openccm.Containers.MetaInformation.PublisherPortInstanceOperations#subscribers(org.omg.Components.SubscriberDescription[])
61    */

62   public void subscribers(SubscriberDescription[] value)
63   {
64    // TODO : implement this !!!!!!!
65
}
66
67   /* (non-Javadoc)
68    * @see org.objectweb.openccm.Containers.MetaInformation.PublisherPortInstanceOperations#add_subscriber_info(org.omg.Components.SubscriberDescription)
69    */

70   public void add_subscriber_info(SubscriberDescription info)
71   {
72    _subscribers.put(info.ck,info);
73   }
74
75   /* (non-Javadoc)
76    * @see org.objectweb.openccm.Containers.MetaInformation.PublisherPortInstanceOperations#remove_subscriber_info(org.omg.Components.SubscriberDescription)
77    */

78   public void remove_subscriber_info(SubscriberDescription info)
79   {
80    _subscribers.remove(info.ck);
81   }
82
83   public SubscriberDescription get_subscriber_info(Cookie ck)
84   throws InvalidConnection
85   {
86    SubscriberDescription tmp = (SubscriberDescription) _subscribers.get(ck);
87    if(tmp == null)
88      throw new InvalidConnection();
89    
90    return tmp;
91   }
92     
93
94 }
95
Popular Tags