Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new lifecycle for the named application or application service.
        /// </summary>
        /// <param name="context">Steeltoe Tooling context.</param>
        /// <param name="name">Application or application service name.</param>
        public Lifecycle(Context context, string name)
        {
            var driver = context.Driver;

            _name = name;
            if (context.Configuration.GetApps().Contains(name))
            {
                _bridge = new AppDriverBridge(driver);
            }
            else
            {
                _bridge = new ServiceDriverBridge(driver);
            }
        }
Ejemplo n.º 2
0
 public void Start()
 {
     try
     {
         // could throw application level exception
         _driverBridge = _injector.GetInstance <DriverBridge>();
         _driverServiceClient.RegisterDriverClientService("localhost", _serverPort);
     }
     catch (Exception ex)
     {
         Logger.Log(Level.Error, "Driver application creation error", ex);
         _driverServiceClient.RegisterDriverClientService(ex);
         _server.ShutdownAsync();
     }
 }
Ejemplo n.º 3
0
 internal override void Undeploy(string name, DriverBridge bridge)
 {
     bridge.Undeploy(name);
 }
Ejemplo n.º 4
0
 internal virtual void Undeploy(string name, DriverBridge bridge)
 {
 }
        private static ulong[] GetHandlers(string httpServerPortNumber, IEvaluatorRequestor evaluatorRequestor)
        {
            var injector = BridgeConfigurationProvider.GetBridgeInjector(evaluatorRequestor);

            try
            {
                var port = injector.GetInstance<HttpServerPort>();
                port.PortNumber = httpServerPortNumber == null
                    ? 0
                    : int.Parse(httpServerPortNumber, CultureInfo.InvariantCulture);

                //TODO: Remove next 2 lines after Obsolete period
                var startHandler = injector.GetInstance<IStartHandler>();
                LOGGER.Log(Level.Info, "Start handler set to be " + startHandler.Identifier);
                _driverBridge = injector.GetInstance<DriverBridge>();
            }
            catch (Exception e)
            {
                Exceptions.CaughtAndThrow(e, Level.Error, "Cannot get instance.", LOGGER);
            }

            return _driverBridge.Subscribe();
        }
        private static ulong[] GetHandlers(string httpServerPortNumber, IEvaluatorRequestor evaluatorRequestor)
        {
            var injector = BridgeConfigurationProvider.GetBridgeInjector(evaluatorRequestor);

            try
            {
                var port = injector.GetInstance<HttpServerPort>();
                port.PortNumber = httpServerPortNumber == null
                    ? 0
                    : int.Parse(httpServerPortNumber, CultureInfo.InvariantCulture);

                _driverBridge = injector.GetInstance<DriverBridge>();
            }
            catch (Exception e)
            {
                Exceptions.CaughtAndThrow(e, Level.Error, "Cannot get instance.", LOGGER);
            }

            return _driverBridge.Subscribe();
        }