Java Code Examples for org.omg.CORBA.StructMember

The following are top voted examples for showing how to use org.omg.CORBA.StructMember. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 2
Project: openjdk-jdk10   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 3
Project: openjdk9   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 4
Project: lookaside_java-1.8.0-openjdk   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 5
Project: jdk8u_corba   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 6
Project: javify   File: StructureToReturnHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 7
Project: javify   File: TaggedComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 8
Project: javify   File: ServiceContextHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 9
Project: javify   File: TaggedProfileHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 10
Project: javify   File: NameValuePairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 11
Project: javify   File: NameDynAnyPairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 12
Project: javify   File: InvalidPolicyHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 13
Project: javify   File: NameComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;

  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 14
Project: javify   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 15
Project: javify   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 16
Project: jvm-stm   File: StructureToReturnHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 17
Project: jvm-stm   File: TaggedComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];
  
  TypeCode field;
  
  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);
  
  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 18
Project: jvm-stm   File: ServiceContextHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 19
Project: jvm-stm   File: TaggedProfileHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 20
Project: jvm-stm   File: NameValuePairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 21
Project: jvm-stm   File: NameDynAnyPairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 22
Project: jvm-stm   File: InvalidPolicyHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 23
Project: jvm-stm   File: NameComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  
  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 24
Project: jvm-stm   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 25
Project: jvm-stm   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 26
Project: infobip-open-jdk-8   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 27
Project: openjdk-source-code-learn   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 28
Project: OLD-OpenJDK8   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 29
Project: JamVM-PH   File: StructureToReturnHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 30
Project: JamVM-PH   File: TaggedComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];
  
  TypeCode field;
  
  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);
  
  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 31
Project: JamVM-PH   File: ServiceContextHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 32
Project: JamVM-PH   File: TaggedProfileHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 33
Project: JamVM-PH   File: NameValuePairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 34
Project: JamVM-PH   File: NameDynAnyPairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];
  
  TypeCode field;
  
  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);
  
  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 35
Project: JamVM-PH   File: InvalidPolicyHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 36
Project: JamVM-PH   File: NameComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  
  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 37
Project: JamVM-PH   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 38
Project: JamVM-PH   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 39
Project: openjdk-orb   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 40
Project: classpath   File: StructureToReturnHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the typecode.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[3];
  TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members[0] = new StructMember("n", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("c", member, null);
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  member = OrbRestricted.Singleton.create_array_tc(3, member);
  members[2] = new StructMember("arra", member, null);
  return OrbRestricted.Singleton.create_struct_tc(
                                                  StructureToReturnHelper.id(),
                                                  "StructureToReturn",
                                                  members);
}
 
Example 41
Project: classpath   File: TaggedComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedComponent typecode (structure, named "TaggedComponent").
 * The typecode states that the structure contains the following fields: tag,
 * component_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0",
                              "ComponentId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("component_data", field, null);
  return orb.create_struct_tc(id(), "TaggedComponent", members);
}
 
Example 42
Project: classpath   File: ServiceContextHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the ServiceContext typecode (structure, named "ServiceContext"). The
 * typecode states that the structure contains the following fields:
 * context_id, context_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("context_id", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("context_data", field, null);
  return orb.create_struct_tc(id(), "ServiceContext", members);
}
 
Example 43
Project: classpath   File: TaggedProfileHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The
 * typecode states that the structure contains the following fields: tag,
 * profile_data.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId",
                              orb.get_primitive_tc(TCKind.tk_ulong));
  members[0] = new StructMember("tag", field, null);

  field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet));
  members[1] = new StructMember("profile_data", field, null);
  return orb.create_struct_tc(id(), "TaggedProfile", members);
}
 
Example 44
Project: classpath   File: NameValuePairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameValuePair typecode (structure,
 * named "NameValuePair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = orb.get_primitive_tc(TCKind.tk_any);
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameValuePair", members);
}
 
Example 45
Project: classpath   File: NameDynAnyPairHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the NameDynAnyPair typecode (structure,
 * named "NameDynAnyPair").
 * The typecode states that the structure contains the
 * following fields: id, value.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[ 2 ];

  TypeCode field;

  field =
    orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0",
                        "FieldName",
                        orb.get_primitive_tc(TCKind.tk_string)
    );
  members [ 0 ] = new StructMember("id", field, null);

  field = DynAnyHelper.type();
  members [ 1 ] = new StructMember("value", field, null);
  return orb.create_struct_tc(id(), "NameDynAnyPair", members);
}
 
Example 46
Project: classpath   File: InvalidPolicyHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Create the InvalidPolicy typecode (emtpy structure,
 * named "InvalidPolicy").
 * The typecode states that the structure contains the
 * single field, named "index".
 */
public static TypeCode type()
{
  if (typeCode == null)
    {
      ORB orb = OrbRestricted.Singleton;
      StructMember[] members = new StructMember[ 1 ];

      TypeCode field;

      field = orb.get_primitive_tc(TCKind.tk_ushort);
      members [ 0 ] = new StructMember("index", field, null);
      typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members);
    }
  return typeCode;
}
 
Example 47
Project: classpath   File: NameComponentHelper.java   Source Code and License 6 votes vote down vote up
/**
 * Get the type code of the named component.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;

  StructMember[] members = new StructMember[ 2 ];
  TypeCode member;
  member = orb.create_string_tc(0);
  members [ 0 ] = new StructMember("id", member, null);
  member = orb.create_string_tc(0);
  members [ 1 ] = new StructMember("kind", member, null);
  return
  orb.create_struct_tc(NameComponentHelper.id(), "NameComponent",
                       members
  );
}
 
Example 48
Project: classpath   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_exception_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_except);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 49
Project: classpath   File: OrbRestricted.java   Source Code and License 6 votes vote down vote up
/** {@inheritDoc} */
public TypeCode create_struct_tc(String id, String name,
  StructMember[] members
)
{
  RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct);
  r.setId(id);
  r.setName(name);

  for (int i = 0; i < members.length; i++)
    {
      r.add(members [ i ]);
    }

  return r;
}
 
Example 50
Project: openjdk-icedtea7   File: TypeCodeImpl.java   Source Code and License 6 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    String id,
                    String name,
                    StructMember[] members)
                    // for structs and exceptions
{
    this(orb);

    if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) {
        _kind               = creationKind;
        setId(id);
        _name               = name;
        _memberCount        = members.length;

        _memberNames = new String[_memberCount];
        _memberTypes = new TypeCodeImpl[_memberCount];

        for (int i = 0 ; i < _memberCount ; i++) {
            _memberNames[i] = members[i].name;
            _memberTypes[i] = convertToNative(_orb, members[i].type);
            _memberTypes[i].setParent(this);
        }
    } // else initializes to null
}
 
Example 51
Project: OpenJSharp   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
private static StructMember[] systemExceptionMembers (ORB orb) {
    if (members == null) {
        members = new StructMember[3];
        members[0] = new StructMember("id", orb.create_string_tc(0), null);
        members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null);
        members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null);
    }
    return members;
}
 
Example 52
Project: openjdk-jdk10   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
private static StructMember[] systemExceptionMembers (ORB orb) {
    if (members == null) {
        members = new StructMember[3];
        members[0] = new StructMember("id", orb.create_string_tc(0), null);
        members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null);
        members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null);
    }
    return members;
}
 
Example 53
Project: openjdk9   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
private static StructMember[] systemExceptionMembers (ORB orb) {
    if (members == null) {
        members = new StructMember[3];
        members[0] = new StructMember("id", orb.create_string_tc(0), null);
        members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null);
        members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null);
    }
    return members;
}
 
Example 54
Project: lookaside_java-1.8.0-openjdk   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
private static StructMember[] systemExceptionMembers (ORB orb) {
    if (members == null) {
        members = new StructMember[3];
        members[0] = new StructMember("id", orb.create_string_tc(0), null);
        members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null);
        members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null);
    }
    return members;
}
 
Example 55
Project: jdk8u_corba   File: ORBUtility.java   Source Code and License 5 votes vote down vote up
private static StructMember[] systemExceptionMembers (ORB orb) {
    if (members == null) {
        members = new StructMember[3];
        members[0] = new StructMember("id", orb.create_string_tc(0), null);
        members[1] = new StructMember("minor", orb.get_primitive_tc(TCKind.tk_long), null);
        members[2] = new StructMember("completed", orb.get_primitive_tc(TCKind.tk_long), null);
    }
    return members;
}
 
Example 56
Project: javify   File: TreeNodeHelper.java   Source Code and License 5 votes vote down vote up
/**
 * Get the TreeNode type code definition.
 */
public static synchronized TypeCode type()
{
  // Compute the type code only once.
  if (typeCode == null)
    {
      synchronized (TypeCode.class)
        {
          if (typeCode == null)
            {
              // To avoid the infinite recursion loop, the
              // recursive reference is handled in specific way.
              if (active)
                return OrbRestricted.Singleton.create_recursive_tc(_id);
              active = true;

              // List all memebers of the TreeNode structure.
              StructMember[] members = new StructMember[ 2 ];
              TypeCode memberType;
              memberType = OrbRestricted.Singleton.create_string_tc(0);
              members [ 0 ] = new StructMember("name", memberType, null);
              memberType = OrbRestricted.Singleton.create_recursive_tc("");
              members [ 1 ] = new StructMember("children", memberType, null);
              typeCode =
                OrbRestricted.Singleton.create_struct_tc(TreeNodeHelper.id(), "TreeNode", members);
              active = false;
            }
        }
    }
  return typeCode;
}
 
Example 57
Project: javify   File: WeThrowThisExceptionHelper.java   Source Code and License 5 votes vote down vote up
/**
 * Create the type code of this exception.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[ 1 ];
  TypeCode member = null;
  member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long);
  members [ 0 ] = new StructMember("ourField", member, null);
  return OrbRestricted.Singleton.create_struct_tc(WeThrowThisExceptionHelper.id(),
                                     "WeThrowThisException", members
                                    );
}
 
Example 58
Project: javify   File: StructureToPassHelper.java   Source Code and License 5 votes vote down vote up
/**
 * Get the type code of this structure.
 */
public static synchronized TypeCode type()
{
  StructMember[] members = new StructMember[2];
  TypeCode member = null;
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[0] = new StructMember("a", member, null);
  member = OrbRestricted.Singleton.create_string_tc(0);
  members[1] = new StructMember("b", member, null);
  return OrbRestricted.Singleton.create_struct_tc(StructureToPassHelper.id(),
                                                  "StructureToPass", members);
}
 
Example 59
Project: javify   File: IORHelper.java   Source Code and License 5 votes vote down vote up
/**
 * Create the IOR typecode (structure, named "IOR"). The typecode states that
 * the structure contains the following fields: type_id, profiles.
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[2];

  TypeCode field;

  field = orb.get_primitive_tc(TCKind.tk_string);
  members[0] = new StructMember("type_id", field, null);

  field = orb.create_sequence_tc(0, TaggedProfileHelper.type());
  members[1] = new StructMember("profiles", field, null);
  return orb.create_struct_tc(id(), "IOR", members);
}
 
Example 60
Project: javify   File: UnknownEncodingHelper.java   Source Code and License 5 votes vote down vote up
/**
 * Create the UnknownEncoding typecode (structure,
 * named "UnknownEncoding").
 */
public static TypeCode type()
{
  ORB orb = OrbRestricted.Singleton;
  StructMember[] members = new StructMember[0];
  return
  orb.create_exception_tc (id(), "UnknownEncoding", members);

}