public static SlaveNode buildSlave(String configfile,boolean needStart)
{
SlaveNode slaveNode = new SlaveNode();
JobResultMerger jobResultMerger2 = new JobResultMerger();
SocketSlaveConnector slaveConnector = new SocketSlaveConnector();
SlaveMonitor monitor = new SlaveMonitor();
slaveConnector.setDownstreamHandler(new ObjectEncoder());
slaveConnector.setUpstreamHandler(new ObjectDecoder());
StatisticsEngine statisticsEngine = new StatisticsEngine();
SlaveConfig slaveConfig = new SlaveConfig();
slaveConfig.load(configfile);
slaveNode.setConfig(slaveConfig);