• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java Unexpected类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中gnu.CORBA.Unexpected的典型用法代码示例。如果您正苦于以下问题:Java Unexpected类的具体用法?Java Unexpected怎么用?Java Unexpected使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

Unexpected类属于gnu.CORBA包,在下文中一共展示了Unexpected类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: gnuDynSequence

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Create a new gnuDynSequence with the given typecode.
 *
 * @throws BAD_PARAM if the passed typecode is probably not a sequence
 * typecode.
 */
public gnuDynSequence(TypeCode oType, TypeCode aType,
                      gnuDynAnyFactory aFactory, ORB anOrb
                     )
               throws BAD_PARAM
{
  super(oType, aType, aFactory, anOrb, false);
  array = new DynAny[ 0 ];
  try
    {
      bound = final_type.length();
    }
  catch (BadKind ex)
    {
      throw new Unexpected(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:23,
代码来源:gnuDynSequence.java

示例2: gnu_get_members_as_dyn_any

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Get content of the structure. This method must be defined on a different
 * name because get_members_as_dyn_any() throws exception only in some of the
 * supported interfaces.
 */
public NameDynAnyPair[] gnu_get_members_as_dyn_any()
{
  NameDynAnyPair[] r = new NameDynAnyPair[ array.length ];
  for (int i = 0; i < r.length; i++)
    {
      try
        {
          r [ i ] = new NameDynAnyPair(fNames [ i ], array [ i ]);
        }
      catch (Exception ex)
        {
          throw new Unexpected(ex);
        }
    }
  return r;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:22,
代码来源:RecordAny.java

示例3: gnu_get_members

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Get content of the structure. This method must be defined on a different
 * name because get_members_as_dyn_any() throws exception only in some of the
 * supported interfaces.
 */
public NameValuePair[] gnu_get_members()
{
  NameValuePair[] r = new NameValuePair[ array.length ];
  for (int i = 0; i < r.length; i++)
    {
      try
        {
          r [ i ] = new NameValuePair(fNames [ i ], array [ i ].to_any());
        }
      catch (Exception ex)
        {
          throw new Unexpected(ex);
        }
    }
  return r;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:22,
代码来源:RecordAny.java

示例4: gnuDynStruct

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Create an instance.
 */
public gnuDynStruct(TypeCode oType, TypeCode aType,
                    gnuDynAnyFactory aFactory, ORB anOrb)
{
  super(oType, aType, aFactory, anOrb);

  // Initialise fields.
  try
    {
      array = new DynAny[ final_type.member_count() ];
      fNames = new String[ array.length ];
      for (int i = 0; i < array.length; i++)
        {
          array [ i ] =
            factory.create_dyn_any_from_type_code(final_type.member_type(i));
          fNames [ i ] = final_type.member_name(i);
        }
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:26,
代码来源:gnuDynStruct.java

示例5: create_dyn_any

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Create the DynAny using the passed value as template and assign this value.
 */
public DynAny create_dyn_any(Any value)
                      throws InconsistentTypeCode
{
  DynAny created = create_dyn_any_from_type_code(value.type());
  try
    {
      created.from_any(value);
    }
  catch (UserException uex)
    {
      InconsistentTypeCode t = new InconsistentTypeCode("Inconsistent Any");
      t.initCause(uex);
      throw t;
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
  return created;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:24,
代码来源:gnuDynAnyFactory.java

示例6: from_any

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Set value from any that must contain enumeration.
 */
public void from_any(Any an_any) throws TypeMismatch, InvalidValue
{
  checkType(official_type, an_any.type());
  try
    {
      InputStream in = an_any.create_input_stream();
      set_as_ulong(in.read_long());
      in.close();
    }
  catch (MARSHAL eof)
    {
      throw new InvalidValue();
    }
  catch (IOException ex)
    {
      throw new Unexpected(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:22,
代码来源:gnuDynEnum.java

示例7: gnuDynValueBox

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Create a new instance of gnuDynValueBox.
 */
public gnuDynValueBox(TypeCode oType, TypeCode aType,
                      gnuDynAnyFactory aFactory, ORB anOrb
                     )
{
  super(oType, aType, aFactory, anOrb);
  try
    {
      content = final_type.content_type();
      array = new DynAny[] { factory.create_dyn_any_from_type_code(content) };
      set_to_null();
    }
  catch (Exception e)
    {
      throw new Unexpected(e);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:20,
代码来源:gnuDynValueBox.java

示例8: copy

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/** @inheritDoc */
public DynAny copy()
{
  gnuDynValueBox other =
    new gnuDynValueBox(official_type, final_type, factory, orb);
  if (is_null())
    other.set_to_null();
  else
    {
      try
        {
          other.array = new DynAny[] { array [ 0 ].copy() };
        }
      catch (Exception e)
        {
          throw new Unexpected(e);
        }
    }
  return other;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:21,
代码来源:gnuDynValueBox.java

示例9: set_to_value

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/** @inheritDoc */
public void set_to_value()
{
  try
    {
      if (array.length == 0)
        {
          array =
            new DynAny[] { factory.create_dyn_any_from_type_code(content) };
        }
    }
  catch (InconsistentTypeCode e)
    {
      throw new Unexpected(e);
    }
  valueChanged();
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:18,
代码来源:gnuDynValueBox.java

示例10: copy

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/** @inheritDoc */
public DynAny copy()
{
  try
    {
      gnuDynUnion other =
        new gnuDynUnion(official_type, final_type, factory, orb);
      other.discriminator = discriminator.copy();
      ((AbstractAny) other.discriminator).listener = other;
      if (array.length == 1)
        {
          other.array = new DynAny[] { other.discriminator };
        }
      else
        {
          other.array =
            new DynAny[] { other.discriminator, array [ 1 ].copy() };
        }
      return other;
    }
  catch (InconsistentTypeCode ex)
    {
      throw new Unexpected(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:26,
代码来源:gnuDynUnion.java

示例11: write_char

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the lower byte of the passed parameter.
 * @param x the char to write
 *
 * It is effective to write more characters at once.
 */
public void write_char(char x)
{
  try
    {
      if (narrow_native)
        b.write(x);
      else
        {
          OutputStreamWriter ow =
            new OutputStreamWriter((OutputStream) b, narrow_charset);
          ow.write(x);
          ow.flush();
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:26,
代码来源:AbstractCdrOutput.java

示例12: write_char_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the lower bytes of the passed array members.
 *
 * @param chars an array
 * @param offset offset
 * @param length length
 */
public void write_char_array(char[] chars, int offset, int length)
{
  try
    {
      if (narrow_native)
        {
          for (int i = offset; i < offset + length; i++)
            {
              b.write(chars [ i ]);
            }
        }
      else
        {
          OutputStreamWriter ow =
            new OutputStreamWriter((OutputStream) b, narrow_charset);
          ow.write(chars, offset, length);
          ow.flush();
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:32,
代码来源:AbstractCdrOutput.java

示例13: write_double_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the array of double values.
 */
public void write_double_array(double[] x, int ofs, int len)
{
  try
    {
      align(8);
      for (int i = ofs; i < ofs + len; i++)
        {
          b.writeDouble(x [ i ]);
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:19,
代码来源:AbstractCdrOutput.java

示例14: write_float_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 *  Writes an array of the float values.
 */
public void write_float_array(float[] x, int ofs, int len)
{
  try
    {
      align(4);
      for (int i = ofs; i < ofs + len; i++)
        {
          b.writeFloat(x [ i ]);
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:19,
代码来源:AbstractCdrOutput.java

示例15: write_long_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the array of integer (CORBA long) values.
 *
 * @param x value
 * @param ofs offset
 * @param len length
 */
public void write_long_array(int[] x, int ofs, int len)
{
  try
    {
      align(4);
      for (int i = ofs; i < ofs + len; i++)
        {
          b.writeInt(x [ i ]);
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:23,
代码来源:AbstractCdrOutput.java

示例16: write_longlong_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the array of longs (CORBA long longs) values.
 *
 * @param x value
 * @param ofs offset
 * @param len length
 */
public void write_longlong_array(long[] x, int ofs, int len)
{
  try
    {
      align(8);
      for (int i = ofs; i < ofs + len; i++)
        {
          b.writeLong(x [ i ]);
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:23,
代码来源:AbstractCdrOutput.java

示例17: write_short_array

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the array of short (two byte integer) values.
 *
 * @param x value
 * @param ofs offset
 * @param len length
 */
public void write_short_array(short[] x, int ofs, int len)
{
  try
    {
      align(2);
      for (int i = ofs; i < ofs + len; i++)
        {
          b.writeShort(x [ i ]);
        }
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:23,
代码来源:AbstractCdrOutput.java

示例18: write_string

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/**
 * Writes the string. This implementation first calls
 * String.getBytes() and then writes the length of the returned
 * array (as CORBA ulong) and the returned array itself.
 *
 * The encoding information, if previously set, is taken
 * into consideration.
 *
 * @param x the string to write.
 */
public void write_string(String x)
{
  try
    {
      byte[] ab = x.getBytes(narrow_charset);
      write_long(ab.length + 1);
      write(ab);

      // write null terminator.
      write(0);
    }
  catch (IOException ex)
    {
      Unexpected.error(ex);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:27,
代码来源:AbstractCdrOutput.java

示例19: received_exception_id

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/** @inheritDoc */
public String received_exception_id()
{
  try
    {
      if (m_wrapped_exception != null)
        {
          return m_wrapped_exception.type().id();
        }
      else
        {
          return request.received_exception_id();
        }
    }
  catch (BadKind e)
    {
      throw new Unexpected(e);
    }
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:20,
代码来源:gnuClientRequestInfo.java

示例20: exceptions

点赞 3

import gnu.CORBA.Unexpected; //导入依赖的package包/类
/** @inheritDoc */
public TypeCode[] exceptions()
{
  request.checkDii();

  ExceptionList ex = request.exceptions();
  TypeCode[] et = new TypeCode[ ex.count() ];
  try
    {
      for (int i = 0; i < et.length; i++)
        {
          et [ i ] = ex.item(i);
        }
    }
  catch (Bounds e)
    {
      throw new Unexpected(e);
    }
  return et;
}
 

开发者ID:vilie,
项目名称:javify,
代码行数:21,
代码来源:gnuClientRequestInfo.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)