public NotificationFetcher(NotificationFetcherConfig fetcherConfig, IRemotingConnection connection, RemotingMBeanServerConnection serverConnection) { _connection = connection; _serverConnection = serverConnection; _maxBatchSize = fetcherConfig.MaxNotificationBatchSize; if (fetcherConfig.Proactive) { _timer = new Timer(FetchNotifications, null, TimeSpan.Zero, fetcherConfig.FetchDelay); } else { FetchNotifications(null); } }
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); } }
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); } }
public RemotingConnector(Uri serviceUrl, NotificationFetcherConfig fetcherConfig) { _serviceUrl = serviceUrl; _fetcherConfig = fetcherConfig; }