WEB开发网
开发学院软件开发Java 故障诊断学习工具:在实践中学习 WebSphere 应用服... 阅读

故障诊断学习工具:在实践中学习 WebSphere 应用服务器故障诊断

 2010-07-19 00:00:00 来源:WEB开发网   
核心提示: 查看原图(大图)图 4. 动作面板查看代码"Dead Lock" 的动作面板中有两个动作按钮,"DeadLock Jsp" 按钮和 "Correct Jsp",故障诊断学习工具:在实践中学习 WebSphere 应用服务器故障诊断(4)

查看原图(大图)

图 4. 动作面板
故障诊断学习工具:在实践中学习 WebSphere 应用服务器故障诊断

查看代码

"Dead Lock" 的动作面板中有两个动作按钮,"DeadLock Jsp" 按钮和 "Correct Jsp"。

用鼠标右键单击 "DeadLock Jsp" 按钮,在快捷菜单中选择 "Edit Action Button" ,在弹出的 Java 编辑器中我们可以查看或者编辑这个按钮所执行的 Java 代码,其代码如下:

清单 1.“DeadLock Jsp” 按钮执行的 Java 代码

 
 synchronized (lock1) { // lock1 is defined in the "Methods and Static Variables" tab 
   Thread.sleep(5000); 
   ThreadMonitor.registerThreadStatus("blocked"); 
   //It will be blocked here if the thread can not get the lock2 
   synchronized (lock2) { 
 ThreadMonitor.registerThreadStatus("running"); 
 //It will continue to run if the thread can get the lock2 
 } 
 } 
  synchronized (lock2) { // lock2 is defined in the "Methods and Static Variables" tab 
   Thread.sleep(5000); 
   ThreadMonitor.registerThreadStatus("blocked"); 
    //It will be blocked here if the thread can not get the lock1 
   synchronized (lock1) { 
  ThreadMonitor.registerThreadStatus("running"); 
  //It will continue to run if the thread can get the lock1 
 } 
 } 

上一页  1 2 3 4 5 6  下一页

Tags:故障 诊断 学习

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接