Exemplo n.º 1
0
        public void AttachInputMessage(PqlMessage requestMessage, IDataEngine engine, IPqlClientSecurityContext authContext)
        {
            if (requestMessage == null)
            {
                throw new ArgumentNullException("requestMessage");
            }

            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            AssertIsClean();

            ClauseEvaluationContext = new ClauseEvaluationContext();

            m_authContext             = authContext;
            m_requestMessage          = requestMessage;
            m_engine                  = engine;
            m_cancellationTokenSource = new CancellationTokenSource();

            // re-initialize the ring, for fault tolerance in case if previous processor fails to release items
            m_buffersRing = new DataRing <RequestExecutionBuffer>(m_buffersRingItems.Length, m_buffersRingItems.Length);
            foreach (var item in m_buffersRingItems)
            {
                // make all buffers available to producer
                m_buffersRing.AddTaskForProcessing(item, m_cancellationTokenSource.Token);
            }
        }
Exemplo n.º 2
0
 protected BaseMacroExecute(IDataEngine dataengine, IMacroFactory macroFactory, IOutputEngine outputengine, IProject project)
 {
     Engine         = dataengine;
     MacroFactory   = macroFactory;
     OutputEngine   = outputengine;
     CurrentProject = project;
 }
Exemplo n.º 3
0
        private void OpenFile(string file)
        {
            Type engineType = Utilities.FindEngine(file);

            if (engineType == null)
            {
                MessageBox.Show(string.Format("Unable to find an engine for {0}.", file),
                                "Error Opening File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                //arguments are filename, createNew
                IDataEngine engine = (IDataEngine)Activator.CreateInstance(engineType, file, false);

                var conn   = new Connection(engine);
                var window = new ProfilerWindow(this, conn);
                window.Show();
            }
            catch (System.Reflection.TargetInvocationException ex)
            {
                MessageBox.Show("Unable to create engine: " + ex.InnerException.Message,
                                "Error Opening File", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unknown error: " + ex.Message, "Error Opening File",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 4
0
 public MacroTypeVariables(IDataEngine engine, IWalkerTypeResult result, string output,
                           AttributeParser[] attributes, ITypeData reftype) : base(result, output, attributes)
 {
     Engine  = engine;
     TYPE    = TypeData.Factory(engine, result.TypeDeclarationSyntax);
     REFTYPE = reftype;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Invoked when disposing or finalizing this instance.
        /// </summary>
        /// <param name="disposing">True if the object is being disposed, false otherwise.</param>
        protected virtual void OnDispose(bool disposing)
        {
            if (disposing)
            {
                try
                {
                    if (_Transaction != null && !_Transaction.IsDisposed)
                    {
                        _Transaction.Abort();
                        _Transaction.Dispose();
                    }
                }
                catch { }

                try { if (IsOpen)
                      {
                          Close();
                      }
                }
                catch { }
            }

            _Engine      = null;
            _Transaction = null;

            _IsDisposed = true;
        }
Exemplo n.º 6
0
 public Connection(IDataEngine dataEngine)
 {
     if (dataEngine == null)
     {
         throw new ArgumentNullException("dataEngine");
     }
     this.DataEngine = dataEngine;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Removes the given engine from the list of registered ones.
 /// </summary>
 /// <param name="engine">The engine to remove.</param>
 /// <returns>True if the engine was removed, false otherwise.</returns>
 public static bool RemoveEngine(IDataEngine engine)
 {
     if (engine == null)
     {
         throw new ArgumentNullException("engine", "Engine cannot be null.");
     }
     lock (_SyncRoot) { InitializeIfNeeded(); return(_Engines.Remove(engine)); }
 }
Exemplo n.º 8
0
        private bool Connect(string host, int port)
        {
            string dbFile = m_resultsFileTextBox.Text;

            //connect to data engine before launching the process -- we don't want to launch if this fails
            IDataEngine storage = null;

            try
            {
                //storage = new SqlServerCompactEngine(dbFile, true);
                if (SQLiteRadio.Checked)
                {
                    storage = new SQLiteEngine(dbFile, true);
                }
                else if (SQLiteMemoryRadio.Checked)
                {
                    storage = new SQLiteMemoryEngine();
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Launch Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            ConnectProgress progress = new ConnectProgress(host, port, storage, 10);

            progress.ShowDialog(this);

            if (progress.Client != null)
            {
                Connection conn = new Connection(storage);
                conn.RunClient(progress.Client);
                conn.SetAutoSnapshots(10000, false);

                var profilerWindow = new ProfilerWindow(m_mainWindow, conn);
                profilerWindow.Show();

                TypeEntry visEntry = m_visualizerCombo.SelectedItem as TypeEntry;
                if (visEntry != null && visEntry.Type != null)
                {
                    profilerWindow.AddVisualizer(visEntry.Type);
                }

                profilerWindow.BringToFront();
            }
            else
            {
                storage.Dispose();
                return(false);
            }

            return(true);
        }
Exemplo n.º 9
0
        public ProfilerClient(string host, int port, IDataEngine data)
        {
            m_client = new TcpClient();
            m_client.Connect(host, port);
            m_client.ReceiveBufferSize = 64 * 1024;
            m_stream = m_client.GetStream();
#if DEBUG
            m_stream.ReadTimeout = 120000;
#else
            m_stream.ReadTimeout = 30000;
#endif
            m_bufferedStream = new BufferedStream(m_stream, 64 * 1024);
            m_reader         = new BinaryReader(m_bufferedStream, Encoding.Unicode);
            m_writer         = new BinaryWriter(m_stream, Encoding.Unicode);
            m_data           = data;

            //load all existing mappings into our private cache
            using (var session = data.OpenSession())
                using (var tx = session.BeginTransaction())
                {
                    var functions = session.CreateCriteria <FunctionInfo>().List <FunctionInfo>();
                    foreach (var f in functions)
                    {
                        m_functions.Add(f.Id, f);
                    }

                    var classes = session.CreateCriteria <ClassInfo>().List <ClassInfo>();
                    foreach (var c in classes)
                    {
                        m_classes.Add(c.Id, c);
                    }

                    //threads are not recovered from the database, we want updated info there

                    var counters = session.CreateCriteria <Counter>().List <Counter>();
                    foreach (var c in counters)
                    {
                        m_counters.Add(c.Id, c);
                    }
                }

            HostName = host;
            Port     = port;

            //record the network info
            data.WriteProperty("HostName", host);
            data.WriteProperty("Port", port.ToString());

            string sessionId = data.GetProperty("SessionId");
            if (sessionId != null)
            {
                m_sessionId = new Guid(sessionId);
            }

            Debug.WriteLine("Successfully connected.");
        }
Exemplo n.º 10
0
        internal LocalDataSourceProvider(DataSettings <PropertyFilterDescriptionBase, PropertyGroupDescriptionBase, PropertyAggregateDescriptionBase, SortDescription> settings, IDataEngine engine, IFieldDescriptionProvider fieldInfoProvider) : base(settings, fieldInfoProvider)
        {
            this.settings = settings;

            if (engine != null)
            {
                this.engine            = engine;
                this.engine.Completed += new EventHandler <DataEngineCompletedEventArgs>(this.OnCompleted);
            }
        }
Exemplo n.º 11
0
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="engine">The engine this instance will be associated with.</param>
		/// <param name="mode">The default initial mode to use when needed to create the nestable
		/// transtransaction object maintained by this instance.</param>
		protected DataLink(
			IDataEngine engine,
			NestableTransactionMode mode = NestableTransactionMode.Database)
		{
			if (engine == null) throw new ArgumentNullException("engine", "Engine cannot be null.");
			if (engine.IsDisposed) throw new ObjectDisposedException(engine.ToString());

			_Engine = engine;
			_SerialId = ++_LastSerialId;
			_DefaultTransactionMode = mode;
		}
Exemplo n.º 12
0
        public static TypeData Factory(IDataEngine engine, TypeDeclarationSyntax type)
        {
            switch (type)
            {
            case ClassDeclarationSyntax clase: return(new ClassData(engine, clase));

            case InterfaceDeclarationSyntax interf: return(new InterfaceData(engine, interf));

            default: return(new TypeData(engine, type));
            }
        }
Exemplo n.º 13
0
		public ConnectProgress(string host, int port, IDataEngine data, int attempts)
		{
			InitializeComponent();

			m_host = host;
			m_port = port;
			m_data = data;
			m_attempts = attempts;

			m_connectingToLabel.Text = string.Format("Connecting to: {0}:{1}...", m_host, m_port);
			m_progress.Maximum = m_attempts;
		}
Exemplo n.º 14
0
 public static bool TestConnection(string host, ushort port, IDataEngine tempEngine)
 {
     try
     {
         var client = new ProfilerClient(host, port, tempEngine);
         return(true);
     }
     catch (System.Net.Sockets.SocketException)
     {
         return(false);
     }
 }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance associated with the given engine.
 /// </summary>
 /// <param name="engine">The engine this instance is associated with.</param>
 public Parser(IDataEngine engine)
 {
     if (engine == null)
     {
         throw new ArgumentNullException("engine", "Engine cannot be null.");
     }
     if (engine.IsDisposed)
     {
         throw new ObjectDisposedException(engine.ToString());
     }
     _Engine = engine;
 }
Exemplo n.º 16
0
        public ConnectProgress(string host, int port, IDataEngine data, int attempts)
        {
            InitializeComponent();

            m_host     = host;
            m_port     = port;
            m_data     = data;
            m_attempts = attempts;

            m_connectingToLabel.Text = string.Format("Connecting to: {0}:{1}...", m_host, m_port);
            m_progress.Maximum       = m_attempts;
        }
Exemplo n.º 17
0
 /// <summary>
 /// Registers the given engine if it has not been registered before.
 /// </summary>
 /// <param name="engine">The engine to register.</param>
 public static void RegisterEngine(IDataEngine engine)
 {
     if (engine == null)
     {
         throw new ArgumentNullException("engine", "Engine cannot be null.");
     }
     lock (_SyncRoot) { InitializeIfNeeded(); if (!_Engines.Contains(engine))
                        {
                            _Engines.Add(engine);
                        }
     }
 }
Exemplo n.º 18
0
        protected DbContext(string connectionString, bool?codeFirst = null)
        {
            //_codeFirst = codeFirst ?? ConfigurationManager.AppSettings["CodeFirst"] != "false";
            DataEngine = new MssqlDataEngine(connectionString, GetType().Assembly)
            {
                ColumnMapper = { Context = this }
            };

            _modelBuilder = new DbModelBuilder(this);
            _modelBuilder.Entity <ColumnInfo>();
            _modelBuilder.Build((dbset, columns) => _dbSets.Add(_migrationHistory = (DbSet <ColumnInfo>)dbset));
            CreateModel();
        }
Exemplo n.º 19
0
        public SherlockServer(string host, int port)
        {
            _data   = new DataEngine();
            _server = new Grpc.Core.Server()
            {
                Services =
                {
                    Services.SherlockService.BindService(new Sherlock.Engine.Logs.SherlockService(_data))
                },
                Ports = { new ServerPort(host, port, ServerCredentials.Insecure) }
            };

            _server.Start();
        }
Exemplo n.º 20
0
        /// <summary>
        /// Will find the eldest engine and force-purge it.
        /// </summary>
        private static void ForceExpireOneEngine(DataEngineCache cache)
        {
            var engines = cache.m_engines;

            if (engines == null)
            {
                return;
            }

            IDataEngine oldest = null;
            ConcurrentDictionary <string, IDataEngine> container = null;
            string scope = null, tenant = null;

            foreach (var tenantEnginesRec in engines)
            {
                foreach (var engineRec in tenantEnginesRec.Value)
                {
                    if (oldest == null || oldest.UtcLastUsedAt > engineRec.Value.UtcLastUsedAt)
                    {
                        oldest    = engineRec.Value;
                        container = tenantEnginesRec.Value;
                        tenant    = tenantEnginesRec.Key;
                        scope     = engineRec.Key;
                    }
                }
            }

            if (oldest != null)
            {
                cache.m_tracer.InfoFormat("Forced expiration of engine for tenant {0}, scope {1}", tenant, scope);
                IDataEngine engine;

                if (container.TryRemove(scope, out engine))
                {
                    // only invoke Dispose here if the engine is not active right now
                    // otherwise, let it be garbage-collected
                    var ageseconds = (DateTime.UtcNow - engine.UtcLastUsedAt).TotalSeconds;
                    if (ageseconds < 0)
                    {
                        ageseconds = -ageseconds;
                    }

                    if (ageseconds > 1.0)
                    {
                        engine.Dispose();
                    }
                }
            }
        }
        public void Attach(PqlMessage requestMessage, IDataEngine dataEngine, IPqlClientSecurityContext authContext)
        {
            if (dataEngine == null)
            {
                throw new ArgumentNullException("dataEngine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            m_executionContext.AssertIsClean();
            m_executionContext.AttachInputMessage(requestMessage, dataEngine, authContext);
        }
Exemplo n.º 22
0
		public ProfilerClient(string host, int port, IDataEngine data)
		{
			m_client = new TcpClient();
			m_client.Connect(host, port);
			m_client.ReceiveBufferSize = 64 * 1024;
			m_stream = m_client.GetStream();
#if DEBUG
			m_stream.ReadTimeout = 120000;
#else
			m_stream.ReadTimeout = 30000;
#endif
			m_bufferedStream = new BufferedStream(m_stream, 64 * 1024);
			m_reader = new BinaryReader(m_bufferedStream, Encoding.Unicode);
			m_writer = new BinaryWriter(m_stream, Encoding.Unicode);
			m_data = data;

			//load all existing mappings into our private cache
			using(var session = data.OpenSession())
			using(var tx = session.BeginTransaction())
			{
				var functions = session.CreateCriteria<FunctionInfo>().List<FunctionInfo>();
				foreach(var f in functions)
					m_functions.Add(f.Id, f);

				var classes = session.CreateCriteria<ClassInfo>().List<ClassInfo>();
				foreach(var c in classes)
					m_classes.Add(c.Id, c);

				//threads are not recovered from the database, we want updated info there

				var counters = session.CreateCriteria<Counter>().List<Counter>();
				foreach(var c in counters)
					m_counters.Add(c.Id, c);
			}

			HostName = host;
			Port = port;

			//record the network info
			data.WriteProperty("HostName", host);
			data.WriteProperty("Port", port.ToString());

			string sessionId = data.GetProperty("SessionId");
			if(sessionId != null)
				m_sessionId = new Guid(sessionId);

			Debug.WriteLine("Successfully connected.");
		}
Exemplo n.º 23
0
        protected DbContext(string connectionString)
        {
            DataEngine = new MssqlDataEngine(connectionString);
            DataEngine.ColumnMapper.Context = this;
            _migrationHistory = CreateDbSet <ColumnInfo>();
            _dbSets.Add(_migrationHistory);

            var dbSetProperties = GetType().GetProperties().Where(pi => _iDbSet.IsAssignableFrom(pi.PropertyType)).ToList();

            foreach (var pi in dbSetProperties)
            {
                var table = GetTableDefinition(pi);
                var dbSet = EnsureTable(pi.PropertyType, table);
                pi.SetValue(this, dbSet);
            }
        }
Exemplo n.º 24
0
        public LogicEngine(DataEngineKind dataEngineKind)
        {
            switch (dataEngineKind)
            {
            case DataEngineKind.Sql:
                DataEngine = new SqlDataEngine();
                break;

            case DataEngineKind.Storage:
                DataEngine = new StorageDataEngine();
                break;

            default:
                DataEngine = new SqlDataEngine();
                break;
            }
        }
Exemplo n.º 25
0
        public void Cleanup()
        {
            m_authContext           = null;
            m_lastError             = null;
            m_requestMessage        = null;
            m_engine                = null;
            ResponseHeaders         = null;
            RecordsAffected         = 0;
            TotalRowsProduced       = 0;
            DriverOutputBuffer      = null;
            InputDataEnumerator     = null;
            ClauseEvaluationContext = null;
            OutputDataBuffer        = null;
            Completion              = null;
            ContainerDescriptor     = null;

            CacheInfo = null;
            Request.Clear();
            RequestBulk.Clear();
            RequestParameters.Clear();
            ParsedRequest.Clear();

            var cancellation = Interlocked.CompareExchange(ref m_cancellationTokenSource, null, m_cancellationTokenSource);

            if (cancellation != null)
            {
                cancellation.Cancel();
            }

            var ring = Interlocked.CompareExchange(ref m_buffersRing, null, m_buffersRing);

            if (ring != null)
            {
                ring.Dispose();
            }

            var items = m_buffersRingItems; // do not replace with null

            if (items != null)
            {
                foreach (var item in items)
                {
                    item.Cleanup();
                }
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="engine">The engine this instance will be associated with.</param>
        /// <param name="mode">The default initial mode to use when needed to create the nestable
        /// transtransaction object maintained by this instance.</param>
        protected DataLink(
            IDataEngine engine,
            NestableTransactionMode mode = NestableTransactionMode.Database)
        {
            if (engine == null)
            {
                throw new ArgumentNullException("engine", "Engine cannot be null.");
            }
            if (engine.IsDisposed)
            {
                throw new ObjectDisposedException(engine.ToString());
            }

            _Engine   = engine;
            _SerialId = ++_LastSerialId;
            _DefaultTransactionMode = mode;
        }
Exemplo n.º 27
0
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		protected virtual void OnDispose(bool disposing)
		{
			if (disposing)
			{
				try
				{
					if (_Transaction != null && !_Transaction.IsDisposed)
					{
						_Transaction.Abort();
						_Transaction.Dispose();
					}
				}
				catch { }

				try { if (IsOpen) Close(); }
				catch { }
			}

			_Engine = null;
			_Transaction = null;

			_IsDisposed = true;
		}
Exemplo n.º 28
0
 //Public Methods
 public void AddEngine(IDataEngine dataEngine)
 {
     dataEngine.OnNewRequestRecord += DataEngine_OnNewRequestRecord;
     m_DataEngines.Add(dataEngine);
 }
        public void AttachInputMessage(PqlMessage requestMessage, IDataEngine engine, IPqlClientSecurityContext authContext)
        {
            if (requestMessage == null)
            {
                throw new ArgumentNullException("requestMessage");
            }

            if (engine == null)
            {
                throw new ArgumentNullException("engine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            AssertIsClean();

            ClauseEvaluationContext = new ClauseEvaluationContext();

            m_authContext = authContext;
            m_requestMessage = requestMessage;
            m_engine = engine;
            m_cancellationTokenSource = new CancellationTokenSource();

            // re-initialize the ring, for fault tolerance in case if previous processor fails to release items
            m_buffersRing = new DataRing<RequestExecutionBuffer>(m_buffersRingItems.Length, m_buffersRingItems.Length);
            foreach (var item in m_buffersRingItems)
            {
                // make all buffers available to producer
                m_buffersRing.AddTaskForProcessing(item, m_cancellationTokenSource.Token);
            }
        }
        public void Cleanup()
        {
            m_authContext = null;
            m_lastError = null;
            m_requestMessage = null;
            m_engine = null;
            ResponseHeaders = null;
            RecordsAffected = 0;
            TotalRowsProduced = 0;
            DriverOutputBuffer = null;
            InputDataEnumerator = null;
            ClauseEvaluationContext = null;
            OutputDataBuffer = null;
            Completion = null;
            ContainerDescriptor = null;

            CacheInfo = null;
            Request.Clear();
            RequestBulk.Clear();
            RequestParameters.Clear();
            ParsedRequest.Clear();

            var cancellation = Interlocked.CompareExchange(ref m_cancellationTokenSource, null, m_cancellationTokenSource);
            if (cancellation != null)
            {
                cancellation.Cancel();
            }

            var ring = Interlocked.CompareExchange(ref m_buffersRing, null, m_buffersRing);
            if (ring != null)
            {
                ring.Dispose();
            }

            var items = m_buffersRingItems; // do not replace with null
            if (items != null)
            {
                foreach (var item in items)
                {
                    item.Cleanup();
                }
            }
        }
Exemplo n.º 31
0
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="engine">The engine this instance will be associated with.</param>
		/// <param name="mode">The default initial mode to use when needed to create the nestable
		/// transtransaction object maintained by this instance.</param>
		public DataLink(
			IDataEngine engine,
			Core.NestableTransactionMode mode = Core.NestableTransactionMode.Database)
			: base(engine, mode) { }
Exemplo n.º 32
0
		/// <summary>
		/// Registers the given direct engine if it has not been registered before.
		/// </summary>
		/// <param name="engine">The engine to register.</param>
		public static void RegisterEngine(IDataEngine engine)
		{
			Core.DataEngine.RegisterEngine(engine);
		}
Exemplo n.º 33
0
		/// <summary>
		/// Removes the given engine from the list of registered ones.
		/// </summary>
		/// <param name="engine">The engine to remove.</param>
		/// <returns>True if the engine was removed, false otherwise.</returns>
		public static bool RemoveEngine(IDataEngine engine)
		{
			if (engine == null) throw new ArgumentNullException("engine", "Engine cannot be null.");
			lock (_SyncRoot) { InitializeIfNeeded(); return _Engines.Remove(engine); }
		}
Exemplo n.º 34
0
 /// <summary>
 /// Registers the given direct engine if it has not been registered before.
 /// </summary>
 /// <param name="engine">The engine to register.</param>
 public static void RegisterEngine(IDataEngine engine)
 {
     Core.DataEngine.RegisterEngine(engine);
 }
Exemplo n.º 35
0
 public SqlCommandTextVisitor(IDataEngine dataEngine)
 {
     _dataEngine = dataEngine;
 }
Exemplo n.º 36
0
 public IPipeline <TIn, TIn> AddEngine(IDataEngine <TIn> engine = null) =>
 new EmptyPipeline <TIn>(engine);
Exemplo n.º 37
0
 public SqlCommandTextVisitor(IDataEngine dataEngine)
 {
     _dataEngine = dataEngine;
 }
Exemplo n.º 38
0
		public Connection(IDataEngine dataEngine)
		{
			if(dataEngine == null)
				throw new ArgumentNullException("dataEngine");
			this.DataEngine = dataEngine;
		}
Exemplo n.º 39
0
		/// <summary>
		/// Initializes a new instance associated with the given engine.
		/// </summary>
		/// <param name="engine">The engine this instance is associated with.</param>
		public Parser(IDataEngine engine)
		{
			if (engine == null) throw new ArgumentNullException("engine", "Engine cannot be null.");
			if (engine.IsDisposed) throw new ObjectDisposedException(engine.ToString());
			_Engine = engine;
		}
Exemplo n.º 40
0
		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="engine">The engine this instance will be associated with.</param>
		public Parser(IDataEngine engine) : base(engine) { }
Exemplo n.º 41
0
		/// <summary>
		/// Invoked when disposing or finalizing this instance.
		/// </summary>
		/// <param name="disposing">True if the object is being disposed, false otherwise.</param>
		protected virtual void OnDispose(bool disposing)
		{
			_Engine = null;
			_IsDisposed = true;
		}
        public void Attach(PqlMessage requestMessage, IDataEngine dataEngine, IPqlClientSecurityContext authContext)
        {
            if (dataEngine == null)
            {
                throw new ArgumentNullException("dataEngine");
            }

            if (authContext == null)
            {
                throw new ArgumentNullException("authContext");
            }

            m_executionContext.AssertIsClean();
            m_executionContext.AttachInputMessage(requestMessage, dataEngine, authContext);
        }
Exemplo n.º 43
0
		public FakeLink(IDataEngine engine, NestableTransactionMode mode) : base(engine, mode) { }
Exemplo n.º 44
0
 public SherlockController(IConfiguration configuration, IDataEngine engine)
 {
     _engine    = engine;
     this._host = "nonhost:5001";
 }
Exemplo n.º 45
0
		public IDataLink Clone(IDataEngine engine) { throw new NotSupportedException(); }
Exemplo n.º 46
0
 /// <summary>
 /// Removes the given direct engine from the list of registered ones.
 /// </summary>
 /// <param name="engine">The engine to remove.</param>
 /// <returns>True if the engine was removed, false otherwise.</returns>
 public static bool RemoveEngine(IDataEngine engine)
 {
     return(Core.DataEngine.RemoveEngine(engine));
 }
Exemplo n.º 47
0
		/// <summary>
		/// Convenience method to instantiate a direct link associated with the given direct
		/// engine.
		/// </summary>
		/// <param name="engine">The engine the new link will be associated with.</param>
		/// <param name="mode">The default initial mode for the transaction to be created when needed.</param>
		/// <returns>A new direct link.</returns>
		public static IDataLink Create(
			IDataEngine engine,
			Core.NestableTransactionMode mode = Core.NestableTransactionMode.Database)
		{
			return new Concrete.DataLink(engine, mode);
		}
Exemplo n.º 48
0
		/// <summary>
		/// Removes the given direct engine from the list of registered ones.
		/// </summary>
		/// <param name="engine">The engine to remove.</param>
		/// <returns>True if the engine was removed, false otherwise.</returns>
		public static bool RemoveEngine(IDataEngine engine)
		{
			return Core.DataEngine.RemoveEngine(engine);
		}
Exemplo n.º 49
0
		/// <summary>
		/// Registers the given engine if it has not been registered before.
		/// </summary>
		/// <param name="engine">The engine to register.</param>
		public static void RegisterEngine(IDataEngine engine)
		{
			if (engine == null) throw new ArgumentNullException("engine", "Engine cannot be null.");
			lock (_SyncRoot) { InitializeIfNeeded(); if (!_Engines.Contains(engine)) _Engines.Add(engine); }
		}
Exemplo n.º 50
0
 public AutoImplement(IDataEngine dataengine, IMacroFactory macroFactory, IOutputEngine outputengine, IProject project, IConfiguration configuration) : base(dataengine, macroFactory, outputengine, project, configuration)
 {
 }
Exemplo n.º 51
0
		public static bool TestConnection(string host, ushort port, IDataEngine tempEngine)
		{
			try
			{
				var client = new ProfilerClient(host, port, tempEngine);
				return true;
			}
			catch(System.Net.Sockets.SocketException)
			{
				return false;
			}
		}