Esempio n. 1
0
 internal void Configure(GiopClientConnectionManager conManager, GiopMessageHandler messageHandler,
                         IiopUrlUtil iiopUrlUtil,
                         RetryConfig retries) {
     m_conManager = conManager;
     m_messageHandler = messageHandler;
     m_iiopUrlUtil = iiopUrlUtil;
     m_retries = retries;
 }
Esempio n. 2
0
 /// <summary>
 /// Configures the installed IIOPClientSideFormatterProivder
 /// </summary>
 /// <param name="interceptionOptions"></param>
 private void ConfigureSinkProviderChain(GiopClientConnectionManager conManager,
                                         GiopMessageHandler messageHandler,
                                         IiopUrlUtil iiopUrlUtil,
                                         RetryConfig retries)
 {
     IClientChannelSinkProvider prov = m_providerChain;
     while (prov != null)
     {
         if (prov is IiopClientFormatterSinkProvider)
         {
             ((IiopClientFormatterSinkProvider)prov).Configure(conManager, messageHandler, iiopUrlUtil,
                                                               retries);
             break;
         }
         prov = prov.Next;
     }
 }
Esempio n. 3
0
        private readonly Hashtable m_typesVerified = new Hashtable(); // contains the verified types for this proxy

        #endregion IFields
        #region IConstructors

        /// <param name="nextSink">the next sink in the channel. In this sink chain, a
        /// IiopClientTransportSink must be present.</param>
        internal IiopClientFormatterSink(IClientChannelSink nextSink, GiopClientConnectionManager conManager,
                                         GiopMessageHandler messageHandler,
                                         IiopUrlUtil iiopUrlUtil,
                                         RetryConfig retries) {
            m_nextSink = nextSink;
            m_conManager = conManager;
            m_messageHandler = messageHandler;
            m_iiopUrlUtil = iiopUrlUtil;
            m_retries = retries;
        }
Esempio n. 4
0
        /// <summary>the constructor used by the config file</summary>
        public IiopClientChannel(IDictionary properties, IClientChannelSinkProvider sinkProvider)
        {
            if (!CheckSinkProviderChain(sinkProvider))
            {
                throw new ArgumentException(
                     "IIOPClientSideFormatter provider not found in chain, this channel is only usable with the IIOPFormatters");
            }
            m_providerChain = sinkProvider;
            IDictionary nonDefaultOptions = new Hashtable();
            int receiveTimeOut = 0;
            int sendTimeOut = 0;
            ArrayList interceptionOptions = new ArrayList();
            int maxNumberOfRetries = MAX_NUMBER_OF_RETRIES;
            int retryDelay = RETRY_DELAY;

            if (properties != null)
            {
                foreach (DictionaryEntry entry in properties)
                {
                    switch ((string)entry.Key)
                    {
                        case IiopChannel.CHANNEL_NAME_KEY:
                            m_channelName = (string)entry.Value;
                            break;
                        case IiopChannel.PRIORITY_KEY:
                            m_channelPriority = Convert.ToInt32(entry.Value);
                            break;
                        case IiopChannel.TRANSPORT_FACTORY_KEY:
                            Type transportFactoryType = Type.GetType((string)entry.Value, true);
                            m_transportFactory = (IClientTransportFactory)
                                Activator.CreateInstance(transportFactoryType);
                            break;
                        case IiopClientChannel.CLIENT_RECEIVE_TIMEOUT_KEY:
                            receiveTimeOut = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.CLIENT_SEND_TIMEOUT_KEY:
                            sendTimeOut = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.CLIENT_REQUEST_TIMEOUT_KEY:
                            int requestTimeOutMilllis = Convert.ToInt32(entry.Value);
                            m_requestTimeOut = new MessageTimeout(TimeSpan.FromMilliseconds(requestTimeOutMilllis));
                            break;
                        case IiopClientChannel.CLIENT_UNUSED_CONNECTION_KEEPALIVE_KEY:
                            m_unusedClientConnectionTimeOut = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.CLIENT_CONNECTION_LIMIT_KEY:
                            m_maxNumberOfConnections = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.ALLOW_REQUEST_MULTIPLEX_KEY:
                            m_allowMultiplex = Convert.ToBoolean(entry.Value);
                            break;
                        case IiopClientChannel.MAX_NUMBER_OF_MULTIPLEXED_REQUESTS_KEY:
                            m_maxNumberOfMultplexedRequests = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.MAX_NUMBER_OF_RETRIES_KEY:
                            maxNumberOfRetries = Convert.ToInt32(entry.Value);
                            break;
                        case IiopClientChannel.RETRY_DELAY_KEY:
                            retryDelay = Convert.ToInt32(entry.Value);
                            break;
                        case IiopChannel.BIDIR_KEY:
                            m_isBidir = Convert.ToBoolean(entry.Value);
                            interceptionOptions.Add(new BiDirIiopInterceptionOption());
                            break;
                        case IiopChannel.ENDIAN_KEY:
                            Endian endian =
                                (Endian)Enum.Parse(typeof(Endian), (string)entry.Value);
                            m_headerFlags = GiopHeader.GetDefaultHeaderFlagsForEndian(endian);
                            break;
                        default:
                            Debug.WriteLine("non-default property found for IIOPClient channel: " + entry.Key);
                            nonDefaultOptions[entry.Key] = entry.Value;
                            break;
                    }
                }
            }
            m_retryConfig = new RetryConfig(maxNumberOfRetries, retryDelay);
            m_interceptionOptions =
                (IInterceptionOption[])interceptionOptions.ToArray(typeof(IInterceptionOption));
            // handle the options now by transport factory
            m_transportFactory.SetClientTimeOut(receiveTimeOut, sendTimeOut);
            m_transportFactory.SetupClientOptions(nonDefaultOptions);
            InitChannel();
        }