예제 #1
0
 static void Main(string[] args)
 {
     LOGGER.Info("loading application context");
     try
     {
         AccountRepository accountRepository = new AccountRepository();
         TripRepository    tripRepository    = new TripRepository();
         BookingRepository bookingRepository = new BookingRepository();
         BookingValidator  bookingValidator  = new BookingValidator();
         AccountValidator  accountValidator  = new AccountValidator();
         TripValidator     tripValidator     = new TripValidator();
         ITripServices     tripServices      = new TripServicesImpl(accountRepository, tripRepository, bookingRepository, accountValidator, tripValidator, bookingValidator);
         AbstractServer    server            = new RpcConcurrentServer(ConfigurationManager.AppSettings["host"],
                                                                       Int32.Parse(ConfigurationManager.AppSettings["port"]), tripServices);
         server.Start();
     }
     catch (Exception ex)
     {
         LOGGER.Warn(ex.StackTrace);
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());

            XmlConfigurator.Configure(logRepository, new FileInfo("log4net.config"));

            TripRepository    tripRepository    = new TripRepository();
            TripValidator     tripValidator     = new TripValidator();
            AccountRepository accountRepository = new AccountRepository();
            AccountValidator  accountValidator  = new AccountValidator();
            BookingRepository bookingRepository = new BookingRepository();
            BookingValidator  bookingValidator  = new BookingValidator();
            ITripServices     tripServices      = new TripServicesImpl(accountRepository, tripRepository, bookingRepository,
                                                                       accountValidator, tripValidator, bookingValidator);

            TripServicesGrpcImpl tripServicesGrpc = new TripServicesGrpcImpl(tripServices);
            GrpcServer           server           = new GrpcServer(int.Parse(ConfigurationManager.AppSettings["port"]),
                                                                   ConfigurationManager.AppSettings["host"], tripServicesGrpc);

            server.Start();
        }