/*
* Copyright 2001,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import javax.swing.table.*;
import org.apache.axis.monitor.SOAPMonitorConstants;
/**
* This is a SOAP Mointor Applet class. This class provides
* the user interface for displaying data from the SOAP
* monitor service.
*
* @author Brian Price (pricebe@us.ibm.com)
*
*/
public class SOAPMonitorApplet extends JApplet {
/**
* Private data
*/
private JPanel main_panel = null;
private JTabbedPane tabbed_pane = null;
private int port = 0;
private Vector pages = null;
/**
* Constructor
*/
public SOAPMonitorApplet() {
}
/**
* Applet initialization
*/
public void init() {
// Get the port to be used
String port_str = getParameter("port");
if (port_str != null) {
port = Integer.parseInt(port_str);
}
// Try to use the system look and feel
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e){
}
// Create main panel to hold notebook
main_panel = new JPanel();
main_panel.setBackground(Color.white);
main_panel.setLayout(new BorderLayout());
setContentPane(main_panel);
// Create the notebook
tabbed_pane = new JTabbedPane(JTabbedPane.TOP);
main_panel.add(tabbed_pane,BorderLayout.CENTER);
// Add notebook page for default host connection
pages = new Vector();
addPage(new SOAPMonitorPage(getCodeBase().getHost()));
}
/**
* Add a page to the notebook
*/
private void addPage(SOAPMonitorPage pg) {
tabbed_pane.addTab(" "+pg.getHost()+" ", pg);
pages.addElement(pg);
}
/**
* Applet is being displayed
*/
public void start() {
// Tell all pages to start talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.start();
}
}
}
/*
* Applet is no longer displayed
*/
public void stop() {
// Tell all pages to stop talking to the server
Enumeration e = pages.elements();
while (e.hasMoreElements()) {
SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
if (pg != null) {
pg.stop();
}
}
}
/**
* Applet cleanup
*/
public void destroy() {
tabbed_pane = null;
main_panel = null;
}
/**
* This class provides the contents of a notebook page
* representing a server connection.
*/
class SOAPMonitorPage extends JPanel
implements Runnable,
ListSelectionListener,
ActionListener {
/**
* Status Strings
*/
private final String STATUS_ACTIVE = "The SOAP Monitor is started.";
private final String STATUS_STOPPED = "The SOAP Monitor is stopped.";
private final String STATUS_CLOSED = "The server communication has been terminated.";
private final String STATUS_NOCONNECT = "The SOAP Monitor is unable to communcate with the server.";
/**
* Private data
*/
private String host = null;
private Socket socket = null;
private ObjectInputStream in = null;
private ObjectOutputStream out = null;
private SOAPMonitorTableModel model = null;
private JTable table = null;
private JScrollPane scroll = null;
private JPanel list_panel = null;
private JPanel list_buttons = null;
private JButton remove_button = null;
private JButton remove_all_button = null;
private JButton filter_button = null;
private JPanel details_panel = null;
private JPanel details_header = null;
private JSplitPane details_soap = null;
private JPanel details_buttons = null;
private JLabel details_time = null;
private JLabel details_target = null;
private JLabel details_status = null;
private JLabel details_time_value = null;
private JLabel details_target_value = null;
private JLabel details_status_value = null;
private EmptyBorder empty_border = null;
private EtchedBorder etched_border = null;
private JPanel request_panel = null;
private JPanel response_panel = null;
private JLabel request_label = null;
private JLabel response_label = null;
private SOAPMonitorTextArea request_text = null;
private SOAPMonitorTextArea response_text = null;
private JScrollPane request_scroll = null;
private JScrollPane response_scroll = null;
private JButton layout_button = null;
private JSplitPane split = null;
private JPanel status_area = null;
private JPanel status_buttons = null;
private JButton start_button = null;
private JButton stop_button = null;
private JLabel status_text = null;
private JPanel status_text_panel = null;
private SOAPMonitorFilter filter = null;
private GridBagLayout details_header_layout = null;
private GridBagConstraints details_header_constraints = null;
private JCheckBox reflow_xml = null;
/**
* Constructor (create and layout page)
*/
public SOAPMonitorPage(String host_name) {
host = host_name;
// Set up default filter (show all messages)
filter = new SOAPMonitorFilter();
// Use borders to help improve appearance
etched_border = new EtchedBorder();
// Build top portion of split (list panel)
model = new SOAPMonitorTableModel();
table = new JTable(model);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setRowSelectionInterval(0,0);
table.setPreferredScrollableViewportSize(new Dimension(600, 96));
table.getSelectionModel().addListSelectionListener(this);
scroll = new JScrollPane(table);
remove_button = new JButton("Remove");
remove_button.addActionListener(this);
remove_button.setEnabled(false);
remove_all_button = new JButton("Remove All");
remove_all_button.addActionListener(this);
filter_button = new JButton("Filter ...");
filter_button.addActionListener(this);
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
《Tomcat与Java Web开发技术详解》语言深入浅出、通俗易懂,无论对于Java Web开发的新手还是行家来说,《Tomcat与Java Web开发技术详解》都是精通Tomcat和开发Java Web应用的必备的实用手册。《Tomcat与Java Web开发技术详解》还可作为高校相关专业学生学习Java Web开发的参考书,以及企业Java Web培训教材,也可作为SUN公司的SCWCD(SUN Certified Web Component Developer)认证的辅导教材。
资源推荐
资源详情
资源评论
收起资源包目录
Tomcat与Java Web开发技术详解(第2版)及其源码 (912个子文件)
build.bat 1KB
undeploy.bat 478B
compile.bat 459B
deploy.bat 456B
compile.bat 430B
encode.bat 87B
logo.bmp 29KB
logo.bmp 29KB
logo.bmp 29KB
logo.bmp 29KB
logo.bmp 29KB
InteropTestSoapBindingStub.class 34KB
InteropTestSoapBindingStub.class 34KB
rfq.class 18KB
rfq.class 18KB
TestClient.class 15KB
TestClient.class 15KB
EchoAttachment.class 13KB
EchoAttachment.class 13KB
SOAPMonitorApplet$SOAPMonitorPage.class 12KB
SOAPMonitorApplet$SOAPMonitorPage.class 12KB
AddressBookSOAPBindingStub.class 10KB
AddressBookSOAPBindingStub.class 10KB
TestRef.class 10KB
TestRef.class 10KB
SwaBindingStub.class 9KB
SwaBindingStub.class 9KB
PerfPortSoapBindingStub.class 9KB
PerfPortSoapBindingStub.class 9KB
AddressSoapBindingStub.class 9KB
AddressSoapBindingStub.class 9KB
v3.class 8KB
v3.class 8KB
EchoAttachmentsService.class 7KB
EchoAttachmentsService.class 7KB
InteropTestSoapBindingImpl.class 7KB
InteropTestSoapBindingImpl.class 7KB
WidgetPriceSoapBindingStub.class 6KB
WidgetPriceSoapBindingStub.class 6KB
HelloBindingStub.class 6KB
HelloBindingStub.class 6KB
SOAPMonitorApplet$SOAPMonitorTableModel.class 5KB
SOAPMonitorApplet$SOAPMonitorTableModel.class 5KB
Address.class 5KB
Address.class 5KB
SOAPMonitorApplet$SOAPMonitorFilter.class 5KB
SOAPMonitorApplet$SOAPMonitorFilter.class 5KB
SOAPMonitorApplet$ServiceFilterPanel.class 5KB
SOAPMonitorApplet$ServiceFilterPanel.class 5KB
TestMsg.class 5KB
TestMsg.class 5KB
BookDB.class 5KB
BookDB.class 5KB
BookDB.class 5KB
BookDB.class 5KB
BookDB.class 5KB
TestSer.class 5KB
TestSer.class 5KB
GetQuote.class 5KB
GetQuote.class 5KB
SOAPArrayStruct.class 5KB
SOAPArrayStruct.class 5KB
TCPListener$SocketHandler.class 5KB
TCPListener$SocketHandler.class 5KB
WidgetPriceServiceLocator.class 5KB
WidgetPriceServiceLocator.class 5KB
AddressServiceServiceLocator.class 5KB
AddressServiceServiceLocator.class 5KB
AddressBookServiceLocator.class 5KB
PerfService_ServiceLocator.class 5KB
AddressBookServiceLocator.class 5KB
PerfService_ServiceLocator.class 5KB
InteropTestServiceLocator.class 5KB
InteropTestServiceLocator.class 5KB
HelloWorldLocator.class 5KB
HelloWorldLocator.class 5KB
SOAPStructStruct.class 5KB
SOAPStructStruct.class 5KB
SwaServiceLocator.class 5KB
SwaServiceLocator.class 5KB
MailClient.class 5KB
TestClient.class 5KB
TestClient.class 5KB
GetQuote1.class 4KB
GetQuote1.class 4KB
TCPListener.class 4KB
TCPListener.class 4KB
HTTPServer1.class 4KB
SOAPStruct.class 4KB
SOAPStruct.class 4KB
BookDBDelegate.class 4KB
BookDBDelegate.class 4KB
Main.class 4KB
Main.class 4KB
Phone.class 4KB
Phone.class 4KB
BookDBEJBImpl.class 4KB
BookDBEJBImpl.class 4KB
EmployeeClient.class 4KB
EmployeeClient.class 4KB
共 912 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
逝不等琴生
- 粉丝: 2w+
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功