Java Code Examples for com.sun.tools.corba.se.idl.InterfaceEntry#isLocal()
The following examples show how to use
com.sun.tools.corba.se.idl.InterfaceEntry#isLocal() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Helper.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Generate the read method. **/ protected void writeRead () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static " + helperType + " read (org.omg.CORBA.portable.InputStream istream)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperRead (helperType, entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 2
Source File: Helper.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Generate the write method. **/ protected void writeWrite () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static void write (org.omg.CORBA.portable.OutputStream ostream, " + helperType + " value)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperWrite (entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 3
Source File: Helper.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Generate the write method. **/ protected void writeWrite () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static void write (org.omg.CORBA.portable.OutputStream ostream, " + helperType + " value)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperWrite (entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 4
Source File: Helper.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Generate the read method. **/ protected void writeRead () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static " + helperType + " read (org.omg.CORBA.portable.InputStream istream)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperRead (helperType, entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 5
Source File: Helper.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Generate the read method. **/ protected void writeRead () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static " + helperType + " read (org.omg.CORBA.portable.InputStream istream)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperRead (helperType, entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 6
Source File: Helper.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * Generate the write method. **/ protected void writeWrite () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static void write (org.omg.CORBA.portable.OutputStream ostream, " + helperType + " value)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperWrite (entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 7
Source File: Helper.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * Generate the write method. **/ protected void writeWrite () { boolean isLocalInterface = false; if (entry instanceof InterfaceEntry) { InterfaceEntry ie = (InterfaceEntry) entry; // for #pragma sun_local or sun_localservant, or actual local // local interface, set the flag by checking on both isLocalInterface = ie.isLocal() | ie.isLocalServant(); } stream.println (" public static void write (org.omg.CORBA.portable.OutputStream ostream, " + helperType + " value)"); stream.println (" {"); if ( !isLocalInterface ) { // nonLocal Interface and other types ((JavaGenerator)entry.generator ()).helperWrite (entry, stream); } else { //Local interface should throw exception stream.println (" throw new org.omg.CORBA.MARSHAL ();"); } stream.println (" }"); stream.println (); }
Example 8
Source File: Helper.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Write the narrow() method for a remotable object. **/ protected void writeRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteNarrowForLocal (false); return; } // narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else if (!obj._is_a (id ()))"); stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 9
Source File: InterfaceGen.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Generate the interface and all the files associated with it. * Provides general algorithm for binding generation: * 1.) Initialize symbol table and symbol table entry members, common to all generators. * 2.) Generate the skeleton if required by calling generateSkeletn () * 3.) Generate the holder by calling generateHolder () * 4.) Generate the helper by calling generateHelper () * 5.) Generate the stub if required by calling generateStub () * 6.) Generate the interface by calling generateInterface () **/ public void generate (Hashtable symbolTable, InterfaceEntry i, PrintWriter stream) { if (!isPseudo(i)) { this.symbolTable = symbolTable; this.i = i; init (); // for sun_local pragma, just generate the signature and operations interfaces // for sun_localservant pragma, generate the Local Stubs, and Skel, should not // have _invoke defined. // for local (is_local()) case, generate only Helpers and Holder, where they // have been modified to throw appropriate exceptions for read and write, and // narrow is modified to not invoke _is_a if (! (i.isLocalSignature())) { // generate the stubs and skeletons for non-local interfaces if (! (i.isLocal())) { // for local servant case just generate the skeleton, but // for others generate the stubs also generateSkeleton (); // _REVISIT_, Whenever there is time restructure the code to // encapsulate stub and skeleton generation. // If the option is -fallTie then generate the Tie class first // and then generate the ImplBase class to make the generation // complete for the Hierarchy. Arguments theArguments = (Arguments)Compile.compiler.arguments; if( (theArguments.TIEServer == true ) &&(theArguments.emit == theArguments.All ) ) { theArguments.TIEServer = false; // Generate the ImplBase class generateSkeleton (); // Revert in case file contains multiple interfaces theArguments.TIEServer = true; } generateStub (); } generateHolder (); generateHelper (); } intfType = SIGNATURE; generateInterface (); intfType = OPERATIONS; generateInterface (); intfType = 0; } }
Example 10
Source File: Helper.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
/** * Write the unchecked narrow() method for a remotable object. **/ protected void writeUncheckedRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // unchecked narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteUncheckedNarrowForLocal (false); return; } // unchecked narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 11
Source File: Helper.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Write the unchecked narrow() method for a remotable object. **/ protected void writeUncheckedRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // unchecked narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteUncheckedNarrowForLocal (false); return; } // unchecked narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 12
Source File: Helper.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
/** * Write the narrow() method for a remotable object. **/ protected void writeRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteNarrowForLocal (false); return; } // narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else if (!obj._is_a (id ()))"); stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 13
Source File: Helper.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Write the narrow() method for a remotable object. **/ protected void writeRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteNarrowForLocal (false); return; } // narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else if (!obj._is_a (id ()))"); stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 14
Source File: Helper.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
/** * Write the narrow() method for a remotable object. **/ protected void writeRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteNarrowForLocal (false); return; } // narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else if (!obj._is_a (id ()))"); stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 15
Source File: InterfaceGen.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Generate the interface and all the files associated with it. * Provides general algorithm for binding generation: * 1.) Initialize symbol table and symbol table entry members, common to all generators. * 2.) Generate the skeleton if required by calling generateSkeletn () * 3.) Generate the holder by calling generateHolder () * 4.) Generate the helper by calling generateHelper () * 5.) Generate the stub if required by calling generateStub () * 6.) Generate the interface by calling generateInterface () **/ public void generate (Hashtable symbolTable, InterfaceEntry i, PrintWriter stream) { if (!isPseudo(i)) { this.symbolTable = symbolTable; this.i = i; init (); // for sun_local pragma, just generate the signature and operations interfaces // for sun_localservant pragma, generate the Local Stubs, and Skel, should not // have _invoke defined. // for local (is_local()) case, generate only Helpers and Holder, where they // have been modified to throw appropriate exceptions for read and write, and // narrow is modified to not invoke _is_a if (! (i.isLocalSignature())) { // generate the stubs and skeletons for non-local interfaces if (! (i.isLocal())) { // for local servant case just generate the skeleton, but // for others generate the stubs also generateSkeleton (); // _REVISIT_, Whenever there is time restructure the code to // encapsulate stub and skeleton generation. // If the option is -fallTie then generate the Tie class first // and then generate the ImplBase class to make the generation // complete for the Hierarchy. Arguments theArguments = (Arguments)Compile.compiler.arguments; if( (theArguments.TIEServer == true ) &&(theArguments.emit == theArguments.All ) ) { theArguments.TIEServer = false; // Generate the ImplBase class generateSkeleton (); // Revert in case file contains multiple interfaces theArguments.TIEServer = true; } generateStub (); } generateHolder (); generateHelper (); } intfType = SIGNATURE; generateInterface (); intfType = OPERATIONS; generateInterface (); intfType = 0; } }
Example 16
Source File: InterfaceGen.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Generate the interface and all the files associated with it. * Provides general algorithm for binding generation: * 1.) Initialize symbol table and symbol table entry members, common to all generators. * 2.) Generate the skeleton if required by calling generateSkeletn () * 3.) Generate the holder by calling generateHolder () * 4.) Generate the helper by calling generateHelper () * 5.) Generate the stub if required by calling generateStub () * 6.) Generate the interface by calling generateInterface () **/ public void generate (Hashtable symbolTable, InterfaceEntry i, PrintWriter stream) { if (!isPseudo(i)) { this.symbolTable = symbolTable; this.i = i; init (); // for sun_local pragma, just generate the signature and operations interfaces // for sun_localservant pragma, generate the Local Stubs, and Skel, should not // have _invoke defined. // for local (is_local()) case, generate only Helpers and Holder, where they // have been modified to throw appropriate exceptions for read and write, and // narrow is modified to not invoke _is_a if (! (i.isLocalSignature())) { // generate the stubs and skeletons for non-local interfaces if (! (i.isLocal())) { // for local servant case just generate the skeleton, but // for others generate the stubs also generateSkeleton (); // _REVISIT_, Whenever there is time restructure the code to // encapsulate stub and skeleton generation. // If the option is -fallTie then generate the Tie class first // and then generate the ImplBase class to make the generation // complete for the Hierarchy. Arguments theArguments = (Arguments)Compile.compiler.arguments; if( (theArguments.TIEServer == true ) &&(theArguments.emit == theArguments.All ) ) { theArguments.TIEServer = false; // Generate the ImplBase class generateSkeleton (); // Revert in case file contains multiple interfaces theArguments.TIEServer = true; } generateStub (); } generateHolder (); generateHelper (); } intfType = SIGNATURE; generateInterface (); intfType = OPERATIONS; generateInterface (); intfType = 0; } }
Example 17
Source File: Helper.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Write the unchecked narrow() method for a remotable object. **/ protected void writeUncheckedRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // unchecked narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteUncheckedNarrowForLocal (false); return; } // unchecked narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 18
Source File: Helper.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
/** * Write the unchecked narrow() method for a remotable object. **/ protected void writeUncheckedRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // unchecked narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteUncheckedNarrowForLocal (false); return; } // unchecked narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 19
Source File: Helper.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Write the narrow() method for a remotable object. **/ protected void writeRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteNarrowForLocal (false); return; } // narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else if (!obj._is_a (id ()))"); stream.println (" throw new org.omg.CORBA.BAD_PARAM ();"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }
Example 20
Source File: Helper.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
/** * Write the unchecked narrow() method for a remotable object. **/ protected void writeUncheckedRemoteNarrow () { InterfaceEntry ie = (InterfaceEntry) entry; // unchecked narrow for LocalObject interface if (ie.isLocal ()) { writeRemoteUncheckedNarrowForLocal (false); return; } // unchecked narrow for Abstract interface if (ie.isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (false); return; } else { // Determine if the non-abstract interface has any abstract parents for (int i = 0; i < ie.derivedFrom ().size (); i++) { SymtabEntry parent = (SymtabEntry) ie.derivedFrom ().elementAt (i); if (((InterfaceEntry) parent).isAbstract ()) { writeRemoteUncheckedNarrowForAbstract (true); break; } } } stream.println (" public static " + helperType + " unchecked_narrow (org.omg.CORBA.Object obj)"); stream.println (" {"); stream.println (" if (obj == null)"); stream.println (" return null;"); stream.println (" else if (obj instanceof " + helperType + ')'); stream.println (" return (" + helperType + ")obj;"); stream.println (" else"); stream.println (" {"); stream.println (" org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();"); String stubNameofEntry = stubName ((InterfaceEntry)entry); stream.println (" " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();"); stream.println (" stub._set_delegate(delegate);"); stream.println (" return stub;"); stream.println (" }"); stream.println (" }"); }