1 21 package org.jacorb.orb.standardInterceptors; 22 23 import org.omg.PortableInterceptor.*; 24 25 import org.jacorb.orb.*; 26 import org.jacorb.orb.giop.CodeSet; 27 28 34 35 public class CodeSetInfoInterceptor 36 extends org.omg.CORBA.LocalObject 37 implements IORInterceptor 38 { 39 private org.omg.IOP.TaggedComponent tagc = null; 40 41 public CodeSetInfoInterceptor(ORB orb) 42 { 43 org.omg.CONV_FRAME.CodeSetComponentInfo cs_info = 45 new org.omg.CONV_FRAME.CodeSetComponentInfo(); 46 47 cs_info.ForCharData = 49 new org.omg.CONV_FRAME. 50 CodeSetComponent( CodeSet.getTCSDefault(), 51 new int[] { CodeSet.getConversionDefault() } ); 52 53 cs_info.ForWcharData = 54 new org.omg.CONV_FRAME. 55 CodeSetComponent( CodeSet.getTCSWDefault(), 56 new int[] { CodeSet.UTF8 } ); 57 58 CDROutputStream os = new CDROutputStream( orb ); 60 os.beginEncapsulatedArray(); 61 org.omg.CONV_FRAME.CodeSetComponentInfoHelper.write( os, cs_info ); 62 63 tagc = 64 new org.omg.IOP.TaggedComponent ( org.omg.IOP.TAG_CODE_SETS.value, 65 os.getBufferCopy()); 66 67 os.close (); 68 os = null; 69 cs_info = null; 70 } 71 72 public String name() 73 { 74 return "CodeSetInfoComponentCreator"; 75 } 76 77 public void destroy() 78 { 79 } 80 81 84 85 public void establish_components( IORInfo info, int [] tags ) 86 { 87 if (tags == null) 88 { 89 info.add_ior_component_to_profile( tagc, 90 org.omg.IOP.TAG_MULTIPLE_COMPONENTS.value ); 91 info.add_ior_component_to_profile( tagc, 92 org.omg.IOP.TAG_INTERNET_IOP.value ); 93 } 94 else 95 for (int i = 0; i < tags.length; i++) 96 info.add_ior_component_to_profile(tagc, tags[i]); 97 } 98 99 public void establish_components( IORInfo info ) 100 { 101 info.add_ior_component_to_profile( tagc, 102 org.omg.IOP.TAG_MULTIPLE_COMPONENTS.value ); 103 info.add_ior_component_to_profile( tagc, 104 org.omg.IOP.TAG_INTERNET_IOP.value ); 105 } 106 } 107 | Popular Tags |