From 76d0088bbb6951dc845bc2b6d4945fdf6eb772f8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 26 Mar 2017 15:05:16 +1300 Subject: TrackerServer class cleanup --- src/org/traccar/TrackerServer.java | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/TrackerServer.java b/src/org/traccar/TrackerServer.java index 108688fb8..7e0a6f0c6 100644 --- a/src/org/traccar/TrackerServer.java +++ b/src/org/traccar/TrackerServer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 - 2014 Anton Tananaev (anton@traccar.org) + * Copyright 2012 - 2017 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,9 +29,6 @@ import org.jboss.netty.channel.group.DefaultChannelGroup; import java.net.InetSocketAddress; import java.nio.ByteOrder; -/** - * Tracker server - */ public abstract class TrackerServer { private final Bootstrap bootstrap; @@ -49,7 +46,6 @@ public abstract class TrackerServer { this.bootstrap = bootstrap; this.protocol = protocol; - // Set appropriate channel factory if (bootstrap instanceof ServerBootstrap) { bootstrap.setFactory(GlobalChannelFactory.getFactory()); } else if (bootstrap instanceof ConnectionlessBootstrap) { @@ -69,22 +65,16 @@ public abstract class TrackerServer { protected abstract void addSpecificHandlers(ChannelPipeline pipeline); - /** - * Server port - */ - private Integer port; + private int port; - public Integer getPort() { + public int getPort() { return port; } - public void setPort(Integer port) { + public void setPort(int port) { this.port = port; } - /** - * Server listening interface - */ private String address; public String getAddress() { @@ -95,17 +85,11 @@ public abstract class TrackerServer { this.address = address; } - /** - * Set endianness - */ public void setEndianness(ByteOrder byteOrder) { bootstrap.setOption("bufferFactory", new HeapChannelBufferFactory(byteOrder)); bootstrap.setOption("child.bufferFactory", new HeapChannelBufferFactory(byteOrder)); } - /** - * Opened channels - */ private final ChannelGroup allChannels = new DefaultChannelGroup(); public ChannelGroup getChannelGroup() { @@ -120,9 +104,6 @@ public abstract class TrackerServer { return bootstrap.getPipelineFactory(); } - /** - * Start server - */ public void start() { InetSocketAddress endpoint; if (address == null) { @@ -143,9 +124,6 @@ public abstract class TrackerServer { } } - /** - * Stop server - */ public void stop() { ChannelGroupFuture future = getChannelGroup().close(); future.awaitUninterruptibly(); -- cgit v1.2.3