public class org.apache.dubbo.remoting.transport.netty.NettyClient extends org.apache.dubbo.remoting.transport.AbstractClient
{
private static final org.apache.dubbo.common.logger.Logger logger;
private static final org.jboss.netty.channel.ChannelFactory CHANNEL_FACTORY;
private org.jboss.netty.bootstrap.ClientBootstrap bootstrap;
private volatile org.jboss.netty.channel.Channel channel;
public void <init>(org.apache.dubbo.common.URL, org.apache.dubbo.remoting.ChannelHandler) throws org.apache.dubbo.remoting.RemotingException
{
org.apache.dubbo.remoting.ChannelHandler v, v;
org.apache.dubbo.common.URL v;
org.apache.dubbo.remoting.transport.netty.NettyClient v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
v := @parameter: org.apache.dubbo.common.URL;
v := @parameter: org.apache.dubbo.remoting.ChannelHandler;
v = staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.remoting.ChannelHandler wrapChannelHandler(org.apache.dubbo.common.URL,org.apache.dubbo.remoting.ChannelHandler)>(v, v);
specialinvoke v.<org.apache.dubbo.remoting.transport.AbstractClient: void <init>(org.apache.dubbo.common.URL,org.apache.dubbo.remoting.ChannelHandler)>(v, v);
return;
}
protected void doOpen() throws java.lang.Throwable
{
org.apache.dubbo.remoting.transport.netty.NettyHandler v;
java.lang.Integer v;
org.apache.dubbo.common.URL v;
org.apache.dubbo.remoting.transport.netty.NettyClient v;
int v;
java.lang.Boolean v, v;
org.jboss.netty.bootstrap.ClientBootstrap v, v, v, v, v;
org.apache.dubbo.remoting.transport.netty.NettyClient$1 v;
org.jboss.netty.channel.ChannelFactory v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyHelper: void setNettyLoggerFactory()>();
v = new org.jboss.netty.bootstrap.ClientBootstrap;
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.ChannelFactory CHANNEL_FACTORY>;
specialinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: void <init>(org.jboss.netty.channel.ChannelFactory)>(v);
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap> = v;
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap>;
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
virtualinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: void setOption(java.lang.String,java.lang.Object)>("keepAlive", v);
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap>;
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
virtualinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: void setOption(java.lang.String,java.lang.Object)>("tcpNoDelay", v);
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap>;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: int getConnectTimeout()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
virtualinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: void setOption(java.lang.String,java.lang.Object)>("connectTimeoutMillis", v);
v = new org.apache.dubbo.remoting.transport.netty.NettyHandler;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.URL getUrl()>();
specialinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyHandler: void <init>(org.apache.dubbo.common.URL,org.apache.dubbo.remoting.ChannelHandler)>(v, v);
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap>;
v = new org.apache.dubbo.remoting.transport.netty.NettyClient$1;
specialinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient$1: void <init>(org.apache.dubbo.remoting.transport.netty.NettyClient,org.apache.dubbo.remoting.transport.netty.NettyHandler)>(v, v);
virtualinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: void setPipelineFactory(org.jboss.netty.channel.ChannelPipelineFactory)>(v);
return;
}
protected void doConnect() throws java.lang.Throwable
{
org.apache.dubbo.remoting.RemotingException v, v;
org.apache.dubbo.common.URL v, v;
boolean v, v, v, v, v, v, v, v, v;
java.net.InetSocketAddress v, v, v;
java.lang.Throwable v, v, v, v, v, v, v, v;
long v, v, v;
org.apache.dubbo.remoting.transport.netty.NettyClient v;
org.jboss.netty.channel.ChannelFuture v;
int v, v;
java.lang.String v, v, v, v, v, v, v, v;
org.apache.dubbo.common.logger.Logger v, v, v, v, v, v;
org.jboss.netty.channel.Channel v, v;
java.util.concurrent.TimeUnit v;
org.jboss.netty.bootstrap.ClientBootstrap v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.bootstrap.ClientBootstrap bootstrap>;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: java.net.InetSocketAddress getConnectAddress()>();
v = virtualinvoke v.<org.jboss.netty.bootstrap.ClientBootstrap: org.jboss.netty.channel.ChannelFuture connect(java.net.SocketAddress)>(v);
label:
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: int getConnectTimeout()>();
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit MILLISECONDS>;
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: boolean awaitUninterruptibly(long,java.util.concurrent.TimeUnit)>(v, v);
if v == 0 goto label;
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: boolean isSuccess()>();
if v == 0 goto label;
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: org.jboss.netty.channel.Channel getChannel()>();
interfaceinvoke v.<org.jboss.netty.channel.Channel: org.jboss.netty.channel.ChannelFuture setInterestOps(int)>(5);
label:
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel>;
if v == null goto label;
label:
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: boolean isInfoEnabled()>();
if v == 0 goto label;
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.jboss.netty.channel.Channel,org.jboss.netty.channel.Channel)>(v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Close old netty channel \u on create new netty channel \u0001");
interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: void info(java.lang.String)>(v);
label:
interfaceinvoke v.<org.jboss.netty.channel.Channel: org.jboss.netty.channel.ChannelFuture close()>();
label:
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
goto label;
label:
v := @caughtexception;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
throw v;
label:
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: boolean isClosed()>();
if v == 0 goto label;
label:
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: boolean isInfoEnabled()>();
if v == 0 goto label;
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.jboss.netty.channel.Channel)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Close new netty channel \u, because the client closed.");
interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: void info(java.lang.String)>(v);
label:
interfaceinvoke v.<org.jboss.netty.channel.Channel: org.jboss.netty.channel.ChannelFuture close()>();
label:
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = null;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
goto label;
label:
v := @caughtexception;
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = null;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
throw v;
label:
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = v;
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: boolean isClosed()>();
if v == 0 goto label;
label:
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: boolean isInfoEnabled()>();
if v == 0 goto label;
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.jboss.netty.channel.Channel)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("Close new netty channel \u, because the client closed.");
interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: void info(java.lang.String)>(v);
label:
interfaceinvoke v.<org.jboss.netty.channel.Channel: org.jboss.netty.channel.ChannelFuture close()>();
label:
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = null;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
goto label;
label:
v := @caughtexception;
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = null;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
throw v;
label:
v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel> = v;
label:
throw v;
label:
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: java.lang.Throwable getCause()>();
if v == null goto label;
v = new org.apache.dubbo.remoting.RemotingException;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.URL getUrl()>();
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: java.net.InetSocketAddress getRemoteAddress()>();
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: java.lang.Throwable getCause()>();
v = virtualinvoke v.<java.lang.Throwable: java.lang.String getMessage()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.apache.dubbo.common.URL,java.net.InetSocketAddress,java.lang.String)>(v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("client(url: \u) failed to connect to server \u, error message is:\u0001");
v = interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: java.lang.Throwable getCause()>();
specialinvoke v.<org.apache.dubbo.remoting.RemotingException: void <init>(org.apache.dubbo.remoting.Channel,java.lang.String,java.lang.Throwable)>(v, v, v);
throw v;
label:
v = new org.apache.dubbo.remoting.RemotingException;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.URL getUrl()>();
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: java.net.InetSocketAddress getRemoteAddress()>();
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: int getConnectTimeout()>();
v = staticinvoke <java.lang.System: long currentTimeMillis()>();
v = v - v;
v = staticinvoke <org.apache.dubbo.common.utils.NetUtils: java.lang.String getLocalHost()>();
v = staticinvoke <org.apache.dubbo.common.Version: java.lang.String getVersion()>();
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (org.apache.dubbo.common.URL,java.net.InetSocketAddress,int,long,java.lang.String,java.lang.String)>(v, v, v, v, v, v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("client(url: \u) failed to connect to server \u client-side timeout \u0001ms (elapsed: \u0001ms) from netty client \u using dubbo version \u0001");
specialinvoke v.<org.apache.dubbo.remoting.RemotingException: void <init>(org.apache.dubbo.remoting.Channel,java.lang.String)>(v, v);
throw v;
label:
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: boolean isConnected()>();
if v != 0 goto label;
interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: boolean cancel()>();
goto label;
label:
v := @caughtexception;
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: boolean isConnected()>();
if v != 0 goto label;
interfaceinvoke v.<org.jboss.netty.channel.ChannelFuture: boolean cancel()>();
label:
throw v;
label:
return;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
catch java.lang.Throwable from label to label with label;
}
protected void doDisConnect() throws java.lang.Throwable
{
java.lang.Throwable v;
org.apache.dubbo.remoting.transport.netty.NettyClient v;
org.apache.dubbo.common.logger.Logger v;
java.lang.String v;
org.jboss.netty.channel.Channel v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
label:
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel>;
staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: void removeChannelIfDisconnected(org.jboss.netty.channel.Channel)>(v);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger>;
v = virtualinvoke v.<java.lang.Throwable: java.lang.String getMessage()>();
interfaceinvoke v.<org.apache.dubbo.common.logger.Logger: void warn(java.lang.String)>(v);
label:
return;
catch java.lang.Throwable from label to label with label;
}
protected void doClose() throws java.lang.Throwable
{
org.apache.dubbo.remoting.transport.netty.NettyClient v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
return;
}
protected org.apache.dubbo.remoting.Channel getChannel()
{
org.apache.dubbo.common.URL v;
org.apache.dubbo.remoting.transport.netty.NettyChannel v;
org.apache.dubbo.remoting.transport.netty.NettyClient v;
org.jboss.netty.channel.Channel v;
boolean v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel>;
if v == null goto label;
v = interfaceinvoke v.<org.jboss.netty.channel.Channel: boolean isConnected()>();
if v != 0 goto label;
label:
return null;
label:
v = virtualinvoke v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.URL getUrl()>();
v = staticinvoke <org.apache.dubbo.remoting.transport.netty.NettyChannel: org.apache.dubbo.remoting.transport.netty.NettyChannel getOrAddChannel(org.jboss.netty.channel.Channel,org.apache.dubbo.common.URL,org.apache.dubbo.remoting.ChannelHandler)>(v, v, v);
return v;
}
org.jboss.netty.channel.Channel getNettyChannel()
{
org.apache.dubbo.remoting.transport.netty.NettyClient v;
org.jboss.netty.channel.Channel v;
v := @this: org.apache.dubbo.remoting.transport.netty.NettyClient;
v = v.<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.Channel channel>;
return v;
}
static void <clinit>()
{
org.apache.dubbo.common.logger.Logger v;
int v;
org.apache.dubbo.common.utils.NamedThreadFactory v, v;
java.util.concurrent.ExecutorService v, v;
org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory v;
v = staticinvoke <org.apache.dubbo.common.logger.LoggerFactory: org.apache.dubbo.common.logger.Logger getLogger(java.lang.Class)>(class "Lorg/apache/dubbo/remoting/transport/netty/NettyClient;");
<org.apache.dubbo.remoting.transport.netty.NettyClient: org.apache.dubbo.common.logger.Logger logger> = v;
v = new org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
v = new org.apache.dubbo.common.utils.NamedThreadFactory;
specialinvoke v.<org.apache.dubbo.common.utils.NamedThreadFactory: void <init>(java.lang.String,boolean)>("NettyClientBoss", 1);
v = staticinvoke <java.util.concurrent.Executors: java.util.concurrent.ExecutorService newCachedThreadPool(java.util.concurrent.ThreadFactory)>(v);
v = new org.apache.dubbo.common.utils.NamedThreadFactory;
specialinvoke v.<org.apache.dubbo.common.utils.NamedThreadFactory: void <init>(java.lang.String,boolean)>("NettyClientWorker", 1);
v = staticinvoke <java.util.concurrent.Executors: java.util.concurrent.ExecutorService newCachedThreadPool(java.util.concurrent.ThreadFactory)>(v);
v = <org.apache.dubbo.remoting.Constants: int DEFAULT_IO_THREADS>;
specialinvoke v.<org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory: void <init>(java.util.concurrent.Executor,java.util.concurrent.Executor,int)>(v, v, v);
<org.apache.dubbo.remoting.transport.netty.NettyClient: org.jboss.netty.channel.ChannelFactory CHANNEL_FACTORY> = v;
return;
}
}