RetryLayer.smali
.class public Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;
.super Ljava/lang/Object;
# interfaces
.implements Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySendCallback;,
Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
}
.end annotation
# instance fields
.field private volatile mCreatingSocket:Z
.field private mGson:Lcom/google/gson/Gson;
.field private mHost:Ljava/lang/String;
.field private mRetryListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
.field private mRetrySocket:Landroid/util/SparseArray;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/util/SparseArray",
"<",
"Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySendCallback;",
">;"
}
.end annotation
.end field
.field private mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
# direct methods
.method public constructor <init>(Ljava/lang/String;)V
.registers 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Lcom/google/gson/Gson;
invoke-direct {v0}, Lcom/google/gson/Gson;-><init>()V
iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mGson:Lcom/google/gson/Gson;
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mCreatingSocket:Z
new-instance v0, Landroid/util/SparseArray;
invoke-direct {v0}, Landroid/util/SparseArray;-><init>()V
iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetrySocket:Landroid/util/SparseArray;
iput-object p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mHost:Ljava/lang/String;
new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/EncryptLayer;
invoke-direct {v0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/EncryptLayer;-><init>(Ljava/lang/String;)V
iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
return-void
.end method
.method static synthetic access$000(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;)Z
.registers 2
iget-boolean v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mCreatingSocket:Z
return v0
.end method
.method static synthetic access$002(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;Z)Z
.registers 2
iput-boolean p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mCreatingSocket:Z
return p1
.end method
.method static synthetic access$100(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;)Landroid/util/SparseArray;
.registers 2
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetrySocket:Landroid/util/SparseArray;
return-object v0
.end method
.method static synthetic access$400(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;)Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
.registers 2
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
return-object v0
.end method
.method static synthetic access$500(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;)Lcom/google/gson/Gson;
.registers 2
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mGson:Lcom/google/gson/Gson;
return-object v0
.end method
.method static synthetic access$600(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;)V
.registers 1
invoke-direct {p0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->restartSocket()V
return-void
.end method
.method private declared-synchronized restartSocket()V
.registers 4
monitor-enter p0
const/4 v0, 0x1
:try_start_2
iput-boolean v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mCreatingSocket:Z
:try_end_4
.catchall {:try_start_2 .. :try_end_4} :catchall_29
:try_start_4
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
invoke-interface {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->destroy()V
new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/EncryptLayer;
iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mHost:Ljava/lang/String;
invoke-direct {v0, v1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/EncryptLayer;-><init>(Ljava/lang/String;)V
iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetryListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
invoke-interface {v0, v1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->setSocketListener(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V
:try_end_19
.catch Ljava/lang/Throwable; {:try_start_4 .. :try_end_19} :catch_1b
.catchall {:try_start_4 .. :try_end_19} :catchall_29
:goto_19
monitor-exit p0
return-void
:catch_1b
move-exception v0
:try_start_1c
const-string/jumbo v1, "XPhoneSocket"
const-string/jumbo v2, "restartSocket error"
invoke-static {v1, v2, v0}, Lcom/cmcm/xiaobao/phone/commons/log/LogUtil;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mCreatingSocket:Z
:try_end_28
.catchall {:try_start_1c .. :try_end_28} :catchall_29
goto :goto_19
:catchall_29
move-exception v0
monitor-exit p0
throw v0
.end method
# virtual methods
.method public destroy()V
.registers 2
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
invoke-interface {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->destroy()V
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetrySocket:Landroid/util/SparseArray;
invoke-virtual {v0}, Landroid/util/SparseArray;->clear()V
return-void
.end method
.method public isSocketAvailable()Z
.registers 2
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
invoke-interface {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->isSocketAvailable()Z
move-result v0
return v0
.end method
.method public sendMessage(Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/OnSendCallBack;)V
.registers 5
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
new-instance v1, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySendCallback;
invoke-direct {v1, p0, p1, p2}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySendCallback;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/OnSendCallBack;)V
invoke-interface {v0, p1, v1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->sendMessage(Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/OnSendCallBack;)V
return-void
.end method
.method public setSocketListener(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V
.registers 4
new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
invoke-direct {v0, p0, p1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V
iput-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetryListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mSocket:Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;
iget-object v1, p0, Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer;->mRetryListener:Lcom/cmcm/xiaobao/phone/smarthome/socket/transmission/RetryLayer$OnRetrySocketListener;
invoke-interface {v0, v1}, Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket;->setSocketListener(Lcom/cmcm/xiaobao/phone/smarthome/socket/protocol/ISocket$OnSocketListener;)V
return-void
.end method