Java Code Examples for org.omg.CORBA.ValueBaseHolder

The following are top voted examples for showing how to use org.omg.CORBA.ValueBaseHolder. 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: javify   File: gnuAny.java   View source code 6 votes vote down vote up
/**
 * Extract the stored value type.
 *
 * @return the previously stored value type.
 *
 * @throws BAD_OPERATION if the Any contains something different.
 *
 * @see org.omg.CORBA.portable.ValueBase
 */
public Serializable extract_Value()
                           throws BAD_OPERATION
{
  try
    {
      if (has instanceof ValueBaseHolder)
        return ((ValueBaseHolder) has).value;
      else
        {
          // Normally, ValueBase holder must be an instance of the
          // ValueBaseHolder. However some IDL compilers probably
          // have a bug, do not deriving this way. The the only
          // way to access the wrapped value is via reflection.
          Field f = has.getClass().getField("value");
          return (Serializable) f.get(has);
        }
    }
  catch (Exception ex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("Value type expected");
      bad.minor = Minor.Any;
      bad.initCause(ex);
      throw bad;
    }
}
 
Example 2
Project: jvm-stm   File: gnuAny.java   View source code 6 votes vote down vote up
/**
 * Extract the stored value type.
 *
 * @return the previously stored value type.
 *
 * @throws BAD_OPERATION if the Any contains something different.
 *
 * @see org.omg.CORBA.portable.ValueBase
 */
public Serializable extract_Value()
                           throws BAD_OPERATION
{
  try
    {
      if (has instanceof ValueBaseHolder)
        return ((ValueBaseHolder) has).value;
      else
        {
          // Normally, ValueBase holder must be an instance of the
          // ValueBaseHolder. However some IDL compilers probably
          // have a bug, do not deriving this way. The the only
          // way to access the wrapped value is via reflection.
          Field f = has.getClass().getField("value");
          return (Serializable) f.get(has);
        }
    }
  catch (Exception ex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("Value type expected");
      bad.minor = Minor.Any;
      bad.initCause(ex);
      throw bad;
    }
}
 
Example 3
Project: JamVM-PH   File: gnuAny.java   View source code 6 votes vote down vote up
/**
 * Extract the stored value type.
 *
 * @return the previously stored value type.
 *
 * @throws BAD_OPERATION if the Any contains something different.
 *
 * @see org.omg.CORBA.portable.ValueBase
 */
public Serializable extract_Value()
                           throws BAD_OPERATION
{
  try
    {
      if (has instanceof ValueBaseHolder)
        return ((ValueBaseHolder) has).value;
      else
        {
          // Normally, ValueBase holder must be an instance of the
          // ValueBaseHolder. However some IDL compilers probably
          // have a bug, do not deriving this way. The the only
          // way to access the wrapped value is via reflection.
          Field f = has.getClass().getField("value");
          return (Serializable) f.get(has);
        }
    }
  catch (Exception ex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("Value type expected");
      bad.minor = Minor.Any;
      bad.initCause(ex);
      throw bad;
    }
}
 
Example 4
Project: classpath   File: gnuAny.java   View source code 6 votes vote down vote up
/**
 * Extract the stored value type.
 *
 * @return the previously stored value type.
 *
 * @throws BAD_OPERATION if the Any contains something different.
 *
 * @see org.omg.CORBA.portable.ValueBase
 */
public Serializable extract_Value()
                           throws BAD_OPERATION
{
  try
    {
      if (has instanceof ValueBaseHolder)
        return ((ValueBaseHolder) has).value;
      else
        {
          // Normally, ValueBase holder must be an instance of the
          // ValueBaseHolder. However some IDL compilers probably
          // have a bug, do not deriving this way. The the only
          // way to access the wrapped value is via reflection.
          Field f = has.getClass().getField("value");
          return (Serializable) f.get(has);
        }
    }
  catch (Exception ex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("Value type expected");
      bad.minor = Minor.Any;
      bad.initCause(ex);
      throw bad;
    }
}
 
Example 5
Project: javify   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public Serializable get_val() throws TypeMismatch
{
  try
    {
      return ((ValueBaseHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
Example 6
Project: javify   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((ValueBaseHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
Example 7
Project: jvm-stm   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public Serializable get_val() throws TypeMismatch
{
  try
    {
      return ((ValueBaseHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
Example 8
Project: jvm-stm   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((ValueBaseHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
Example 9
Project: JamVM-PH   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public Serializable get_val() throws TypeMismatch
{
  try
    {
      return ((ValueBaseHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
Example 10
Project: JamVM-PH   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((ValueBaseHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}
 
Example 11
Project: classpath   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public Serializable get_val() throws TypeMismatch
{
  try
    {
      return ((ValueBaseHolder) holder).value;
    }
  catch (ClassCastException cex)
    {
      TypeMismatch m = new TypeMismatch();
      m.initCause(cex);
      throw m;
    }
}
 
Example 12
Project: classpath   File: gnuDynAny.java   View source code 5 votes vote down vote up
/** {@inheritDoc} */
public void insert_val(Serializable a_x) throws InvalidValue, TypeMismatch
{
  try
    {
      ((ValueBaseHolder) holder).value = a_x;
      valueChanged();
    }
  catch (ClassCastException cex)
    {
      TypeMismatch t = new TypeMismatch();
      t.initCause(cex);
      throw t;
    }
}