Make Local Connections
to the Runtime MBean Server
....
private String getDomainName() {
InitialContext ctx = null;
String domainName = "DomainName";
try {
ObjectName service = new ObjectName(
"com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName drt = (ObjectName) server.getAttribute(service, "DomainConfiguration");
domainName = (String) server.getAttribute(drt, "Name");
log.info("PfConfiguration Override Domain Name: " + domainName);
} catch (Exception e) {
log.error("Error fetching Weblogic Server Info", e);
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (NamingException e) {
log.error("Error closing InitialContext :"+e.toString(), e);
}
}
}
return System.getProperty("pfPortalEnv")+"."+domainName;
}
private String getDomainNodeName() {
InitialContext ctx = null;
String domainName = "DomainName";
String nodeName = "DomainNode";
try {
ObjectName service = new ObjectName(
"com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName rt = (ObjectName) server.getAttribute(service, "ServerRuntime");
nodeName = (String) server.getAttribute(rt, "Name");
ObjectName drt = (ObjectName) server.getAttribute(service, "DomainConfiguration");
domainName = (String) server.getAttribute(drt, "Name");
log.info("PfConfiguration Override Domain Node Name: " + domainName + "." + nodeName);
} catch (Exception e) {
log.error("Error fetching Weblogic Server Info", e);
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (NamingException e) {
log.error("Error closing InitialContext :"+e.toString(), e);
}
}
}
return System.getProperty("pfPortalEnv")+"."+domainName+"."+nodeName;
}
public String getNodeName() {
InitialContext ctx = null;
String nodeName = "DomainNode";
try {
ObjectName service = new ObjectName(
"com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
ctx = new InitialContext();
MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
ObjectName rt = (ObjectName) server.getAttribute(service, "ServerRuntime");
nodeName = (String) server.getAttribute(rt, "Name");
} catch (Exception e) {
log.error("Error fetching Weblogic Server Info", e);
} finally {
if (ctx != null) {
try {
ctx.close();
} catch (NamingException e) {
log.error("Error closing InitialContext :"+e.toString(), e);
}
}
}
return nodeName;
}
...........
..........
分享到:
相关推荐
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等知识点。
本系列练习题围绕“Accessing the WAN”(访问广域网)这一主题展开,涵盖了一系列关于网络连接、路由协议、广域网技术等内容,是CCNA4第四学期的重要学习材料。 一、WAN基础知识 WAN(Wide Area Network)广域网是...
# 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)...