KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > ccm > filetransfer > cif > ChannelImpl


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

26
27 package org.objectweb.ccm.filetransfer.cif;
28
29 import org.objectweb.ccm.filetransfer.*;
30
31
32 /**
33  * This is the implementation of the OMG IDL3 filetransfer::Channel component type.
34  *
35  * This class inherits from the local CCM_Channel interface
36  * generated by the OpenCCM's IDL3 to IDL2 mapping generator.
37  *
38  * This class also implements the filetransfer::Images event sink interface
39  * to consume Images events.
40  *
41  * @author <a HREF="mailto:Areski.Flissi@lifl.fr">Areski Flissi</A>
42  */

43
44 public class ChannelImpl
45     extends org.objectweb.ccm.filetransfer.ChannelSessionComposition.ComponentImpl {
46     // ==================================================================
47
//
48
// Internal state.
49
//
50
// ==================================================================
51

52     /** The name of the component. */
53     private String JavaDoc name_;
54
55     
56
57     // ==================================================================
58
//
59
// Constructor.
60
//
61
// ==================================================================
62

63     /** The default constructor. */
64     public ChannelImpl() {
65         
66     }
67
68     // ==================================================================
69
//
70
// Internal methods.
71
//
72
// ==================================================================
73

74     // ==================================================================
75
//
76
// Public methods.
77
//
78
// ==================================================================
79

80     // ==================================================================
81
//
82
// Methods for OMG IDL Components::EnterpriseComponent
83
//
84
// ==================================================================
85

86     /**
87      * Complete the component configuration.
88      *
89      * @exception org.omg.Components.InvalidConfiguration
90      * Thrown if the configuration is invalid.
91      */

92     public void configuration_complete()
93         throws org.omg.Components.InvalidConfiguration {
94         // Checks if the configuration is not completed.
95
if (name_ == null)
96             throw new org.omg.Components.InvalidConfiguration();
97          
98    }
99
100     // ==================================================================
101
//
102
// Methods for the OMG IDL org.omg.Components.SessionComponent
103
//
104
// ==================================================================
105

106     /**
107      * Container callback to signal that the component is removed.
108      *
109      * @throw org.omg.Components.CCMException For any problems.
110      */

111     public void ccm_remove() throws org.omg.Components.CCMException {
112         // Release the associated frame.
113

114     }
115
116     // ==================================================================
117
//
118
// Methods for OMG IDL filetransfer::CCM_Channel
119
//
120
// ==================================================================
121

122     /**
123      * The mutator method for the attribute name.
124      *
125      * @param n The name.
126      */

127     public void the_name(String JavaDoc n) {
128         name_ = n;
129         
130         
131
132     }
133
134     /**
135      * The accessor method for the attribute name.
136      *
137      * @return The name.
138      */

139     public String JavaDoc the_name() {
140         return name_;
141     }
142
143     // ==================================================================
144
//
145
// Methods for the OMG IDL filetransfer::CCM_ImagesReceiver interface.
146
//
147
// ==================================================================
148

149     /**
150      * Implementation of the OMG IDL filetransfer::ImagesReceiver::push operation.
151      *
152      * @param event The received event.
153      */

154     public void push(Images event) {
155         
156         
157
158         // Send the file received from the Prog component to TV components
159
System.out.println(event.filename + " received from Prog component, sending to TV component");
160         get_context().push_to_tvs(
161             new ImagesImpl(event.datafile, event.filename));
162             
163         
164
165     }
166
167 }
168
Popular Tags