public void receive_reply(ClientRequestInfo ri) {
    System.out.println("[" + Thread.currentThread() + "] ClientInterceptor: receive_reply()");

    try {
      org.omg.CORBA.Any any = ri.get_slot(slot_id);

      if (any == null) {
        System.out.println("Slot null");
        throw new INTERNAL("Any slot was unexpectedly null");
      }

      String result = any.extract_string();

      if (!result.equals("This is a test AAA")) {
        throw new Exception(
            "Did not receive correct message : got <"
                + result
                + "> and expected <This is a test AAA>");
      }

      System.out.println(
          "["
              + Thread.currentThread()
              + "] ClientInterceptor: receive_reply() - get_slot() = "
              + any);
    } catch (Exception e) {
      e.printStackTrace();
      throw new INTERNAL(e.getMessage());
    }
  }
Beispiel #2
0
 public void printSAS() {
   try {
     org.omg.PortableInterceptor.Current current =
         (org.omg.PortableInterceptor.Current) orb.resolve_initial_references("PICurrent");
     org.omg.CORBA.Any anyName =
         current.get_slot(org.jacorb.security.sas.SASInitializer.sasPrincipalNamePIC);
     String name = anyName.extract_string();
     System.out.println("printSAS for user " + name);
   } catch (Exception e) {
     System.out.println("printSAS Error: " + e);
   }
 }