Skip to content

Commit

Permalink
Remove singleton for ShardingSphereProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Sep 7, 2020
1 parent 684b5d5 commit 83437cb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final void init(final YamlProxyConfiguration yamlConfig, final int port)
ProxySchemaContexts.getInstance().init(schemaContexts, transactionContexts);
initOpenTracing();
setDatabaseServerInfo();
ShardingSphereProxy.getInstance().start(port);
new ShardingSphereProxy().start(port);
}

private SchemaContexts createSchemaContexts(final ProxyConfiguration proxyConfig) throws SQLException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,19 @@
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import lombok.SneakyThrows;
import org.apache.shardingsphere.proxy.backend.executor.BackendExecutorContext;
import org.apache.shardingsphere.proxy.frontend.netty.ServerHandlerInitializer;

/**
* ShardingSphere-Proxy.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class ShardingSphereProxy {

private static final ShardingSphereProxy INSTANCE = new ShardingSphereProxy();

private EventLoopGroup bossGroup;

private EventLoopGroup workerGroup;

/**
* Get instance of proxy context.
*
* @return instance of proxy context.
*/
public static ShardingSphereProxy getInstance() {
return INSTANCE;
}

/**
* Start ShardingSphere-Proxy.
*
Expand Down

0 comments on commit 83437cb

Please sign in to comment.