KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > ior > TaggedComponentBase


1 /*
2  * @(#)TaggedComponentBase.java 1.9 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.spi.ior;
9
10 import org.omg.CORBA_2_3.portable.InputStream JavaDoc ;
11
12 import com.sun.corba.se.impl.encoding.EncapsOutputStream ;
13
14 import com.sun.corba.se.spi.orb.ORB ;
15
16
17 /** Base class to use for implementing TaggedComponents. It implements
18  * the getIOPComponent method using the TaggedComponent.write() method.
19  * @author Ken Cavanaugh
20  */

21 public abstract class TaggedComponentBase extends IdentifiableBase
22     implements TaggedComponent
23 {
24     public org.omg.IOP.TaggedComponent JavaDoc getIOPComponent(
25     org.omg.CORBA.ORB JavaDoc orb )
26     {
27     EncapsOutputStream os = new EncapsOutputStream( (ORB)orb ) ;
28     write( os ) ;
29     InputStream JavaDoc is = (InputStream JavaDoc)(os.create_input_stream() ) ;
30     return org.omg.IOP.TaggedComponentHelper.read( is ) ;
31     }
32 }
33
Popular Tags