1 package org.jacorb.test.orb.etf.wiop; 2 3 22 23 import java.io.*; 24 import java.net.*; 25 26 import org.apache.avalon.framework.configuration.*; 27 28 import org.omg.ETF.*; 29 import org.omg.IOP.*; 30 import org.omg.RTCORBA.ProtocolProperties; 31 32 import org.jacorb.orb.iiop.*; 33 import org.apache.avalon.framework.configuration.*; 34 35 43 public class WIOPFactories 44 extends _FactoriesLocalBase 45 implements Configurable 46 { 47 public static boolean transportInUse = false; 48 private final int tag = 7; 49 org.jacorb.config.Configuration configuration; 50 org.jacorb.orb.ORB orb; 51 52 public void configure(Configuration configuration) 53 throws ConfigurationException 54 { 55 this.configuration = (org.jacorb.config.Configuration)configuration; 56 this.orb = this.configuration.getORB(); 57 } 58 59 public Connection create_connection (ProtocolProperties props) 60 { 61 ClientIIOPConnection delegate = new ClientIIOPConnection(); 62 try 63 { 64 delegate.configure(configuration); 65 } 66 catch( ConfigurationException ce ) 67 { 68 throw new org.omg.CORBA.INTERNAL ("ConfigurationException: " + ce.getMessage()); 69 } 70 71 return new WIOPConnection (delegate, 72 tag); 73 } 74 75 public Listener create_listener (ProtocolProperties props, 76 int stacksize, 77 short base_priority) 78 { 79 IIOPListener delegate = new IIOPListener(orb) 80 { 81 protected Connection createServerConnection (Socket socket, 82 boolean is_ssl) 83 throws IOException 84 { 85 return new WIOPConnection 86 (super.createServerConnection(socket, is_ssl), tag); 87 } 88 }; 89 try 90 { 91 delegate.configure(configuration); 92 } 93 catch( ConfigurationException ce ) 94 { 95 throw new org.omg.CORBA.INTERNAL ("ConfigurationException: " + ce.getMessage()); 96 } 97 98 return new WIOPListener (delegate, tag); 99 } 100 101 public Profile demarshal_profile (TaggedProfileHolder tagged_profile, 102 TaggedComponentSeqHolder components) 103 { 104 if (tagged_profile.value.tag != this.tag) 105 { 106 throw new org.omg.CORBA.BAD_PARAM 107 ("wrong profile for WIOP transport, tag: " 108 + tagged_profile.value.tag); 109 } 110 else 111 { 112 IIOPProfile result 113 = new IIOPProfile (tagged_profile.value.profile_data); 114 components.value = result.getComponents().asArray(); 115 return new WIOPProfile (result, this.tag); 116 } 117 } 118 119 public int profile_tag() 120 { 121 return tag; 122 } 123 124 public Profile decode_corbaloc(String corbaloc) 125 { 126 throw new org.omg.CORBA.NO_IMPLEMENT (); 127 } 128 129 } 130 | Popular Tags |