📄 serverinfo.java
字号:
import weblogic.common.*;
import javax.naming.*;
import java.util.Hashtable;
public class ServerInfo{
static T3ServicesDef t3s;
static Context ctx = null;
public static void main(String argv[]){
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
env.put(Context.SECURITY_PRINCIPAL, "zhanghz");
env.put(Context.SECURITY_CREDENTIALS, "zhanghz");
env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
try{
ctx = new InitialContext(env);
t3s = (T3ServicesDef)ctx.lookup("weblogic.common.T3Services");
ctx.close();
System.out.println(t3s.admin().version());
System.out.println("---------------------------");
System.out.println(t3s.admin().licenses());
}catch (Exception e){
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -