public void Init(IServiceMarshalling ServiceMarshalling, IServerMarshaling ServerMarshaling)
        {
            //Initialize resources when Host Server starts up. This gets called when Authentication and RoleProvider
            //gets instantiated when HostServer starts up.

            _cfgMgr          = ServiceMarshalling.GetConfigurationManagerContext();
            _securityManager = ServerMarshaling.GetSecurityManagerContext();
        }
 public K2Connection(IServiceMarshalling serviceMarshalling, IServerMarshaling serverMarshaling)
 {
     if (string.IsNullOrEmpty(_workflowConnectionString) || _workflowConnectionPort == 0)
     {
         _workflowConnectionString = ConfigurationManager.ConnectionStrings["WorkflowServer"].ConnectionString;
     }
     _sessionManager = serverMarshaling.GetSessionManagerContext();
     var sessionCookie = SessionManager.CurrentSessionCookie;
     _sessionConnectionString = serverMarshaling.GetSecurityManagerContext().GetSessionConnectionString(sessionCookie);
 }
 public void Init(IServiceMarshalling serviceMarshalling, IServerMarshaling serverMarshaling)
 {
     lock (syncobject)
     {
         if (SecurityManager == null)
         {
             SecurityManager = serverMarshaling.GetSecurityManagerContext();
         }
         K2Connection = new K2Connection(serviceMarshalling, serverMarshaling);
     }
 }
        public void Init(IServiceMarshalling serviceMarshalling, IServerMarshaling serverMarshaling)
        {
            lock (syncobject)
            {
                if (HostServiceLogger == null)
                {
                    HostServiceLogger = new Logger(serviceMarshalling.GetHostedService(typeof(SourceCode.Logging.ILogger)) as SourceCode.Logging.ILogger);
                    HostServiceLogger.LogDebug("Logger loaded from ServiceMarshalling");
                }

                if (IdentityService == null)
                {
                    IdentityService = serviceMarshalling.GetHostedService(typeof(IIdentityService)) as IIdentityService;
                }
                if (SecurityManager == null)
                {
                    SecurityManager = serverMarshaling.GetSecurityManagerContext();
                }
            }
        }
        public void Init(IServiceMarshalling serviceMarshalling, IServerMarshaling serverMarshaling)
        {
            lock (syncobject)
            {
                //if (Logger == null)
                //{
                //    Logger = new Logger(serviceMarshalling.GetHostedService(typeof(SourceCode.Logging.ILogger)) as SourceCode.Logging.ILogger);
                //    Logger.LogDebug("Logger loaded from ServiceMarshalling");
                //}

                if (IdentityService == null)
                {
                    IdentityService = serviceMarshalling.GetHostedService(typeof(IIdentityService)) as IIdentityService;
                }
                if (SecurityManager == null)
                {
                    SecurityManager = serverMarshaling.GetSecurityManagerContext();
                }

            }
        }
        /// <summary>
        /// Initializes the security provider.
        /// </summary>
        /// <param name="ServiceMarshalling">An IServiceMarshalling representing the service marshaling.</param>
        /// <param name="ServerMarshaling">An IServerMarshaling representing the server marshaling.</param>
        public void Init(IServiceMarshalling ServiceMarshalling, IServerMarshaling ServerMarshaling)
        {
            // Get configuration manager from service marshaling.

            _configurationManager = ServiceMarshalling.GetConfigurationManagerContext();
            // Get security manager from server marshaling.
            _securityManager = ServerMarshaling.GetSecurityManagerContext();
            
            //set up logging
            this._logger = (Logger)ServiceMarshalling.GetHostedService(typeof(Logger).ToString());
        }
        public void Init(IServiceMarshalling serviceMarshalling, IServerMarshaling serverMarshaling)
        {
            lock (syncobject)
            {
                if (Logger.SelfLoaded == true)
                {
                    string type = typeof(SourceCode.Logging.Logger).ToString();
                    if (serviceMarshalling.IsServiceHosted(type))
                    {
                        Logger = new Logger((SourceCode.Logging.Logger)serviceMarshalling.GetHostedService(type));
                        Logger.LogDebug("Logger loaded from ServiceMarshalling");
                    }
                }

                if (IdentityService == null)
                {
                    IdentityService = serviceMarshalling.GetHostedService(typeof(IIdentityService)) as IIdentityService;
                }
                if (SecurityManager == null)
                {
                    SecurityManager = serverMarshaling.GetSecurityManagerContext();
                }

            }
        }