Subversion Repositories SmartDukaan

Rev

Rev 4574 | Rev 4718 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4574 Rev 4637
Line 29... Line 29...
29
    private static Log log = LogFactory.getLog(WarehouseServer.class);
29
    private static Log log = LogFactory.getLog(WarehouseServer.class);
30
 
30
 
31
    private static WarehouseServiceHandler handler;
31
    private static WarehouseServiceHandler handler;
32
 
32
 
33
    private static Processor<Iface> processor;
33
    private static Processor<Iface> processor;
-
 
34
    private static String dbHost;
34
 
35
 
35
    public static void main(String[] args){
36
    public static void main(String[] args){
36
        try {
37
        try {
37
            handler = new WarehouseServiceHandler();
-
 
38
            processor = new Processor<Iface>(handler);
-
 
39
 
-
 
40
            int port = 9013;
38
            int port = 9013;
41
            try {
39
            try {
-
 
40
                dbHost = "jdbc:mysql://" + ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_db_hostname.toString()) + "/warehouse";
42
                String portNo = ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_server_port.toString());
41
                String portNo = ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_server_port.toString());
43
                port = Integer.parseInt(portNo);
42
                port = Integer.parseInt(portNo);
44
            } catch(Exception e) {
43
            } catch(Exception e) {
45
                log.warn("Unable to get port number from the Config server because of:", e);
44
                log.warn("Unable to get port number from the Config server because of:", e);
46
            }
45
            }
47
 
46
 
-
 
47
            // Setting dbHost env property to make this value accessible in context.xml 
-
 
48
            // while spring context creation.
-
 
49
            System.setProperty("dbHost", dbHost);
-
 
50
 
-
 
51
            handler = new WarehouseServiceHandler();
-
 
52
            processor = new Processor<Iface>(handler);
48
            TServerTransport serverTransport = new TServerSocket(port);
53
            TServerTransport serverTransport = new TServerSocket(port);
49
            TTransportFactory tFactory = new TFramedTransport.Factory();
54
            TTransportFactory tFactory = new TFramedTransport.Factory();
50
            TProtocolFactory pFactory = new TBinaryProtocol.Factory();
55
            TProtocolFactory pFactory = new TBinaryProtocol.Factory();
51
            
56
            
52
            Args serverParams = new Args(serverTransport);
57
            Args serverParams = new Args(serverTransport);