construct registering nodes with lists

This commit is contained in:
Fangjin Yang 2012-11-13 15:00:55 -08:00
parent 0ef40171a8
commit cd1a812fff
4 changed files with 10 additions and 6 deletions

View File

@ -55,6 +55,7 @@ import org.skife.config.ConfigurationObjectFactory;
import java.io.IOException;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ScheduledExecutorService;
@ -90,7 +91,7 @@ public abstract class QueryableNode<T extends QueryableNode> extends Registering
ConfigurationObjectFactory configFactory
)
{
super(jsonMapper, smileMapper);
super(Arrays.asList(jsonMapper, smileMapper));
this.log = log;
this.configFactory = configFactory;

View File

@ -23,6 +23,7 @@ import com.metamx.druid.index.v1.serde.Registererer;
import org.codehaus.jackson.map.ObjectMapper;
import java.util.Arrays;
import java.util.List;
/**
*/
@ -43,16 +44,16 @@ public class RegisteringNode
private static boolean doneRegister = false;
private final ObjectMapper[] mappers;
private final List<ObjectMapper> mappers;
public RegisteringNode(ObjectMapper... mappers)
public RegisteringNode(List<ObjectMapper> mappers)
{
this.mappers = mappers;
}
public RegisteringNode registerHandlers(Registererer... registererers)
{
registerHandlers(Arrays.asList(registererers), Arrays.asList(mappers));
registerHandlers(Arrays.asList(registererers), mappers);
return this;
}
}

View File

@ -100,6 +100,7 @@ import org.mortbay.jetty.servlet.ServletHolder;
import org.skife.config.ConfigurationObjectFactory;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
@ -145,7 +146,7 @@ public class IndexerCoordinatorNode extends RegisteringNode
ConfigurationObjectFactory configFactory
)
{
super(jsonMapper);
super(Arrays.asList(jsonMapper));
this.jsonMapper = jsonMapper;
this.lifecycle = lifecycle;

View File

@ -72,6 +72,7 @@ import org.mortbay.jetty.servlet.ServletHolder;
import org.skife.config.ConfigurationObjectFactory;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
@ -113,7 +114,7 @@ public class WorkerNode extends RegisteringNode
ConfigurationObjectFactory configFactory
)
{
super(jsonMapper);
super(Arrays.asList(jsonMapper));
this.jsonMapper = jsonMapper;
this.lifecycle = lifecycle;