1 /* 2 * hunt-amqp: AMQP library for D programming language, based on hunt-net. 3 * 4 * Copyright (C) 2018-2019 HuntLabs 5 * 6 * Website: https://www.huntlabs.net 7 * 8 * Licensed under the Apache-2.0 License. 9 * 10 */ 11 module hunt.amqp.impl.ProtonMetaDataSupportImpl; 12 13 //import java.io.BufferedReader; 14 //import java.io.InputStream; 15 //import java.io.InputStreamReader; 16 //import java.nio.charset.StandardCharsets; 17 18 import hunt.proton.amqp.Symbol; 19 import std.concurrency : initOnce; 20 21 class ProtonMetaDataSupportImpl { 22 23 public static string PRODUCT = "vertx-proton"; 24 //public static Symbol PRODUCT_KEY = Symbol.valueOf("product"); 25 public static string VERSION; 26 //public static Symbol VERSION_KEY = Symbol.valueOf("version"); 27 28 static Symbol PRODUCT_KEY() { 29 __gshared Symbol inst; 30 return initOnce!inst(Symbol.valueOf("product")); 31 } 32 33 34 static Symbol VERSION_KEY() { 35 __gshared Symbol inst; 36 return initOnce!inst(Symbol.valueOf("version")); 37 } 38 39 //static { 40 // string version = "unknown"; 41 // try { 42 // InputStream in = null; 43 // String path = ProtonMetaDataSupportImpl.class.getPackage().getName().replace(".", "/"); 44 // if ((in = ProtonMetaDataSupportImpl.class.getResourceAsStream("/" + path + "/version.txt")) !is null) { 45 // try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));) { 46 // String line = reader.readLine(); 47 // if (line !is null && !line.isEmpty()) { 48 // version = line; 49 // } 50 // } 51 // } 52 // } catch (Throwable err) { 53 // LOG.error("Problem determining version details", err); 54 // } 55 56 // VERSION = version; 57 //} 58 }