com.sun.tools.corba.se.idl.InterfaceEntry Java Examples

The following examples show how to use com.sun.tools.corba.se.idl.InterfaceEntry. 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: StructGen.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
protected void writeMembers ()
{
  // Write members and populate quality arrays
  int size = s.members ().size ();
  memberIsPrimitive = new boolean [size];
  memberIsInterface = new boolean [size];
  memberIsTypedef   = new boolean [size];
  for (int i = 0; i < s.members ().size (); ++i)
  {
    SymtabEntry member = (SymtabEntry)s.members ().elementAt (i);
    memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry;
    memberIsInterface[i] = member.type () instanceof InterfaceEntry;
    memberIsTypedef[i]   = member.type () instanceof TypedefEntry;
    Util.fillInfo (member);
    // Transfer member comment to target <31jul1997>.
    if (member.comment () != null)
       member.comment ().generate ("  ", stream);
    Util.writeInitializer ("  public ", member.name (), "", member, stream);
  }
}
 
Example #2
Source File: Helper.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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: Stub.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, SymtabEntry entry)
{
  this.symbolTable = symbolTable;
  this.i           = (InterfaceEntry)entry;
  this.localStub   = i.isLocalServant();
  this.isAbstract  = i.isAbstract( );
  init ();

  openStream ();
  if (stream == null)
    return;
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
}
 
Example #4
Source File: Util.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #5
Source File: Helper.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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: StructGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
protected void writeMembers ()
{
  // Write members and populate quality arrays
  int size = s.members ().size ();
  memberIsPrimitive = new boolean [size];
  memberIsInterface = new boolean [size];
  memberIsTypedef   = new boolean [size];
  for (int i = 0; i < s.members ().size (); ++i)
  {
    SymtabEntry member = (SymtabEntry)s.members ().elementAt (i);
    memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry;
    memberIsInterface[i] = member.type () instanceof InterfaceEntry;
    memberIsTypedef[i]   = member.type () instanceof TypedefEntry;
    Util.fillInfo (member);
    // Transfer member comment to target <31jul1997>.
    if (member.comment () != null)
       member.comment ().generate ("  ", stream);
    Util.writeInitializer ("  public ", member.name (), "", member, stream);
  }
}
 
Example #7
Source File: Skeleton.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Initialize members unique to this generator.
 **/
protected void init ()
{
  tie = ((Arguments)Compile.compiler.arguments).TIEServer ;
  poa = ((Arguments)Compile.compiler.arguments).POAServer ;

  skeletonNameModifier =
      ((Arguments)Compile.compiler.arguments).skeletonNameModifier ;
  tieNameModifier =
      ((Arguments)Compile.compiler.arguments).tieNameModifier ;

  tieClassName = tieNameModifier.makeName( i.name() ) ;
  skeletonClassName = skeletonNameModifier.makeName( i.name() ) ;

  intfName = Util.javaName (i);
  // for valuetype, get the name of the interface the valuetype supports
  if (i instanceof ValueEntry)
  {
    ValueEntry v = (ValueEntry) i;
    InterfaceEntry intf = (InterfaceEntry) v.supports ().elementAt (0);
    intfName = Util.javaName (intf);
  }
}
 
Example #8
Source File: AttributeGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private boolean unique (InterfaceEntry entry, String name)
{
  // Compare the name to the methods of this interface
  Enumeration methods = entry.methods ().elements ();
  while (methods.hasMoreElements ())
  {
    SymtabEntry method = (SymtabEntry)methods.nextElement ();
    if (name.equals (method.name ()))
      return false;
  }

  // Recursively call unique on each derivedFrom interface
  Enumeration derivedFrom = entry.derivedFrom ().elements ();
  while (derivedFrom.hasMoreElements ())
    if (!unique ((InterfaceEntry)derivedFrom.nextElement (), name))
      return false;

  // If the name isn't in any method, nor in any method of the
  // derivedFrom interfaces, then the name is unique.
  return true;
}
 
Example #9
Source File: Helper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #10
Source File: Skeleton.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private void buildMethodList (InterfaceEntry entry)
{
  // Add the local methods
  Enumeration locals = entry.methods ().elements ();
  while (locals.hasMoreElements ())
    addMethod ((MethodEntry)locals.nextElement ());

  // Add the inherited methods
  Enumeration parents = entry.derivedFrom ().elements ();
  while (parents.hasMoreElements ())
  {
    InterfaceEntry parent = (InterfaceEntry)parents.nextElement ();
    if (!parent.name ().equals ("Object"))
      buildMethodList (parent);
  }
}
 
Example #11
Source File: AttributeGen.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private boolean unique (InterfaceEntry entry, String name)
{
  // Compare the name to the methods of this interface
  Enumeration methods = entry.methods ().elements ();
  while (methods.hasMoreElements ())
  {
    SymtabEntry method = (SymtabEntry)methods.nextElement ();
    if (name.equals (method.name ()))
      return false;
  }

  // Recursively call unique on each derivedFrom interface
  Enumeration derivedFrom = entry.derivedFrom ().elements ();
  while (derivedFrom.hasMoreElements ())
    if (!unique ((InterfaceEntry)derivedFrom.nextElement (), name))
      return false;

  // If the name isn't in any method, nor in any method of the
  // derivedFrom interfaces, then the name is unique.
  return true;
}
 
Example #12
Source File: Stub.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private void buildMethodList (InterfaceEntry entry)
{
  // Add the local methods
  Enumeration locals = entry.methods ().elements ();
  while (locals.hasMoreElements ())
    addMethod ((MethodEntry)locals.nextElement ());

  // Add the inherited methods
  Enumeration parents = entry.derivedFrom ().elements ();
  while (parents.hasMoreElements ())
  {
    InterfaceEntry parent = (InterfaceEntry)parents.nextElement ();
    if (!parent.name ().equals ("Object"))
      buildMethodList (parent);
  }
}
 
Example #13
Source File: Helper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate members of this class.
 **/
protected void writeBody ()
{
  writeInstVars ();
  writeCtors ();
  writeInsert ();
  writeExtract ();
  writeType ();
  writeID ();
  writeRead ();
  writeWrite ();
  if (entry instanceof InterfaceEntry && !(entry instanceof ValueEntry)) {
    writeNarrow ();
    writeUncheckedNarrow ();
  }
  writeHelperInterface ();
  if (entry instanceof ValueEntry)
    writeValueHelperInterface ();
}
 
Example #14
Source File: StructGen.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
protected void writeMembers ()
{
  // Write members and populate quality arrays
  int size = s.members ().size ();
  memberIsPrimitive = new boolean [size];
  memberIsInterface = new boolean [size];
  memberIsTypedef   = new boolean [size];
  for (int i = 0; i < s.members ().size (); ++i)
  {
    SymtabEntry member = (SymtabEntry)s.members ().elementAt (i);
    memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry;
    memberIsInterface[i] = member.type () instanceof InterfaceEntry;
    memberIsTypedef[i]   = member.type () instanceof TypedefEntry;
    Util.fillInfo (member);
    // Transfer member comment to target <31jul1997>.
    if (member.comment () != null)
       member.comment ().generate ("  ", stream);
    Util.writeInitializer ("  public ", member.name (), "", member, stream);
  }
}
 
Example #15
Source File: Helper.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #16
Source File: Util.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #17
Source File: Stub.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
private void buildMethodList (InterfaceEntry entry)
{
  // Add the local methods
  Enumeration locals = entry.methods ().elements ();
  while (locals.hasMoreElements ())
    addMethod ((MethodEntry)locals.nextElement ());

  // Add the inherited methods
  Enumeration parents = entry.derivedFrom ().elements ();
  while (parents.hasMoreElements ())
  {
    InterfaceEntry parent = (InterfaceEntry)parents.nextElement ();
    if (!parent.name ().equals ("Object"))
      buildMethodList (parent);
  }
}
 
Example #18
Source File: Util.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #19
Source File: MethodGen.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
protected void localstub (Hashtable symbolTable, MethodEntry m, PrintWriter stream, int index, InterfaceEntry i)
{
  this.symbolTable = symbolTable;
  this.m           = m;
  this.stream      = stream;
  this.methodIndex = index;
  if (m.comment () != null)
    m.comment ().generate ("  ", stream);
  stream.print ("  public ");
  writeMethodSignature ();
  stream.println ();
  stream.println ("  {");
  writeLocalStubBody (i);
  stream.println ("  } // " + m.name ());
  stream.println ();
}
 
Example #20
Source File: Helper.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate members of this class.
 **/
protected void writeBody ()
{
  writeInstVars ();
  writeCtors ();
  writeInsert ();
  writeExtract ();
  writeType ();
  writeID ();
  writeRead ();
  writeWrite ();
  if (entry instanceof InterfaceEntry && !(entry instanceof ValueEntry)) {
    writeNarrow ();
    writeUncheckedNarrow ();
  }
  writeHelperInterface ();
  if (entry instanceof ValueEntry)
    writeValueHelperInterface ();
}
 
Example #21
Source File: Skeleton.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Initialize members unique to this generator.
 **/
protected void init ()
{
  tie = ((Arguments)Compile.compiler.arguments).TIEServer ;
  poa = ((Arguments)Compile.compiler.arguments).POAServer ;

  skeletonNameModifier =
      ((Arguments)Compile.compiler.arguments).skeletonNameModifier ;
  tieNameModifier =
      ((Arguments)Compile.compiler.arguments).tieNameModifier ;

  tieClassName = tieNameModifier.makeName( i.name() ) ;
  skeletonClassName = skeletonNameModifier.makeName( i.name() ) ;

  intfName = Util.javaName (i);
  // for valuetype, get the name of the interface the valuetype supports
  if (i instanceof ValueEntry)
  {
    ValueEntry v = (ValueEntry) i;
    InterfaceEntry intf = (InterfaceEntry) v.supports ().elementAt (0);
    intfName = Util.javaName (intf);
  }
}
 
Example #22
Source File: Helper.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 #23
Source File: Stub.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
public void generate (Hashtable symbolTable, SymtabEntry entry)
{
  this.symbolTable = symbolTable;
  this.i           = (InterfaceEntry)entry;
  this.localStub   = i.isLocalServant();
  this.isAbstract  = i.isAbstract( );
  init ();

  openStream ();
  if (stream == null)
    return;
  writeHeading ();
  writeBody ();
  writeClosing ();
  closeStream ();
}
 
Example #24
Source File: Util.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private static String doContainerFullName (SymtabEntry container)
{
  String name = "";

  if (container == null)
    name = "";
  else
  {
    if (container instanceof InterfaceEntry ||
        container instanceof StructEntry ||
        container instanceof UnionEntry)
      name = container.name () + "Package";
    else
      name = container.name ();

    if (container.container () != null &&
      !container.container ().name ().equals (""))
      name = doContainerFullName (container.container ()) + '/' + name;
  }

  return name;
}
 
Example #25
Source File: StructGen.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 **/
protected void writeMembers ()
{
  // Write members and populate quality arrays
  int size = s.members ().size ();
  memberIsPrimitive = new boolean [size];
  memberIsInterface = new boolean [size];
  memberIsTypedef   = new boolean [size];
  for (int i = 0; i < s.members ().size (); ++i)
  {
    SymtabEntry member = (SymtabEntry)s.members ().elementAt (i);
    memberIsPrimitive[i] = member.type () instanceof PrimitiveEntry;
    memberIsInterface[i] = member.type () instanceof InterfaceEntry;
    memberIsTypedef[i]   = member.type () instanceof TypedefEntry;
    Util.fillInfo (member);
    // Transfer member comment to target <31jul1997>.
    if (member.comment () != null)
       member.comment ().generate ("  ", stream);
    Util.writeInitializer ("  public ", member.name (), "", member, stream);
  }
}
 
Example #26
Source File: Skeleton.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void buildIDList (InterfaceEntry entry, Vector list)
{
  if (!entry.fullName ().equals ("org/omg/CORBA/Object"))
  {
    String id = Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ());
    if (!list.contains (id))
      list.addElement (id);
    Enumeration e = entry.derivedFrom ().elements ();
    while (e.hasMoreElements ())
      buildIDList ((InterfaceEntry)e.nextElement (), list);
  }
}
 
Example #27
Source File: Helper.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return the stub name for the interface entry.
 **/
protected String stubName (InterfaceEntry entry)
{
  String name;
  if (entry.container ().name ().equals (""))
    name =  '_' + entry.name () + "Stub";
  else
  {
    name = Util.containerFullName (entry.container ()) + "._" + entry.name () + "Stub";
  }
  return name.replace ('/', '.');
}
 
Example #28
Source File: Helper.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write the narrow() method for abstract interface.
 **/
private void writeRemoteNarrowForAbstract (boolean hasAbstractParent)
{
  stream.print ("  public static " + helperType + " narrow (java.lang.Object obj)");
  stream.println ("  {");
  stream.println ("    if (obj == null)");
  stream.println ("      return null;");
  if (hasAbstractParent)
  {
    stream.println ("    else if (obj instanceof org.omg.CORBA.Object)");
    stream.println ("      return narrow ((org.omg.CORBA.Object) obj);");
  }
  else
  {
    stream.println ("    else if (obj instanceof " + helperType + ')');
    stream.println ("      return (" + helperType + ")obj;");
  }

  // If hasAbstractParent is false, then THIS entry must be abstract.
  // This method is also called in case THIS entry is not abstract, but
  // there is an abstract parent.  If this entry is not abstract,
  // it can never narrow to a CORBA object reference.
  if (!hasAbstractParent) { // <d58889>
    String stubNameofEntry = stubName ((InterfaceEntry)entry);

    stream.println ("    else if ((obj instanceof org.omg.CORBA.portable.ObjectImpl) &&");
    stream.println ("             (((org.omg.CORBA.Object)obj)._is_a (id ()))) {");
    stream.println ("      org.omg.CORBA.portable.ObjectImpl impl = (org.omg.CORBA.portable.ObjectImpl)obj ;" ) ;
    stream.println ("      org.omg.CORBA.portable.Delegate delegate = impl._get_delegate() ;" ) ;
    stream.println ("      " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();");
    stream.println ("      stub._set_delegate(delegate);");
    stream.println ("      return stub;" ) ;
    stream.println ("    }" ) ;
  };
  // end <d57118 - check for remotable - klr>

  stream.println ("    throw new org.omg.CORBA.BAD_PARAM ();");
  stream.println ("  }");
  stream.println ();
}
 
Example #29
Source File: Stub.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 *
 **/
private void buildIDList (InterfaceEntry entry, Vector list)
{
  if (!entry.fullName ().equals ("org/omg/CORBA/Object"))
  {
    String id = Util.stripLeadingUnderscoresFromID (entry.repositoryID ().ID ());
    if (!list.contains (id))
      list.addElement (id);
    Enumeration e = entry.derivedFrom ().elements ();
    while (e.hasMoreElements ())
      buildIDList ((InterfaceEntry)e.nextElement (), list);
  }
}
 
Example #30
Source File: Helper.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Write the unchecked narrow() method for abstract interface.
 **/
private void writeRemoteUncheckedNarrowForAbstract (boolean hasAbstractParent)
{
  stream.print ("  public static " + helperType + " unchecked_narrow (java.lang.Object obj)");
  stream.println ("  {");
  stream.println ("    if (obj == null)");
  stream.println ("      return null;");
  if (hasAbstractParent)
  {
    stream.println ("    else if (obj instanceof org.omg.CORBA.Object)");
    stream.println ("      return unchecked_narrow ((org.omg.CORBA.Object) obj);");
  }
  else
  {
    stream.println ("    else if (obj instanceof " + helperType + ')');
    stream.println ("      return (" + helperType + ")obj;");
  }

  if (!hasAbstractParent) {
    String stubNameofEntry = stubName ((InterfaceEntry)entry);

    stream.println ("    else if (obj instanceof org.omg.CORBA.portable.ObjectImpl) {");
    stream.println ("      org.omg.CORBA.portable.ObjectImpl impl = (org.omg.CORBA.portable.ObjectImpl)obj ;" ) ;
    stream.println ("      org.omg.CORBA.portable.Delegate delegate = impl._get_delegate() ;" ) ;
    stream.println ("      " + stubNameofEntry + " stub = new " + stubNameofEntry + " ();");
    stream.println ("      stub._set_delegate(delegate);");
    stream.println ("      return stub;" ) ;
    stream.println ("    }" ) ;
  };

  stream.println ("    throw new org.omg.CORBA.BAD_PARAM ();");
  stream.println ("  }");
  stream.println ();
}