コード例 #1
0
 internal void Configure(GiopMessageHandler messageHandler) {
     m_messageHandler = messageHandler;
 }
コード例 #2
0
 public void SetUp() {
     m_serFactory = new SerializerFactory();
     omg.org.IOP.CodecFactory codecFactory =
         new Ch.Elca.Iiop.Interception.CodecFactoryImpl(m_serFactory);
     m_codec =
         codecFactory.create_codec(
             new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal,
                                      1, 2));
     m_iiopUrlUtil =
         IiopUrlUtil.Create(m_codec, new object[] {
             Services.CodeSetService.CreateDefaultCodesetComponent(m_codec)});
     m_serFactory.Initalize(new SerializerFactoryConfig(), m_iiopUrlUtil);
     m_handler =
         new GiopMessageHandler(
             new ArgumentsSerializerFactory(m_serFactory),
             GiopHeader.GetDefaultHeaderFlagsForEndian(Endian.BigEndian));
 }
コード例 #3
0
 internal IiopServerFormatterSink(IServerChannelSink nextSink,
                                  GiopMessageHandler messageHandler) {
     m_nextSink = nextSink;
     m_messageHandler = messageHandler;
 }
コード例 #4
0
 internal void Configure(GiopClientConnectionManager conManager, GiopMessageHandler messageHandler,
                         IiopUrlUtil iiopUrlUtil,
                         RetryConfig retries) {
     m_conManager = conManager;
     m_messageHandler = messageHandler;
     m_iiopUrlUtil = iiopUrlUtil;
     m_retries = retries;
 }
コード例 #5
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;
        }
コード例 #6
0
        /// <summary>initalize this channel</summary>
        private void InitChannel()
        {
            Ch.Elca.Iiop.Marshalling.ArgumentsSerializerFactory argumentSerializerFactory =
                omg.org.CORBA.OrbServices.GetSingleton().ArgumentsSerializerFactory;
            CodecFactory codecFactory =
                omg.org.CORBA.OrbServices.GetSingleton().CodecFactory;
            omg.org.IOP.Codec codec = codecFactory.create_codec(
                    new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal,
                                             1, 2));
            m_transportFactory.Codec = codec;
            m_iiopUrlUtil =
                omg.org.CORBA.OrbServices.GetSingleton().IiopUrlUtil;

            if (!m_isBidir)
            {
                m_conManager = new GiopClientConnectionManager(m_transportFactory, m_requestTimeOut,
                                                               m_unusedClientConnectionTimeOut, m_maxNumberOfConnections,
                                                               m_allowMultiplex, m_maxNumberOfMultplexedRequests,
                                                               m_headerFlags);
            }
            else
            {
                m_conManager = new GiopBidirectionalConnectionManager(m_transportFactory, m_requestTimeOut,
                                                                      m_unusedClientConnectionTimeOut, m_maxNumberOfConnections,
                                                                      m_allowMultiplex, m_maxNumberOfMultplexedRequests,
                                                                      m_headerFlags);
            }
            IiopClientTransportSinkProvider transportProvider =
                new IiopClientTransportSinkProvider(m_conManager);
            if (m_providerChain != null)
            {
                // append transport provider to the chain
                IClientChannelSinkProvider prov = m_providerChain;
                while (prov.Next != null) { prov = prov.Next; }
                prov.Next = transportProvider; // append the transport provider at the end
            }
            else
            {
                // create the default provider chain
                IClientFormatterSinkProvider formatterProv = new IiopClientFormatterSinkProvider();
                formatterProv.Next = transportProvider;
                m_providerChain = formatterProv;
            }
            GiopMessageHandler messageHandler =
                new GiopMessageHandler(argumentSerializerFactory,
                                       m_headerFlags, m_interceptionOptions);
            ConfigureSinkProviderChain(m_conManager, messageHandler, m_iiopUrlUtil,
                                       m_retryConfig);
        }
コード例 #7
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;
     }
 }
コード例 #8
0
        /// <summary>initalize the channel</summary>
        private void InitChannel()
        {
            if (m_port < 0)
            {
                throw new ArgumentException("illegal port to listen on: " + m_port);
            }
            Ch.Elca.Iiop.Marshalling.ArgumentsSerializerFactory argumentSerializerFactory =
                omg.org.CORBA.OrbServices.GetSingleton().ArgumentsSerializerFactory;
            CodecFactory codecFactory =
                omg.org.CORBA.OrbServices.GetSingleton().CodecFactory;
            m_codec = codecFactory.create_codec(
                    new omg.org.IOP.Encoding(omg.org.IOP.ENCODING_CDR_ENCAPS.ConstVal,
                                             1, 2));
            m_transportFactory.Codec = m_codec;
            m_iiopUrlUtil = omg.org.CORBA.OrbServices.GetSingleton().IiopUrlUtil;
            m_hostNameToUse = DetermineMachineNameToUse();
            SetupChannelData(m_hostNameToUse, m_port, m_codec, null);
            m_connectionListener =
                m_transportFactory.CreateConnectionListener(new ClientAccepted(this.ProcessClientMessages));

            // create the default provider chain, if no chain specified
            if (m_providerChain == null)
            {
                m_providerChain = new IiopServerFormatterSinkProvider();
            }
            GiopMessageHandler messageHandler =
                new GiopMessageHandler(argumentSerializerFactory,
                                       m_headerFlags, m_interceptionOptions);
            ConfigureSinkProviderChain(messageHandler);

            IServerChannelSink sinkChain = ChannelServices.CreateServerChannelSinkChain(m_providerChain, this);
            m_transportSink = new IiopServerTransportSink(sinkChain);

            if (m_bidirConnectionManager != null)
            {
                // bidirectional entry point into server channel sink chain.
                m_bidirConnectionManager.RegisterMessageReceptionHandler(m_transportSink,
                                                                         m_serverThreadsMaxPerConnection);
            }

            // ready to wait for messages
            StartListening(null);
            // publish init-service
            Services.CORBAInitServiceImpl.Publish();
            // public the handler for generic corba operations
            StandardCorbaOps.SetUpHandler();
        }
コード例 #9
0
 /// <summary>
 /// Configures the installed IIOPServerSideFormatterProivder
 /// </summary>
 private void ConfigureSinkProviderChain(GiopMessageHandler messageHandler)
 {
     IServerChannelSinkProvider prov = m_providerChain;
     while (prov != null)
     {
         if (prov is IiopServerFormatterSinkProvider)
         {
             ((IiopServerFormatterSinkProvider)prov).Configure(messageHandler);
             break;
         }
         prov = prov.Next;
     }
 }