Ejemplo n.º 1
0
  /**
   * Returns a sequence of NameValuePairs describing the name and the value of each member in the
   * struct associated with a DynStruct object. The sequence contains members in the same order as
   * the declaration order of members as indicated by the DynStruct's TypeCode. The current position
   * is not affected. The member names in the returned sequence will be empty strings if the
   * DynStruct's TypeCode does not contain member names.
   */
  public org.omg.DynamicAny.NameValuePair[] get_members() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("get_members", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.get_members();
    } finally {
      _servant_postinvoke($so);
    }
  } // get_members
Ejemplo n.º 2
0
  /**
   * Creates a new DynAny object whose value is a deep copy of the DynAny on which it is invoked.
   * The operation is polymorphic, that is, invoking it on one of the types derived from DynAny,
   * such as DynStruct, creates the derived type but returns its reference as the DynAny base type.
   *
   * @return a deep copy of the DynAny object
   */
  public org.omg.DynamicAny.DynAny copy() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("copy", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.copy();
    } finally {
      _servant_postinvoke($so);
    }
  } // copy
Ejemplo n.º 3
0
  /**
   * Compares two DynAny values for equality. Two DynAny values are equal if their TypeCodes are
   * equivalent and, recursively, all component DynAnys have equal values. The current position of
   * the two DynAnys being compared has no effect on the result of equal.
   *
   * @return true of the DynAnys are equal, false otherwise
   */
  public boolean equal(org.omg.DynamicAny.DynAny dyn_any) {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("equal", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.equal(dyn_any);
    } finally {
      _servant_postinvoke($so);
    }
  } // equal
Ejemplo n.º 4
0
  /**
   * Destroys a DynAny object. This operation frees any resources used to represent the data value
   * associated with a DynAny object. It must be invoked on references obtained from one of the
   * creation operations on the ORB interface or on a reference returned by DynAny.copy() to avoid
   * resource leaks. Invoking destroy on component DynAny objects (for example, on objects returned
   * by the current_component operation) does nothing. Destruction of a DynAny object implies
   * destruction of all DynAny objects obtained from it. That is, references to components of a
   * destroyed DynAny become invalid. Invocations on such references raise OBJECT_NOT_EXIST. It is
   * possible to manipulate a component of a DynAny beyond the life time of the DynAny from which
   * the component was obtained by making a copy of the component with the copy operation before
   * destroying the DynAny from which the component was obtained.
   */
  public void destroy() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("destroy", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      $self.destroy();
    } finally {
      _servant_postinvoke($so);
    }
  } // destroy
Ejemplo n.º 5
0
  /**
   * Returns the number of components of a DynAny. For a DynAny without components, it returns zero.
   * The operation only counts the components at the top level. For example, if component_count is
   * invoked on a DynStruct with a single member, the return value is 1, irrespective of the type of
   * the member.
   *
   * <UL>
   *   <LI>For sequences, the operation returns the current number of elements.
   *   <LI>For structures, exceptions, and value types, the operation returns the number of members.
   *   <LI>For arrays, the operation returns the number of elements.
   *   <LI>For unions, the operation returns 2 if the discriminator indicates that a named member is
   *       active, otherwise, it returns 1.
   *   <LI>For DynFixed and DynEnum, the operation returns zero.
   * </UL>
   */
  public int component_count() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("component_count", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.component_count();
    } finally {
      _servant_postinvoke($so);
    }
  } // component_count
Ejemplo n.º 6
0
  /**
   * Creates an any value from a DynAny object. A copy of the TypeCode associated with the DynAny
   * object is assigned to the resulting any. The value associated with the DynAny object is copied
   * into the any.
   *
   * @return a new Any object with the same value and TypeCode
   */
  public org.omg.CORBA.Any to_any() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("to_any", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.to_any();
    } finally {
      _servant_postinvoke($so);
    }
  } // to_any
Ejemplo n.º 7
0
  /**
   * Advances the current position to the next component. The operation returns true while the
   * resulting current position indicates a component, false otherwise. A false return value leaves
   * the current position at -1. Invoking next on a DynAny without components leaves the current
   * position at -1 and returns false.
   */
  public boolean next() {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("next", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.next();
    } finally {
      _servant_postinvoke($so);
    }
  } // next
Ejemplo n.º 8
0
  /**
   * Sets the current position to index. The current position is indexed 0 to n-1, that is, index
   * zero corresponds to the first component. The operation returns true if the resulting current
   * position indicates a component of the DynAny and false if index indicates a position that does
   * not correspond to a component. Calling seek with a negative index is legal. It sets the current
   * position to -1 to indicate no component and returns false. Passing a non-negative index value
   * for a DynAny that does not have a component at the corresponding position sets the current
   * position to -1 and returns false.
   */
  public boolean seek(int index) {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("seek", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.seek(index);
    } finally {
      _servant_postinvoke($so);
    }
  } // seek
Ejemplo n.º 9
0
  /**
   * Initializes the value associated with a DynAny object with the value associated with another
   * DynAny object. The current position of the target DynAny is set to zero for values that have
   * components and to -1 for values that do not have components.
   *
   * @param dyn_any
   * @exception TypeMismatch if the type of the passed DynAny is not equivalent to the type of
   *     target DynAny
   */
  public void assign(org.omg.DynamicAny.DynAny dyn_any)
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("assign", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      $self.assign(dyn_any);
    } finally {
      _servant_postinvoke($so);
    }
  } // assign
Ejemplo n.º 10
0
  /**
   * Returns the DynAny for the component at the current position. It does not advance the current
   * position, so repeated calls to current_component without an intervening call to rewind, next,
   * or seek return the same component. The returned DynAny object reference can be used to get/set
   * the value of the current component. If the current component represents a complex type, the
   * returned reference can be narrowed based on the TypeCode to get the interface corresponding to
   * the to the complex type. Calling current_component on a DynAny that cannot have components,
   * such as a DynEnum or an empty exception, raises TypeMismatch. Calling current_component on a
   * DynAny whose current position is -1 returns a nil reference. The iteration operations, together
   * with current_component, can be used to dynamically compose an any value. After creating a
   * dynamic any, such as a DynStruct, current_component and next can be used to initialize all the
   * components of the value. Once the dynamic value is completely initialized, to_any creates the
   * corresponding any value.
   *
   * @exception TypeMismatch If called on a DynAny that cannot have components, such as a DynEnum or
   *     an empty exception
   */
  public org.omg.DynamicAny.DynAny current_component()
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("current_component", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.current_component();
    } finally {
      _servant_postinvoke($so);
    }
  } // current_component
Ejemplo n.º 11
0
  /**
   * Extracts the string value from this DynAny. Both bounded and unbounded strings are extracted
   * using this method.
   *
   * @exception TypeMismatch if the accessed component in the DynAny is of a type that is not
   *     equivalent to the requested type.
   * @exception TypeMismatch if called on a DynAny whose current component itself has components
   */
  public String get_wstring()
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
          org.omg.DynamicAny.DynAnyPackage.InvalidValue {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("get_wstring", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.get_wstring();
    } finally {
      _servant_postinvoke($so);
    }
  } // get_wstring
Ejemplo n.º 12
0
  /**
   * Initializes the struct data value associated with a DynStruct object from a sequence of
   * NameValuePairs. The operation sets the current position to zero if the passed sequences has
   * non-zero length. Otherwise, if an empty sequence is passed, the current position is set to -1.
   *
   * <p>Members must appear in the NameValuePairs in the order in which they appear in the IDL
   * specification of the struct as indicated by the DynStruct's TypeCode or they must be empty
   * strings. The operation makes no attempt to assign member values based on member names.
   *
   * @exception TypeMismatch if the member names supplied in the passed sequence do not match the
   *     corresponding member name in the DynStruct's TypeCode and they are not empty strings
   * @exception InvalidValue if the passed sequence has a number of elements that disagrees with the
   *     number of members as indicated by the DynStruct's TypeCode
   */
  public void set_members(org.omg.DynamicAny.NameValuePair[] value)
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
          org.omg.DynamicAny.DynAnyPackage.InvalidValue {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("set_members", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      $self.set_members(value);
    } finally {
      _servant_postinvoke($so);
    }
  } // set_members
Ejemplo n.º 13
0
  /**
   * Inserts a reference to a Serializable object into this DynAny. The IDL ValueBase type is mapped
   * to the Java Serializable type.
   *
   * @exception InvalidValue if this DynAny has components but has a current position of -1
   * @exception TypeMismatch if called on a DynAny whose current component itself has components
   */
  public void insert_val(java.io.Serializable value)
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
          org.omg.DynamicAny.DynAnyPackage.InvalidValue {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("insert_val", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      $self.insert_val(value);
    } finally {
      _servant_postinvoke($so);
    }
  } // insert_val
Ejemplo n.º 14
0
  /**
   * Returns the TCKind associated with the member at the current position.
   *
   * @exception TypeMismatch if the DynStruct represents an empty exception.
   * @exception InvalidValue if the current position does not indicate a member
   */
  public org.omg.CORBA.TCKind current_member_kind()
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
          org.omg.DynamicAny.DynAnyPackage.InvalidValue {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("current_member_kind", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      return $self.current_member_kind();
    } finally {
      _servant_postinvoke($so);
    }
  } // current_member_kind
Ejemplo n.º 15
0
  /**
   * Initializes the value associated with a DynAny object with the value contained in an any. The
   * current position of the target DynAny is set to zero for values that have components and to -1
   * for values that do not have components.
   *
   * @exception TypeMismatch if the type of the passed Any is not equivalent to the type of target
   *     DynAny
   * @exception InvalidValue if the passed Any does not contain a legal value (such as a null
   *     string)
   */
  public void from_any(org.omg.CORBA.Any value)
      throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch,
          org.omg.DynamicAny.DynAnyPackage.InvalidValue {
    org.omg.CORBA.portable.ServantObject $so = _servant_preinvoke("from_any", _opsClass);
    DynStructOperations $self = (DynStructOperations) $so.servant;

    try {
      $self.from_any(value);
    } finally {
      _servant_postinvoke($so);
    }
  } // from_any