62,614
社区成员
发帖
与我相关
我的任务
分享
import java.util.concurrent.*;
import java.net.*;
class LoadBalancerListenerHandler
{}//空,用于通过编译
public class LoadBalancerListener {
public void run()
{
ThreadPoolExecutor threadpoolexecutor;
init();
threadpoolexecutor = getRunner();
lastIdleTime = System.currentTimeMillis();
while(true){
boolean flag;
flag = false;
if(udpSocket == null)
{
synchronized(this)
{
running = false;
break;
}
}
try
{
byte abyte0[] = new byte[maxPacketSize];
DatagramPacket datagrampacket = new DatagramPacket(abyte0, abyte0.length);
udpSocket.receive(datagrampacket);
long l1 = System.currentTimeMillis();
int i = datagrampacket.getLength();
if(i > 0)
{
lastIdleTime = l1;
// threadpoolexecutor.execute(new LoadBalancerListenerHandler(abyte0, 0, i));
}
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
}
catch(SocketTimeoutException sockettimeoutexception)
{
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
flag=true;
}
catch(Exception exception1)
{
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
}
if(flag)
{
long l = System.currentTimeMillis();
// if(l - lastIdleTime > (long)idleInterval)
// {
// lastIdleTime = l;
// threadpoolexecutor.execute(new LoadBalancerListenerIdler());
// }
}
}//while(true)
try
{
synchronized(this)
{
if(udpSocket != null)
{
udpSocket.close();
}
udpSocket = null;
}
}
catch(Exception exception) { }
killRunner();
shutdown();
return;
}
//以下是人为加上的内容,以便通过编译。
void init(){}
void killRunner(){}
void shutdown(){}
ThreadPoolExecutor getRunner(){return null;}
long lastIdleTime;
DatagramSocket udpSocket=null;
boolean running=false,quit;
int maxPacketSize=0;
}
public void run()
{
ThreadPoolExecutor threadpoolexecutor;
init();
threadpoolexecutor = getRunner();
lastIdleTime = System.currentTimeMillis();
while(true){
boolean flag;
flag = false;
if(udpSocket == null)
{
synchronized(this)
{
running = false;
break;
}
}
try
{
byte abyte0[] = new byte[maxPacketSize];
DatagramPacket datagrampacket = new DatagramPacket(abyte0, abyte0.length);
udpSocket.receive(datagrampacket);
long l1 = System.currentTimeMillis();
int i = datagrampacket.getLength();
if(i > 0)
{
lastIdleTime = l1;
threadpoolexecutor.execute(new LoadBalancerListenerHandler(abyte0, 0, i));
}
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
}
catch(SocketTimeoutException sockettimeoutexception)
{
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
flag=true;
}
catch(Exception exception1)
{
synchronized(this)
{
if(quit)
{
running = false;
break;
}
}
}
if(flag)
{
long l = System.currentTimeMillis();
if(l - lastIdleTime > (long)idleInterval)
{
lastIdleTime = l;
threadpoolexecutor.execute(new LoadBalancerListenerIdler());
}
}
}//while(true)
try
{
synchronized(this)
{
if(udpSocket != null)
{
udpSocket.close();
}
udpSocket = null;
}
}
catch(Exception exception) { }
killRunner();
shutdown();
return;
}
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: LoadBalancerListener.java
import java.net.*;
import java.util.concurrent.ThreadPoolExecutor;
public class LoadBalancerListener
{
public void run()
{
init();
ThreadPoolExecutor threadpoolexecutor = getRunner();
lastIdleTime = System.currentTimeMillis();
_L3:
boolean flag;
flag = false;
if(udpSocket == null)
{
synchronized(this)
{
running = false;
}
break; /* Loop/switch isn't completed */
}
try
{
label0:
{
byte abyte0[] = new byte[maxPacketSize];
DatagramPacket datagrampacket = new DatagramPacket(abyte0, abyte0.length);
udpSocket.receive(datagrampacket);
long l1 = System.currentTimeMillis();
int i = datagrampacket.getLength();
if(i > 0)
lastIdleTime = l1;
synchronized(this)
{
if(!quit)
break label0;
running = false;
}
break; /* Loop/switch isn't completed */
}
}
catch(SocketTimeoutException sockettimeoutexception)
{
label1:
{
synchronized(this)
{
if(!quit)
break label1;
running = false;
}
break; /* Loop/switch isn't completed */
}
}
catch(Exception exception1)
{
label2:
{
synchronized(this)
{
if(!quit)
break label2;
running = false;
}
break; /* Loop/switch isn't completed */
}
}
loadbalancerlistener4;
JVM INSTR monitorexit ;
break MISSING_BLOCK_LABEL_218;
exception3;
throw exception3;
loadbalancerlistener2;
JVM INSTR monitorexit ;
goto _L1
exception4;
throw exception4;
_L1:
flag = true;
break MISSING_BLOCK_LABEL_218;
loadbalancerlistener3;
JVM INSTR monitorexit ;
break MISSING_BLOCK_LABEL_218;
exception5;
throw exception5;
long l;
if(flag)
l = System.currentTimeMillis();
if(true) goto _L3; else goto _L2
_L2:
try
{
synchronized(this)
{
if(udpSocket != null)
udpSocket.close();
udpSocket = null;
}
}
catch(Exception exception) { }
killRunner();
shutdown();
return;
}
//以下是加被的空的方法与变量名,目的是:能够正确通过编译。
public LoadBalancerListener()
{
udpSocket = null;
running = false;
maxPacketSize = 0;
}
void init()
{
}
void killRunner()
{
}
void shutdown()
{
}
ThreadPoolExecutor getRunner()
{
return null;
}
long lastIdleTime;
DatagramSocket udpSocket;
boolean running;
boolean quit;
int maxPacketSize;
}