| Line 9... |
Line 9... |
| 9 |
import in.shop2020.warehouse.WarehouseService.Processor;
|
9 |
import in.shop2020.warehouse.WarehouseService.Processor;
|
| 10 |
import in.shop2020.warehouse.service.handler.WarehouseServiceHandler;
|
10 |
import in.shop2020.warehouse.service.handler.WarehouseServiceHandler;
|
| 11 |
|
11 |
|
| 12 |
import org.apache.commons.daemon.Daemon;
|
12 |
import org.apache.commons.daemon.Daemon;
|
| 13 |
import org.apache.commons.daemon.DaemonContext;
|
13 |
import org.apache.commons.daemon.DaemonContext;
|
| 14 |
|
- |
|
| 15 |
import org.apache.commons.logging.Log;
|
14 |
import org.apache.commons.logging.Log;
|
| 16 |
import org.apache.commons.logging.LogFactory;
|
15 |
import org.apache.commons.logging.LogFactory;
|
| 17 |
import org.apache.thrift.protocol.TBinaryProtocol;
|
16 |
import org.apache.thrift.protocol.TBinaryProtocol;
|
| 18 |
import org.apache.thrift.protocol.TProtocolFactory;
|
17 |
import org.apache.thrift.protocol.TProtocolFactory;
|
| 19 |
import org.apache.thrift.server.TServer;
|
18 |
import org.apache.thrift.server.TServer;
|
| Line 21... |
Line 20... |
| 21 |
import org.apache.thrift.server.TThreadPoolServer.Args;
|
20 |
import org.apache.thrift.server.TThreadPoolServer.Args;
|
| 22 |
import org.apache.thrift.transport.TFramedTransport;
|
21 |
import org.apache.thrift.transport.TFramedTransport;
|
| 23 |
import org.apache.thrift.transport.TServerSocket;
|
22 |
import org.apache.thrift.transport.TServerSocket;
|
| 24 |
import org.apache.thrift.transport.TServerTransport;
|
23 |
import org.apache.thrift.transport.TServerTransport;
|
| 25 |
import org.apache.thrift.transport.TTransportFactory;
|
24 |
import org.apache.thrift.transport.TTransportFactory;
|
| - |
|
25 |
import org.springframework.context.ApplicationContext;
|
| - |
|
26 |
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
| 26 |
|
27 |
|
| 27 |
/**
|
28 |
/**
|
| 28 |
* @author mandeep
|
29 |
* @author mandeep
|
| 29 |
*
|
30 |
*
|
| 30 |
*/
|
31 |
*/
|
| Line 46... |
Line 47... |
| 46 |
|
47 |
|
| 47 |
dbHost = "jdbc:mysql://" + ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_db_hostname.toString()) + "/warehouse";
|
48 |
dbHost = "jdbc:mysql://" + ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_db_hostname.toString()) + "/warehouse";
|
| 48 |
String portNo = ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_server_port.toString());
|
49 |
String portNo = ConfigClient.getClient().get(ConfigClientKeys.warehouse_service_server_port.toString());
|
| 49 |
int port = Integer.parseInt(portNo);
|
50 |
int port = Integer.parseInt(portNo);
|
| 50 |
|
51 |
|
| 51 |
|
- |
|
| 52 |
|
52 |
log.info("Creating context");
|
| - |
|
53 |
ApplicationContext context = new ClassPathXmlApplicationContext("context.xml");
|
| 53 |
handler = new WarehouseServiceHandler();
|
54 |
Iface handler = (Iface)context.getBean("warehouseHandler");
|
| 54 |
processor = new Processor<Iface>(handler);
|
55 |
processor = new Processor<Iface>(handler);
|
| 55 |
|
56 |
|
| 56 |
log.info("DB Connection String is: " + dbHost);
|
57 |
log.info("DB Connection String is: " + dbHost);
|
| 57 |
log.info("URL read by data source before setting is: " + handler.getDataSourceUrl());
|
58 |
//log.info("URL read by data source before setting is: " + handler.getDataSourceUrl());
|
| 58 |
handler.setDataSourceUrl(dbHost);
|
59 |
//handler.setDataSourceUrl(dbHost);
|
| 59 |
log.info("URL read by data source after setting is: " + handler.getDataSourceUrl());
|
60 |
//log.info("URL read by data source after setting is: " + handler.getDataSourceUrl());
|
| 60 |
|
61 |
|
| 61 |
TServerTransport serverTransport = new TServerSocket(port);
|
62 |
TServerTransport serverTransport = new TServerSocket(port);
|
| 62 |
TTransportFactory tFactory = new TFramedTransport.Factory();
|
63 |
TTransportFactory tFactory = new TFramedTransport.Factory();
|
| 63 |
TProtocolFactory pFactory = new TBinaryProtocol.Factory();
|
64 |
TProtocolFactory pFactory = new TBinaryProtocol.Factory();
|
| 64 |
|
65 |
|