private static Properties GetProperties(string filePath, PropertiesSerializationContext propertiesContext) { var properties = PropertyParser.Parse(filePath); properties.ExpandEnvironmentVariables(propertiesContext.ExpandVariables); return(properties); }
public void Start() { Logger.Info("Starting GLUE..."); ApplicationGuiMethods.Touch(); var propertiesContext = new PropertiesSerializationContext(CumulativeExpandVariables.Instance, new DefaultTypeResolver(GlobalTypeResolver.Instance), GlobalConfigurationFactoryLocator.Instance); var configPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var agmPropertiesFile = Path.Combine(configPath, "Config", "agm.properties"); var agmProperties = GetProperties(agmPropertiesFile, propertiesContext); var transportFactory = new DOTTransportFactory(); var agmConfiguration = new AgmConfiguration(transportFactory); var agmFactory = new ApplicationGuiMethods(); agmFactory.Initialize(agmConfiguration); Client = SetupAgmClient(agmProperties, agmFactory, propertiesContext); Server = SetupAgmServer(agmProperties, agmFactory, propertiesContext); Logger.Info("GLUE started."); }
private static IClient SetupAgmClient(Properties agmProperties, IApplicationGuiMethods agmFactory, PropertiesSerializationContext propertiesContext) { var clientConfiguration = (ClientConfiguration)ConfigurationHelper.LoadClientConfiguration(agmProperties, propertiesContext); clientConfiguration.EventDispatcherFactory = new DefaultStandardEventDispatcherFactory(); var client = agmFactory.CreateClient(clientConfiguration); client.Start(); return(client); }
private static IServer SetupAgmServer(Properties agmProperties, IApplicationGuiMethods agmFactory, PropertiesSerializationContext propertiesContext) { var serverConfiguration = (ServerConfiguration)ConfigurationHelper.LoadServerConfiguration(agmProperties, propertiesContext); serverConfiguration.EventDispatcherFactory = new DefaultStandardEventDispatcherFactory(); var server = agmFactory.CreateServer(serverConfiguration); server.Start(); return(server); }