📄 hrserverapp.java
字号:
/**
* Copyright (c) 2001
* Template File
* ServerApp.java.template
* IDL Object
* humanresource.HR
* Generation Date
* 2001年12月13日 下午09时21分42秒
* IDL Source File
* E:/HumanResource/src/humanresource/HR.idl
* Abstract
* CORBA server application.
* @version 1.0
*/
package humanresource;
import humanresource.HR.server.*;
import javax.swing.UIManager;
import java.awt.*;
import org.omg.PortableServer.*;
public class HRServerApp {
boolean packFrame = false;
public HRServerApp() {
ServerFrame frame = new ServerFrame();
if (packFrame)
frame.pack();
else
frame.validate();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Dimension frameSize = frame.getSize();
if (frameSize.height > screenSize.height)
frameSize.height = screenSize.height;
if (frameSize.width > screenSize.width)
frameSize.width = screenSize.width;
frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
frame.setVisible(true);
}
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
}
catch (Exception ex) {
}
new HRServerApp();
try {
java.util.ResourceBundle res = java.util.ResourceBundle.getBundle("humanresource.HR.server.ServerResources");
String name;
//(debug support)System.getProperties().put("vbroker.agent.debug", "true");
//(debug support)System.getProperties().put("vbroker.orb.warn", "2");
if (System.getProperties().get("vbroker.agent.port") == null) {
System.getProperties().put("vbroker.agent.port", "14000");
}
if (System.getProperties().get("org.omg.CORBA.ORBClass") == null) {
System.getProperties().put("org.omg.CORBA.ORBClass", "com.inprise.vbroker.orb.ORB");
}
if (System.getProperties().get("org.omg.CORBA.ORBSingletonClass") == null) {
System.getProperties().put("org.omg.CORBA.ORBSingletonClass", "com.inprise.vbroker.orb.ORB");
}
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args, System.getProperties());
POA poaRoot = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
name = "PersonalInfo";
org.omg.CORBA.Policy[] PersonalInfoPolicies = {
poaRoot.create_lifespan_policy(LifespanPolicyValue.PERSISTENT)
};
POA poaPersonalInfo = poaRoot.create_POA(name + "_poa",
poaRoot.the_POAManager(),
PersonalInfoPolicies);
poaPersonalInfo.activate_object_with_id(name.getBytes(), new PersonalInfoImpl());
ServerMonitor.log(ServerResources.format(res.getString("created"), "HRServerApp.java PersonalInfo"));
name = "HRManager";
org.omg.CORBA.Policy[] HRManagerPolicies = {
poaRoot.create_lifespan_policy(LifespanPolicyValue.PERSISTENT)
};
POA poaHRManager = poaRoot.create_POA(name + "_poa",
poaRoot.the_POAManager(),
HRManagerPolicies);
poaHRManager.activate_object_with_id(name.getBytes(), new HRManagerImpl());
ServerMonitor.log(ServerResources.format(res.getString("created"), "HRServerApp.java HRManager"));
poaRoot.the_POAManager().activate();
ServerMonitor.log(ServerResources.format(res.getString("isReady"), "HRServerApp.java HR"));
orb.run();
}
catch(Exception ex) {
System.err.println(ex);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -