コード例 #1
0
  private void initSFSB(String[] args) {

    System.out.println("[apiClient] Inside init....");
    try {
      Context ic = null;
      Object objref = null;
      if ((args[0] == null) || (args[1] == null)) {
        ic = new InitialContext();
        System.out.println("[apiClient] Lookingup Bean apiClient ");
        objref = ic.lookup("java:comp/env/ejb/apiSecurity");
      } else {
        Properties env = new Properties();
        env.put("java.naming.provider.url", args[0]);
        env.put("java.naming.factory.initial", args[1]);
        ic = new InitialContext(env);
        objref = ic.lookup(args[2]);
      }

      RpaHome home = (RpaHome) PortableRemoteObject.narrow(objref, RpaHome.class);

      hr = home.create("LizHurley");

      System.out.println("[passivateactivate] Initalization done");
      // stat.addStatus("init apiClient", stat.PASS);
    } catch (Exception e) {
      e.printStackTrace();
      System.out.println("[apiClient] Exception in init....");
      e.printStackTrace();
      // stat.addStatus("client initSFSB", stat.FAIL);
    }
  }
コード例 #2
0
 private void initSLSB() {
   System.out.println("[txtests] Inside init....");
   try {
     Context ic = new InitialContext();
     Object objref = ic.lookup("java:comp/env/ejb/SLSBHome");
     this.home = (SLSBHome) PortableRemoteObject.narrow(objref, SLSBHome.class);
     System.out.println("[txtests] Initalization done");
   } catch (Exception e) {
     System.out.println("[txtests] Exception in init....");
     e.printStackTrace();
   }
 }