public NestResult Start(CorePlatformOptions corePlatformOptions) {
         ryu.Touch<ItzWartyCommonsRyuPackage>();
         ryu.Touch<ItzWartyProxiesRyuPackage>();

         Configure.Extensions().WithAttributeBasedMapping();

         ryu.Set<HydarConfiguration>(new HydarConfigurationImpl {
            ServicePort = corePlatformOptions.HydarServicePort,
            CourierPort = corePlatformOptions.HydarCourierPort
         });

         ryu.Set<PlatformConfiguration>(new PlatformConfigurationImpl {
            ServicePort = corePlatformOptions.ServicePort
         });

         ryu.Set<PlatformCacheConfiguration>(new PlatformCacheConfigurationImpl {
            DatabaseSessionFactory = Configure.Fluently()
               .ForPostgreSqlConnection("Dargon", corePlatformOptions.ConnectionString, "Npgsql")
               .CreateSessionFactory()
         });

         ryu.Set<SystemState>(new PlatformSystemStateImpl());

         // Dargon.Management
         var managementServerEndpoint = ryu.Get<INetworkingProxy>().CreateAnyEndPoint(corePlatformOptions.ManagementPort);
         ryu.Set<IManagementServerConfiguration>(new ManagementServerConfiguration(managementServerEndpoint));

         // Initialize Hydar Cache
         ((RyuContainerImpl)ryu).Setup(true);

         Console.WriteLine("Initialized!");

         return NestResult.Success;
      }
      public NestResult Start(IEggParameters parameters) {
         this.host = parameters.Host;

         var options = new CorePlatformOptions();
         Parser.Default.ParseArguments(new string[0], options);

         return Start(options);
      }
Exemplo n.º 3
0
      public static void Main(string[] args) {
         ThreadPool.SetMaxThreads(64, 64);
         InitializeLogging();

         Console.Title = "PID " + Process.GetCurrentProcess().Id;
         var options = new CorePlatformOptions();
         if (Parser.Default.ParseArgumentsStrict(args, options)) {
            new CorePlatformEgg().Start(options);
            new CountdownEvent(1).Wait();
         } else {
            Console.WriteLine("Failed to parse command line args.");
         }
      }