Esempio n. 1
0
        public RemotingConnectorFactory(NotificationFetcherConfig fetcherConfig)
        {
            const string channelName = "remotingConnectorClient";

            _fetcherConfig = fetcherConfig;
            if (System.Runtime.Remoting.Channels.ChannelServices.GetChannel(channelName) == null)
            {
                IDictionary props = new Hashtable();
                props["name"]   = channelName;
                props["secure"] = "true";
                props["tokenImpersonationLevel"] = "impersonation";
                var sinkProvier = new System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider();
                var tcc         = new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel(props, sinkProvier);
                System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(tcc, false);
            }
        }
Esempio n. 2
0
        private RemotingConnector(SerializationInfo info, StreamingContext context)
        {
            string connectionId = info.GetString("connectionId");

            _serviceUrl = new Uri(info.GetString("serviceUrl"));
            string typeString = info.GetString("tokenType");

            if (typeString != null)
            {
                Type tokenType = Type.GetType(typeString, true);
                _token = info.GetValue("token", tokenType);
            }
            _fetcherConfig = (NotificationFetcherConfig)info.GetValue("fetcherConfig", typeof(NotificationFetcherConfig));
            if (connectionId != null)
            {
                IRemotingServer server = (IRemotingServer)Activator.GetObject(typeof(IRemotingServer), _serviceUrl.ToString());
                _connection       = server.Reconnect(connectionId);
                _serverConnection = new RemotingMBeanServerConnection(_connection, _token);
                _fetcher          = new NotificationFetcher(_fetcherConfig, _connection, _serverConnection);
            }
        }
Esempio n. 3
0
 public RemotingConnector(Uri serviceUrl, NotificationFetcherConfig fetcherConfig)
 {
     _serviceUrl    = serviceUrl;
     _fetcherConfig = fetcherConfig;
 }