keyclient.java

来自「corba是一款商用内存检测工具」· Java 代码 · 共 53 行

JAVA
53
字号
/*
 * KeyClient.java
 *
 * Created on 2008年5月4日, 下午9:34
 *
 */

/**
 *
 * @author xzh
 */
import org.omg.PortableServer.*;
public class KeyClient {
/** Creates a new instance of KeyClient */
    public KeyClient() {
    }
    public static void main(String[] args) {
        org.omg.CORBA.ORB _orb;
        ManageKey localManageKey;
        String name = "ManageKey";
        try
        {
            if (System.getProperties().get("ORBagentPort") == null) {
                System.getProperties().put("vbroker.agent.port", "14000");
            }
            if (System.getProperties().get("ORBagentAddr") == null) {
                System.getProperties().put("vbroker.agent.addr", "localhost");
            }
            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");
            }
            _orb = org.omg.CORBA.ORB.init(args, System.getProperties());
            localManageKey = ManageKeyHelper.bind(_orb,
            "/manage_key_poa", name.getBytes());
            System.out.println(localManageKey.GetKey());
            localManageKey.SetKey("RealKey");
        }
        catch (org.omg.CORBA.OBJECT_NOT_EXIST cone) {
            System.out.println(cone.getMessage());
        }
        catch (Exception e) {
            e.printStackTrace();
        }        
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?