/*
* 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);
remo
使用Eclipse + MyEclipse开发Web Service的示例
4星 · 超过85%的资源 需积分: 10 190 浏览量
2008-09-22
01:04:05
上传
评论 1
收藏 4.17MB RAR 举报
sky111080
- 粉丝: 0
- 资源: 6
最新资源
- Sora AI Video Preview Case Sora AI 视频模版项目,React全栈快速部署.zip
- Foobar2000 中文完全版
- 基于JAVA web 的酒店管理系统的设计与实现,MySQL、MVC
- cdf6be7eb5ee2c1204e6de3b08a441d2.jpg
- 基于web的停车场管理系统的设计与实现、MVC、前台jQuery、后台JDBC,JSP技术,Tomcat、JavaBean
- 基于STM32和QT平台的农业大棚远程监控系统设计.pdf
- 毕业设计-基于SpringBoot、JPA、Thmleaf实现的旅游网站管理系统
- index.wxml
- 基于Git的软件项目管理配置方法及应用实践.pdf
- 基于R语言的公立医院学科绩效评估数据可视化研究.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈