KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*====================================================================
2
3 created on 20 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.ConnectionDescription;
33 import org.omg.Components.Cookie;
34
35 /**
36  * @author hameau
37  */

38
39 public class ReceptaclePortInstanceImpl
40 extends PortInstanceImpl
41 implements ReceptaclePortInstance {
42
43   protected InterfaceInstance _interface_instance;
44   protected int _nb_connexion;
45   protected Table _connexions;
46   
47   /* (non-Javadoc)
48    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#interface_instance()
49    */

50   public InterfaceInstance interface_instance()
51   {
52     return _interface_instance;
53   }
54
55   /* (non-Javadoc)
56    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#interface_instance(org.objectweb.openccm.Containers.MetaInformation.InterfaceInstance)
57    */

58   public void interface_instance(InterfaceInstance value)
59   {
60     _interface_instance = value;
61   }
62
63   /* (non-Javadoc)
64    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#nb_connexion()
65    */

66   public int nb_connexion()
67   {
68     return _nb_connexion;
69   }
70
71   /* (non-Javadoc)
72    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#nb_connexion(int)
73    */

74   public void nb_connexion(int value)
75   {
76     _nb_connexion = value;
77   }
78
79   /* (non-Javadoc)
80    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#connexions()
81    */

82   public ConnectionDescription[] connexions()
83   {
84     return (ConnectionDescription[]) _connexions.values().toArray(new ConnectionDescription[0]);
85   }
86
87   /* (non-Javadoc)
88    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#connexions(org.omg.Components.ConnectionDescription[])
89    */

90   public void connexions(ConnectionDescription[] value)
91   {
92     // TODO : to implement !
93
}
94
95   /* (non-Javadoc)
96    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#add_connexion_info(org.omg.Components.ConnectionDescription)
97    */

98   public void add_connexion_info(ConnectionDescription conn)
99   {
100     _connexions.put(conn.ck, conn);
101   }
102
103   /* (non-Javadoc)
104    * @see org.objectweb.openccm.Containers.MetaInformation.ReceptaclePortInstanceOperations#remove_connexion_info(org.omg.Components.ConnectionDescription)
105    */

106   public void remove_connexion_info(ConnectionDescription conn)
107   {
108     _connexions.remove(conn.ck);
109   }
110     
111   public ConnectionDescription get_connexion(Cookie ck)
112   {
113      return (ConnectionDescription)_connexions.get(ck);
114   }
115 }
116
Popular Tags