public FileSession(ISessionHandler resultHandler, IResultFactory resultFactory, FileSessionParameters parameters) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } if (string.IsNullOrWhiteSpace(parameters.FileName)) { throw new ArgumentException(@"FileName is required.", nameof(parameters)); } _watchFile = parameters.Watch; _syncContext = SynchronizationContext.Current; _resultHandler = resultHandler; _resultFactory = resultFactory; Name = parameters.FileName; //Allow proper decoding of orders. JsonConvert.DefaultSettings = () => new JsonSerializerSettings { Converters = { new OrderJsonConverter() } }; }
public void Init(HttpApplication app) { sessionForStaticFiles = (Environment.GetEnvironmentVariable("MONO_XSP_STATIC_SESSION") != null); SessionConfig cfg = GetConfig(); if (handlerType == null) { return; } if (cfg.CookieLess) { app.BeginRequest += new EventHandler(OnBeginRequest); } app.AcquireRequestState += new EventHandler(OnAcquireState); app.ReleaseRequestState += new EventHandler(OnReleaseRequestState); app.EndRequest += new EventHandler(OnEndRequest); if (handlerType != null && handler == null) { handler = (ISessionHandler)Activator.CreateInstance(handlerType); handler.Init(this, app, cfg); //initialize } }
public TcpServer(ISessionHandler handler, int maxSessionLimit = 10000) : base(maxSessionLimit) { m_Handler = handler; m_MaxWaiter = new SemaphoreSlim(maxSessionLimit); m_Socket = new Socket(SocketType.Stream, ProtocolType.Tcp); }
public SessionCommands(ISessionHandler sessionHandler) : base("Session") { RegisterCommand(new ListSessionsCommand(sessionHandler)); RegisterCommand(new RegisterSessionCommand(sessionHandler)); RegisterCommand(new EndSessionCommand(sessionHandler)); }
public ServiceBusiness(IRepository repository, IServiceLog serviceLog, ISettingBusiness settingBusiness, Quilt4Net.Interfaces.ISessionHandler sessionHandler) { _repository = repository; _serviceLog = serviceLog; _settingBusiness = settingBusiness; _sessionHandler = sessionHandler; }
public WorkoutSessionExerciseController(IServiceFactory serviceFactory , IMapperFactory mapperFactory , IUserProvider userProvider , ISessionHandler sessionHandler) : base(serviceFactory, mapperFactory, userProvider, sessionHandler) { }
public HadoukenService(ILogger <HadoukenService> logger, ISessionHandler sessionHandler, IHttpServer httpServer, IExtensionFactory extensionFactory) { if (logger == null) { throw new ArgumentNullException("logger"); } if (sessionHandler == null) { throw new ArgumentNullException("sessionHandler"); } if (httpServer == null) { throw new ArgumentNullException("httpServer"); } if (extensionFactory == null) { throw new ArgumentNullException("extensionFactory"); } _logger = logger; _sessionHandler = sessionHandler; _httpServer = httpServer; _extensionFactory = extensionFactory; _plugins = new List <IPlugin>(); }
public GrpcContentServer( ILogger logger, Capabilities serviceCapabilities, ISessionHandler <IContentSession> sessionHandler, IReadOnlyDictionary <string, IContentStore> storesByName, LocalServerConfiguration?localServerConfiguration = null) { Contract.RequiresNotNull(storesByName); _serviceCapabilities = serviceCapabilities; _contentStoreByCacheName = storesByName; _bufferSize = localServerConfiguration?.BufferSizeForGrpcCopies ?? ContentStore.Grpc.GrpcConstants.DefaultBufferSizeBytes; _gzipSizeBarrier = localServerConfiguration?.GzipBarrierSizeForGrpcCopies ?? (_bufferSize * 8); _ongoingPushCountLimit = localServerConfiguration?.ProactivePushCountLimit ?? LocalServerConfiguration.DefaultProactivePushCountLimit; _traceGrpcOperations = localServerConfiguration?.TraceGrpcOperations ?? false; _pool = new ByteArrayPool(_bufferSize); ContentSessionHandler = sessionHandler; _fileSystem = localServerConfiguration?.FileSystem ?? new PassThroughFileSystem(); _workingDirectory = (localServerConfiguration?.DataRootPath ?? _fileSystem.GetTempPath()) / "GrpcContentServer"; GrpcAdapter = new ContentServerAdapter(this); Logger = logger; }
public SectorController(ISessionHandler sessionHandler, IMiddleware middleware, ISectorContainer sectorContainer) { this._sessionHandler = sessionHandler; this._middleware = middleware; this._sectorContainer = sectorContainer; }
public OidcTokenRenewalHandler( OidcClient oidcClient, ISessionHandler sessionHandler) { _oidcClient = oidcClient ?? throw new ArgumentNullException(nameof(oidcClient)); _sessionHandler = sessionHandler ?? throw new ArgumentNullException(nameof(sessionHandler)); }
//----------------------------------------- Public API ---------------------------------------------------- public bool Run() { if (Script.ScriptType == ScriptType.Wholesale) { sessionHandler = new SessionHandlerWholesale(callStatistics); } else { sessionHandler = new SessionHandlerRetail(callStatistics); } var _rbrResult = RbrResult.Success; callState = sessionHandler.OnStarted(); try { initialize(); for (var _i = 1; _i <= Script.NumberOfSubSessions; _i++) { authenticate(_i); ExecuteScript(); } } catch (RbrException _ex) { _rbrResult = handleRbrException(_ex); } catch (Exception _ex) { _rbrResult = handleException(_ex); } finally { setCallEnd(_rbrResult); } return(_rbrResult == RbrResult.Success); }
} //客户端发送过来的都需要Mask,服务端发送的不能Mask public TcpSession(ISessionHandler handler) : this(new Socket(SocketType.Stream, ProtocolType.Tcp), handler, null) { if (handler == null) { throw new ArgumentNullException(nameof(handler)); } }
public SessionTest() { sessionHandler = new SessionHandler(); administratorHandler = new AdministratorHandler(); colaboratorHandler = new ColaboratorHandler(); }
public DiscoveryCommand(ILogger <DiscoveryCommand> log, IInstaApi api, BasicConfig config, ISessionHandler session) : base(log) { this.log = log ?? throw new ArgumentNullException(nameof(log)); this.config = config ?? throw new ArgumentNullException(nameof(config)); this.session = session ?? throw new ArgumentNullException(nameof(session)); this.api = api ?? throw new ArgumentNullException(nameof(api)); }
public ApiSession(ISessionHandler sessionHandler, IApiClient apiClient, ApiSessionParameters parameters) { _apiClient = apiClient; _sessionHandler = sessionHandler; _parameters = parameters; _syncContext = SynchronizationContext.Current; }
public UserController(ISessionHandler sessionHandler, IBookContainer bookContainer, IMiddleware middleware, IUserContainer userContainer) { this._userContainer = userContainer; this._bookContainer = bookContainer; this._sessionHandler = sessionHandler; this._middleware = middleware; }
protected BaseController(IServiceFactory serviceFactory, IMapperFactory mapperFactory, IUserProvider userProvider, ISessionHandler sessionHandler) { _serviceFactory = serviceFactory; _mapperFactory = mapperFactory; _userProvider = userProvider; _sessionHandler = sessionHandler; }
public CourseController( ISessionHandler sessionHandler, IMiddleware middleware, ICourseContainer iCourseContainer) { this._sessionHandler = sessionHandler; this._middleware = middleware; this._courseContainer = iCourseContainer; }
public BookController(IBookContainer bookContainer, ISectorContainer sectorContainer, ICourseContainer courseContainer, ISessionHandler sessionHandler, IMiddleware middleware) { this._bookContainer = bookContainer; this._sectorContainer = sectorContainer; this._courseContainer = courseContainer; this._sessionHandler = sessionHandler; this._middleware = middleware; }
/// <nodoc /> public GrpcCacheServer( ILogger logger, ISessionHandler <ICacheSession> sessionHandler) { _logger = logger; _sessionHandler = sessionHandler; _adapter = new MemoizationServerAdapter(this); }
public UserController(IMembershipService membershipService, IBaseRepository <User> userRepository, IBaseRepository <UserPin> userPinRepository, ISessionHandler sessionHandler) { _membershipService = membershipService; _userRepository = userRepository; _sessionHandler = sessionHandler; _userPinRepository = userPinRepository; }
public DefaultSessionContext(string name, ISessionPipeline pipeline, ISessionHandler handler) : base(pipeline) { this.Name = name; this.Handler = handler; if (Handler != null) { this.IsInbound = Handler is ISessionInboundHandler; this.IsOutbound = Handler is ISessionOutboundHandler; } }
internal TcpSession(Socket socket, ISessionHandler handler, TcpServer parent) { IsClientSendMask = (handler == WebSocket.WebSocketSession.WebSocketSessionHandler.Handler); m_SaeaManager = SocketRuntime.Instance.SaeaManager; m_Reader = new DataReader(new ReceiveStream()); m_Writer = new DataWriter(new SendStream(this)); m_Parent = parent; m_Socket = socket; Socket = socket; m_Handler = handler; }
public void Setup() { ISettingsRepository repo = new MockSettingsRepository(); handler = new SessionHandler(repo); //mock the application cache var mockedHttpContextBase = new Mock <HttpContextBase>(); mockedHttpContextBase.Setup(m => m.Cache).Returns(HttpRuntime.Cache); }
private ProfilerSession() { _settings = new ProfilerSettings(); _assertions = new List <Func <IResult, bool> >(); _executor = new ThreadSessionHandler(); _sessionPipeline = new TaskExecutionChain(); _sessionPipeline.SetNext(new ElapsedTimeSessionHandler()); _processingPipeline = new ProcessingPipeline(); }
public ClientSession(IClientSocketWrapper client, HttpServer httpServer, HttpServerOptions options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } _httpServer = httpServer ?? throw new ArgumentNullException(nameof(httpServer)); Client = client ?? throw new ArgumentNullException(nameof(client)); _sessionHandler = new HttpSessionHandler(this, options); }
/// <nodoc /> public GrpcContentServer( ILogger logger, Capabilities serviceCapabilities, ISessionHandler <IContentSession> sessionHandler, Dictionary <string, IContentStore> storesByName) { _logger = logger; _serviceCapabilities = serviceCapabilities; _sessionHandler = sessionHandler; _adapter = new ContentServerAdapter(this); _contentStoreByCacheName = storesByName; }
/// <nodoc /> public GrpcCacheServer( ILogger logger, Capabilities serviceCapabilities, ISessionHandler <ICacheSession> sessionHandler, Dictionary <string, IContentStore> storesByName, LocalServerConfiguration localServerConfiguration = null) : base(logger, serviceCapabilities, sessionHandler, storesByName, localServerConfiguration) { _cacheSessionHandler = sessionHandler; GrpcAdapter = new MemoizationServerAdapter(this); }
public CodedUiTestContext( INavigationService navigationService, ISessionHandler sessionHandler, ICommunicationService communicationService, ISettings settings, ILogger logger) { this.navigationService = navigationService ?? throw new ArgumentNullException(nameof(navigationService)); this.sessionHandler = sessionHandler ?? throw new ArgumentNullException(nameof(sessionHandler)); this.CommunicationService = communicationService ?? throw new ArgumentNullException(nameof(communicationService)); this.Settings = settings ?? throw new ArgumentNullException(nameof(settings)); this.Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
/// <summary> /// Set the next execution item /// </summary> /// <param name="next">The next executor</param> public void SetNext(ISessionHandler next) { if (_root == null) { _root = next; _last = next; } else { _last.SetNext(next); } _last = next; }
/// <nodoc /> public GrpcContentServer( ILogger logger, Capabilities serviceCapabilities, ISessionHandler <IContentSession> sessionHandler, Dictionary <string, IContentStore> storesByName, int?bufferSize = null) { _logger = logger; _serviceCapabilities = serviceCapabilities; _sessionHandler = sessionHandler; _adapter = new ContentServerAdapter(this); _contentStoreByCacheName = storesByName; _bufferSize = bufferSize ?? ContentStore.Grpc.CopyConstants.DefaultBufferSize; }
public StreamSession(ISessionHandler sessionHandler, IResultFactory resultFactory, StreamSessionParameters parameters) { if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); } _sessionHandler = sessionHandler; _resultFactory = resultFactory; _host = parameters.Host; _port = parameters.Port; _syncContext = SynchronizationContext.Current; }
protected internal IssueHandlerBase(ISessionHandler sessionHandler) { lock (_syncRoot) { if (_instanceCounter != 0) { if (!sessionHandler.Client.Configuration.AllowMultipleInstances) { throw new InvalidOperationException("Multiple instances is not allowed. Set configuration setting AllowMultipleInstances to true if you want to use multiple instances of this object."); } } _instanceCounter++; } _sessionHandler = sessionHandler; }
public HadoukenService(ILogger<HadoukenService> logger, ISessionHandler sessionHandler, IHttpServer httpServer, IExtensionFactory extensionFactory) { if (logger == null) throw new ArgumentNullException("logger"); if (sessionHandler == null) throw new ArgumentNullException("sessionHandler"); if (httpServer == null) throw new ArgumentNullException("httpServer"); if (extensionFactory == null) throw new ArgumentNullException("extensionFactory"); _logger = logger; _sessionHandler = sessionHandler; _httpServer = httpServer; _extensionFactory = extensionFactory; _plugins = new List<IPlugin>(); }
public HomeController(ISessionHandler sessionHandler, IServiceBusiness serviceBusiness, ISettingBusiness settingBusiness) { _sessionHandler = sessionHandler; _serviceBusiness = serviceBusiness; _settingBusiness = settingBusiness; }
public SomeBusiness1(ISessionHandler sessionHandler, IIssueHandler issueHandler) { _sessionHandler = sessionHandler; _sessionHandler.SessionRegistrationStartedEvent += _sessionHandler_SessionRegistrationStartedEvent; _sessionHandler.SessionRegistrationCompletedEvent += _sessionHandler_SessionRegistrationCompletedEvent; _sessionHandler.SessionEndStartedEvent += _sessionHandler_SessionEndStartedEvent; _sessionHandler.SessionEndCompletedEvent += _sessionHandler_SessionEndCompletedEvent; _issueHandler = issueHandler; _issueHandler.IssueRegistrationStartedEvent += _issueHandler_IssueRegistrationStartedEvent; _issueHandler.IssueRegistrationCompletedEvent += _issueHandler_IssueRegistrationCompletedEvent; }
public RegisterSessionCommand(ISessionHandler sessionHandler) : base("Register", "Register session") { _sessionHandler = sessionHandler; }
public void Init (HttpApplication app) { sessionForStaticFiles = (Environment.GetEnvironmentVariable ("MONO_XSP_STATIC_SESSION") != null); if (config == null) { config = (SessionConfig) HttpContext.GetAppConfig ("system.web/sessionState"); if (config == null) config = new SessionConfig (null); if (config.Mode == SessionStateMode.StateServer) handlerType = typeof (SessionStateServerHandler); if (config.Mode == SessionStateMode.SQLServer) handlerType = typeof (SessionSQLServerHandler); if (config.Mode == SessionStateMode.InProc) handlerType = typeof (SessionInProcHandler); if (config.Mode == SessionStateMode.Off) return; } if (config.CookieLess) app.BeginRequest += new EventHandler (OnBeginRequest); app.AddOnAcquireRequestStateAsync ( new BeginEventHandler (OnBeginAcquireState), new EndEventHandler (OnEndAcquireState)); app.ReleaseRequestState += new EventHandler (OnReleaseRequestState); app.EndRequest += new EventHandler (OnEndRequest); if (handlerType != null && handler == null) { handler = (ISessionHandler) Activator.CreateInstance (handlerType); handler.Init (this, app, config); //initialize } }
public EndSessionCommand(ISessionHandler sessionHandler) : base("End", "End session.") { _sessionHandler = sessionHandler; }
public SessionMessageLifecycleCallback(ISessionHandler sessionHandler) { SessionHandler = sessionHandler; }
public IssueHandler(ISessionHandler sessionHandler) : base(sessionHandler) { }
public ListSessionsCommand(ISessionHandler sessionHandler) : base("List", "List sessions") { _sessionHandler = sessionHandler; }