public class MonitorServlets {
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service;
// Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName(
"com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanser
vers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
}
}
/*
* Initialize connection to the Domain Runtime MBean Server
*/
public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
}
/*
* Get an array of ServerRuntimeMBeans
*/
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
}
/*
* Get an array of WebApplicationComponentRuntimeMBeans
*/
public void getServletData() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
ObjectName[] appRT =
(ObjectName[]) connection.getAttribute(serverRT[i],
"ApplicationRuntimes");
int appLength = (int) appRT.length;
for (int x = 0; x < appLength; x++) {
System.out.println("Application name: " +
(String)connection.getAttribute(appRT[x], "Name"));
ObjectName[] compRT =
(ObjectName[]) connection.getAttribute(appRT[x],
"ComponentRuntimes");
int compLength = (int) compRT.length;
for (int y = 0; y < compLength; y++) {
System.out.println(" Component name: " +
(String)connection.getAttribute(compRT[y], "Name"));
String componentType =
(String) connection.getAttribute(compRT[y], "Type");
System.out.println(componentType.toString());
if (componentType.toString().equals("WebAppComponentRuntime")){
ObjectName[] servletRTs = (ObjectName[])
connection.getAttribute(compRT[y], "Servlets");
int servletLength = (int) servletRTs.length;
for (int z = 0; z < servletLength; z++) {
System.out.println(" Servlet name: " +
(String)connection.getAttribute(servletRTs[z],
"Name"));
System.out.println(" Servlet context path: " +
(String)connection.getAttribute(servletRTs[z],
"ContextPath"));
System.out.println(" Invocation Total Count : " +
(Object)connection.getAttribute(servletRTs[z],
"InvocationTotalCount"));
}
}
}
}
}
}
Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...
Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...
The OFS product (OPC Factory Server) is a multi-controller data server which is able to communicate with PLCs of the M580, Unity Momentum, TSX/PCX Premium, Quantum, M340, TSX Compact, TSX Micro, TSX ...
WebAssembly: Accessing C and C++ in Web Applications English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 1h 45m | 213 MB Accelerate web applications with native code using WebAssembly. WebAssembly is a ...
Programming Windows, Sixth Edition focuses on creating Windows 8 apps accessing the Windows Runtime with XAML and C#. The book also provides C++ code samples. The Sixth Edition is organized in two ...
They provideaccess to Microsoft SQL Server and are an alternative to a standardway of accessing databases using Borland Database Engine (BDE).SDAC uses OLE DB directly through a set of ...
# Replace None with appropriate code # Import pandas using the standard alias None # Load 'WorldCupMatches.csv' as a DataFrame df = None 常用方法和属性 使用正确的方法显示数据集的前7行。 # Your code ...
Covering Visual Basic .NET 2005 programming in a Windows environment as well as accessing SQL Server Express 2005 and Web Services, this book allows intermediate-level programmers to get up to speed ...
Accessing the GPIO Pins on Raspberry Pi Zero Building and Controlling a Simple Wheeled Robot Building a Robot That Can Walk Adding Voice Recognition and Speech – A Voice Activated Robot Adding ...
相关推荐
Chapter 3 - Tools for Accessing SQL Server Chapter 4 - Introducing Transact-SQL Language Chapter 5 - Data Retrieval Chapter 6 - SQL Functions Chapter 7 - Aggregation and Grouping ...
WebLogic Dynamic Federation (WLDF) 是Oracle WebLogic Server提供的一种强大的监控和诊断工具,它允许管理员深入洞察应用程序的行为,以便优化性能、调试问题并确保系统的稳定运行。本文将详细探讨如何利用WLDF来...
Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...
Beginning Transact-SQL with SQL Server 2000 and 2005 byPaul TurleyandDan Wood Wrox Press 2006 (594 pages) ISBN:076457955X Prepare for the ever-increasing demands of programming. Beginning with an ...
The OFS product (OPC Factory Server) is a multi-controller data server which is able to communicate with PLCs of the M580, Unity Momentum, TSX/PCX Premium, Quantum, M340, TSX Compact, TSX Micro, TSX ...
Chapter 3 - Tools for Accessing SQL Server Chapter 4 - Introducing Transact-SQL Language Chapter 5 - Data Retrieval Chapter 6 - SQL Functions Chapter 7 - Aggregation and Grouping ...
Chapter 3 - Tools for Accessing SQL Server Chapter 4 - Introducing Transact-SQL Language Chapter 5 - Data Retrieval Chapter 6 - SQL Functions Chapter 7 - Aggregation and Grouping ...
MCTS Self-Paced Training Kit (Exam 70-516) Accessing Data with Microsoft .NET Framework 4 eBook.pdf.7z. 請用7zip解壓
MCTS 70-516 Accessing Data with Microsoft .NET Framework 4 练习1。注意,因为我只能上传小于15兆的文件,所以我把setup1.msi给那出去了。安装时需要把setup1.exe放进Practice Tests文件夹。
3. LINQ to SQL:这是一种早期的ORM技术,它使开发人员能够使用C#或VB.NET的查询语法(LINQ)直接对SQL Server进行操作。虽然在.NET 4中仍然可用,但Microsoft更倾向于推广Entity Framework,因此LINQ to SQL并未...
WebAssembly: Accessing C and C++ in Web Applications English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 1h 45m | 213 MB Accelerate web applications with native code using WebAssembly. WebAssembly is a ...
### 使用 JDBC 访问数据库 在现代软件开发中,与数据库进行交互是不可或缺的一部分。Java Database Connectivity (JDBC) 是 Java 平台上的一个标准库,用于与关系型数据库进行通信。通过使用 JDBC API,开发者可以...
Programming Windows, Sixth Edition focuses on creating Windows 8 apps accessing the Windows Runtime with XAML and C#. The book also provides C++ code samples. The Sixth Edition is organized in two ...
They provideaccess to Microsoft SQL Server and are an alternative to a standardway of accessing databases using Borland Database Engine (BDE).SDAC uses OLE DB directly through a set of ...
这是教材自带的练习。资源分成了练习1 和 练习2。练习2就是那个setup.msi文件。通过做题,更好的了解了POCO等知识点。
三、路由协议 学习者需要理解静态路由与动态路由的区别。静态路由由管理员手动配置,适合简单网络环境;动态路由如RIP(Routing Information Protocol)、OSPF(Open Shortest Path First)等,能自动发现网络变化,...
# Replace None with appropriate code # Import pandas using the standard alias None # Load 'WorldCupMatches.csv' as a DataFrame df = None 常用方法和属性 使用正确的方法显示数据集的前7行。 # Your code ...
Covering Visual Basic .NET 2005 programming in a Windows environment as well as accessing SQL Server Express 2005 and Web Services, this book allows intermediate-level programmers to get up to speed ...
Accessing the GPIO Pins on Raspberry Pi Zero Building and Controlling a Simple Wheeled Robot Building a Robot That Can Walk Adding Voice Recognition and Speech – A Voice Activated Robot Adding ...
访问属性 访问属性 (Accessing Properties)(Accessing Properties) (Accessing Properties) (Accessing Properties) (Accessing Properties)(Accessing Properties) (Accessing Properties)(Accessing Properties)...