Skip to content

Commit

Permalink
stub out methods required by jsvc
Browse files Browse the repository at this point in the history
  • Loading branch information
eevans committed Dec 21, 2010
1 parent 8beacc5 commit 6da0679
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions src/com/rackspace/flewton/CollectorServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ public class CollectorServer {
};
}

private int remotePort;

private static List<AbstractBackend> createBackends(String[] backendNames, HierarchicalINIConfiguration config) throws ConfigError {
List<AbstractBackend> backends = new ArrayList<AbstractBackend>();

Expand Down Expand Up @@ -134,16 +136,30 @@ private static HierarchicalINIConfiguration createConfig() throws ConfigurationE
}

public static void main(String[] args) throws ConfigurationException, ConfigError {
CollectorServer server = new CollectorServer();
server.setup();
server.start();
}

public void setup() throws ConfigurationException, ConfigError {
HierarchicalINIConfiguration config = createConfig();

// UDP port number.
int remotePort = config.getInt("listenPort", 9995);
remotePort = config.getInt("listenPort", 9995);
// Backend class names
String[] backEnds = config.getStringArray("backendClass");

if (backEnds.length > 0)
CollectorHandler.setBackends(createBackends(backEnds, config));

}

/* jsvc */
public void init(String[] arguments) throws ConfigurationException, ConfigError {
setup();
}

/* jsvc */
public void start() {
DatagramChannelFactory f = new NioDatagramChannelFactory(Executors.newCachedThreadPool());
ConnectionlessBootstrap bootstrap = new ConnectionlessBootstrap(f);

Expand All @@ -164,5 +180,15 @@ public ChannelPipeline getPipeline() throws Exception {
logger.info("Binding to UDP 0.0.0.0:{}", remotePort);
bootstrap.bind(new InetSocketAddress(remotePort));
}

/* jsvc */
public void stop() {

}

/* jsvc */
public void destroy() {

}

}

0 comments on commit 6da0679

Please sign in to comment.