Minor, renamed SimpleMessaging to ProtocolProcessorBootstrapper

This commit is contained in:
andsel
2016-07-22 13:32:25 +02:00
parent 8cc588d766
commit 32b6b9b1da
4 changed files with 11 additions and 24 deletions
@@ -28,7 +28,7 @@ import io.moquette.interception.HazelcastMsg;
import io.moquette.interception.InterceptHandler;
import io.moquette.parser.proto.messages.PublishMessage;
import io.moquette.server.config.MemoryConfig;
import io.moquette.spi.impl.SimpleMessaging;
import io.moquette.spi.impl.ProtocolProcessorBootstrapper;
import io.moquette.server.config.FilesystemConfig;
import io.moquette.server.config.IConfig;
import io.moquette.server.netty.NettyAcceptor;
@@ -64,7 +64,7 @@ public class Server {
private HazelcastInstance hazelcastInstance;
private SimpleMessaging m_messaging;
private ProtocolProcessorBootstrapper m_processorBootstrapper;
public static void main(String[] args) throws IOException {
final Server server = new Server();
@@ -139,8 +139,8 @@ public class Server {
}
configureCluster(config);
LOG.info("Persistent store file: {}", config.getProperty(BrokerConstants.PERSISTENT_STORE_PROPERTY_NAME));
m_messaging = SimpleMessaging.getInstance();
final ProtocolProcessor processor = m_messaging.init(config, handlers, authenticator, authorizator, this);
m_processorBootstrapper = new ProtocolProcessorBootstrapper();
final ProtocolProcessor processor = m_processorBootstrapper.init(config, handlers, authenticator, authorizator, this);
if (sslCtxCreator == null) {
sslCtxCreator = new DefaultMoquetteSslContextCreator(config);
@@ -199,7 +199,7 @@ public class Server {
public void stopServer() {
LOG.info("Server stopping...");
m_acceptor.close();
m_messaging.shutdown();
m_processorBootstrapper.shutdown();
m_initialized = false;
if (hazelcastInstance != null) {
try {
@@ -61,7 +61,7 @@ import org.slf4j.LoggerFactory;
* Class responsible to handle the logic of MQTT protocol it's the director of
* the protocol execution.
*
* Used by the front facing class SimpleMessaging.
* Used by the front facing class ProtocolProcessorBootstrapper.
*
* @author andrea
*/
@@ -38,16 +38,13 @@ import java.util.ArrayList;
import java.util.List;
/**
*
* Singleton class that orchestrate the execution of the protocol.
*
* It's main responsibility is instantiate the ProtocolProcessor.
* It's main responsibility is bootstrap the ProtocolProcessor.
*
* @author andrea
*/
public class SimpleMessaging {
public class ProtocolProcessorBootstrapper {
private static final Logger LOG = LoggerFactory.getLogger(SimpleMessaging.class);
private static final Logger LOG = LoggerFactory.getLogger(ProtocolProcessorBootstrapper.class);
private SubscriptionsStore subscriptions;
@@ -55,19 +52,9 @@ public class SimpleMessaging {
private BrokerInterceptor m_interceptor;
// private static SimpleMessaging INSTANCE;
private final ProtocolProcessor m_processor = new ProtocolProcessor();
private SimpleMessaging() {
}
public static SimpleMessaging getInstance() {
// if (INSTANCE == null) {
// INSTANCE = new SimpleMessaging();
// }
// return INSTANCE;
return new SimpleMessaging();
public ProtocolProcessorBootstrapper() {
}
/**
@@ -4,7 +4,7 @@ log4j.rootLogger=ERROR, stdout, file
log4j.logger.io.moquette=INFO
log4j.logger.io.moquette.spi.impl.ProtocolProcessor=INFO
log4j.logger.io.moquette.spi.impl.SimpleMessaging=WARN
log4j.logger.io.moquette.spi.impl.ProtocolProcessorBootstrapper=WARN
#Protocol parsing
log4j.logger.io.moquette.server.netty.NettyMQTTHandler=WARN