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