Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4479114

CORBA.portable.ObjectImpl._non_existent() throws OBJECT_NOT_EXIST

XMLWordPrintable

    • beta3
    • sparc
    • solaris_2.6
    • Not verified



        Name: aaR10142 Date: 07/12/2001



        CORBA.portable.ObjectImpl._non_existent() throws OBJECT_NOT_EXIST exception

        But should returns true.
        Spec says:"
        4.3.5.1 non_existent
        boolean non_existent ();

        The non_existent operation may be used to test whether an object (e.g., a proxy object) has been destroyed. It does this without invoking any application level operation on the object, and so will never affect the object itself. It returns true (rather than raising CORBA::OBJECT_NOT_EXIST) if the ORB knows authoritatively that the object does not exist; otherwise, it returns false.
        "

        See an example.

        ------------- Test.java ---------------------
        import org.omg.CosNaming.*;
        import org.omg.CORBA.*;

        public class Test {
           public static void main(String args[])
           {
              ORB myORB = null;
              try {
         
                myORB = ORB.init(args, null);

                BindingListHolder bLHolder = new BindingListHolder();
                BindingIteratorHolder bItHolder= new BindingIteratorHolder();
                
        org.omg.CORBA.Object objRef =
        myORB.resolve_initial_references("NameService");
               NamingContext ncRef = NamingContextHelper.narrow(objRef);
                NameComponent nc = new NameComponent("Test", "");
        NameComponent path[] = {nc};
                ncRef.rebind(path, ncRef);
                ncRef.list(0, bLHolder, bItHolder);
        BindingIterator bindIter = bItHolder.value;
                
                bindIter.destroy();
                if(bindIter._non_existent()) {
        System.out.println("Passed");
        } else {
        System.out.println("Failed");
        }


              } catch (Exception e ) {
        e.printStackTrace();
              } finally {
                  if(myORB!=null) {
                      myORB.shutdown(true);
                  }
              }

         
           }
        }

         
        ------------------- start --------------------
        #> tnameserv -ORBInitialPort 9876 &
        #>javac -classpath . -d . Test.java
        #>java -classpath . Test -ORBInitialPort 9876
        ----------------- output -----------------
        org.omg.CORBA.OBJECT_NOT_EXIST: vmcid: SUN minor code: 1004 completed: No
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:33)
                at sun.reflect.InflatableConstructorAccessorImpl.newInstance(InflatableConstructorAccessorImpl.java:38)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:273)
                at java.lang.Class.newInstance0(Class.java:290)
                at java.lang.Class.newInstance(Class.java:249)
                at com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:85)
                at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:87)
                at com.sun.corba.se.internal.POA.GenericPOAClientSC.invoke(GenericPOAClientSC.java:174)
                at com.sun.corba.se.internal.corba.ClientDelegate.non_existent(ClientDelegate.java:804)
                at org.omg.CORBA.portable.ObjectImpl._non_existent(ObjectImpl.java:140)
                at Test.main(Test.java:28)


        ======================================================================

              hcarr Harold Carr
              alisunw Ali Ali (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: