Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stub out methods required by jsvc

  • Loading branch information...
commit 6da067935716134b95bcc0e09590f2d4863156e1 1 parent 8beacc5
@eevans eevans authored
Showing with 28 additions and 2 deletions.
  1. +28 −2 src/com/rackspace/flewton/CollectorServer.java
View
30 src/com/rackspace/flewton/CollectorServer.java
@@ -65,6 +65,8 @@
};
}
+ private int remotePort;
+
private static List<AbstractBackend> createBackends(String[] backendNames, HierarchicalINIConfiguration config) throws ConfigError {
List<AbstractBackend> backends = new ArrayList<AbstractBackend>();
@@ -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);
@@ -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() {
+
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.