Example #1
0
        public void Connect(object credentials)
        {
            object          token;
            IRemotingServer server = (IRemotingServer)Activator.GetObject(typeof(IRemotingServer), _serviceUrl.ToString());

            _connection       = server.NewClient(credentials, out token);
            _token            = token;
            _serverConnection = new RemotingMBeanServerConnection(_connection, _token);
            _fetcher          = new NotificationFetcher(_fetcherConfig, _connection, _serverConnection);
        }
Example #2
0
 public void Close()
 {
     if (_connection != null)
     {
         if (_fetcher != null)
         {
             _fetcher.Dispose();
             _fetcher = null;
         }
         _serverConnection = null;
         _connection.Close();
         _connection = null;
     }
 }
Example #3
0
 public void Close()
 {
     if (_connection != null)
     {
         if (_fetcher != null)
         {
             _fetcher.Dispose();
             _fetcher = null;
         }
         _serverConnection = null;
         _connection.Close();
         _connection = null;
     }
 }
Example #4
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);
     }
 }
Example #5
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);
            }
        }
Example #6
0
 public void Connect(object credentials)
 {
     object token;
     IRemotingServer server = (IRemotingServer)Activator.GetObject(typeof(IRemotingServer), _serviceUrl.ToString());
     _connection = server.NewClient(credentials, out token);
     _token = token;
     _serverConnection = new RemotingMBeanServerConnection(_connection, _token);
     _fetcher = new NotificationFetcher(_fetcherConfig, _connection, _serverConnection);
 }