Java Code Examples for gnu.CORBA.Minor

The following are top voted examples for showing how to use gnu.CORBA.Minor. 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: ErrorMessage.java   View source code 6 votes vote down vote up
/**
 * Send the error message to the given IOR address.
 *
 * @param ior the IOR address (host and port, other fields
 * are not used).
 *
 * @param orb the ORB, sending the error message.
 */
public void send(IOR ior, ORB orb)
{
  try
    {
      Socket socket;

      if (orb instanceof OrbFunctional)
        socket = ((OrbFunctional) orb).socketFactory.createClientSocket(
          ior.Internet.host, ior.Internet.port);
      else
        socket = new Socket(ior.Internet.host, ior.Internet.port);

      OutputStream socketOutput = socket.getOutputStream();
      write(socketOutput);
      socketOutput.close();
      socket.close();
    }
  catch (IOException ex)
    {
      MARSHAL t = new MARSHAL();
      t.minor = Minor.Header;
      t.initCause(ex);
      throw t;
    }
}
 
Example 2
Project: javify   File: UnknownEncodingHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the UnknownEncoding from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain UnknownEncoding.
 */
public static UnknownEncoding extract(Any any)
{
  try
    {
      EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable();
      return (UnknownEncoding) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("UnknownEncoding expected");
      bad.initCause(cex);
      bad.minor = Minor.Any;
      throw bad;
    }
}
 
Example 3
Project: javify   File: InvalidTypeForEncodingHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the InvalidTypeForEncoding from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain
 * InvalidTypeForEncoding.
 */
public static InvalidTypeForEncoding extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (InvalidTypeForEncoding) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad =
        new BAD_OPERATION("InvalidTypeForEncoding expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 4
Project: javify   File: TypeMismatchHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the TypeMismatch from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain TypeMismatch.
 */
public static TypeMismatch extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (TypeMismatch) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("TypeMismatch expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 5
Project: javify   File: FormatMismatchHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the FormatMismatch from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain FormatMismatch.
 */
public static FormatMismatch extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (FormatMismatch) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("FormatMismatch expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 6
Project: javify   File: AbstractCdrInput.java   View source code 6 votes vote down vote up
/**
 * Read a single byte directly from the buffer.
 */
public int read()
  throws java.io.IOException
{
  try
    {
      return b.read();
    }
  catch (EOFException ex)
    {
      MARSHAL t = new MARSHAL(UNEXP_EOF);
      t.minor = Minor.EOF;
      t.initCause(ex);
      throw t;
    }
}
 
Example 7
Project: javify   File: InvalidValueHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the InvalidValue from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain InvalidValue.
 */
public static InvalidValue extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (InvalidValue) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("InvalidValue expected");
      bad.initCause(cex);
      bad.minor = Minor.Any;
      throw bad;
    }
}
 
Example 8
Project: javify   File: TypeMismatchHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the TypeMismatch from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain TypeMismatch.
 */
public static TypeMismatch extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (TypeMismatch) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("TypeMismatch expected");
      bad.initCause(cex);
      bad.minor = Minor.Any;
      throw bad;
    }
}
 
Example 9
Project: javify   File: InconsistentTypeCodeHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the InconsistentTypeCode from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain
 * InconsistentTypeCode.
 */
public static InconsistentTypeCode extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (InconsistentTypeCode) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("InconsistentTypeCode expected");
      bad.initCause(cex);
      bad.minor = Minor.Any;
      throw bad;
    }
}
 
Example 10
Project: javify   File: StructMemberHelper.java   View source code 6 votes vote down vote up
/**
 * Read the StructMember from the input stream.
 */
public static StructMember read(InputStream istream)
{
  try
    {
      StructMember value = new StructMember();
      value.name = istream.read_string();
      value.type = TypeCodeHelper.read(istream);
      value.type_def = IDLTypeHelper.read(istream);
      return value;
    }
  catch (UserException ex)
    {
      MARSHAL m = new MARSHAL();
      m.minor = Minor.UserException;
      m.initCause(ex);
      throw m;
    }
}
 
Example 11
Project: javify   File: StructMemberHelper.java   View source code 6 votes vote down vote up
/**
 * Write the StructMember to the input stream.
 */
public static void write(OutputStream ostream, StructMember value)
{
  try
    {
      ostream.write_string(value.name);
      TypeCodeHelper.write(ostream, value.type);
      IDLTypeHelper.write(ostream, value.type_def);
    }
  catch (UserException ex)
    {
      MARSHAL m = new MARSHAL();
      m.minor = Minor.UserException;
      m.initCause(ex);
      throw m;
    }
}
 
Example 12
Project: javify   File: UnionMemberHelper.java   View source code 6 votes vote down vote up
/**
 * Write the union member to the given stream.
 */
public static void write(OutputStream ostream, UnionMember value)
{
  try
    {
      ostream.write_string(value.name);
      ostream.write_any(value.label);
      TypeCodeHelper.write(ostream, value.type);
      IDLTypeHelper.write(ostream, value.type_def);
    }
  catch (UserException ex)
    {
      MARSHAL m = new MARSHAL();
      m.minor = Minor.UserException;
      m.initCause(ex);
      throw m;
    }
}
 
Example 13
Project: javify   File: ValueMemberHelper.java   View source code 6 votes vote down vote up
/**
 * Reads the value member from the given stream.
 */
public static ValueMember read(InputStream istream)
{
  try
    {
      ValueMember value = new ValueMember();
      value.name = istream.read_string();
      value.id = istream.read_string();
      value.defined_in = istream.read_string();
      value.version = istream.read_string();
      value.type = TypeCodeHelper.read(istream);
      value.type_def = IDLTypeHelper.read(istream);
      value.access = istream.read_short();
      return value;
    }
  catch (UserException ex)
    {
      MARSHAL m = new MARSHAL();
      m.minor = Minor.UserException;
      m.initCause(ex);
      throw m;
    }
}
 
Example 14
Project: javify   File: ValueMemberHelper.java   View source code 6 votes vote down vote up
/**
 * Writes the value member to the given stream.
 */
public static void write(OutputStream ostream, ValueMember value)
{
  try
    {
      ostream.write_string(value.name);
      ostream.write_string(value.id);
      ostream.write_string(value.defined_in);
      ostream.write_string(value.version);
      TypeCodeHelper.write(ostream, value.type);
      IDLTypeHelper.write(ostream, value.type_def);
      ostream.write_short(value.access);
    }
  catch (UserException ex)
    {
      MARSHAL m = new MARSHAL();
      m.minor = Minor.UserException;
      m.initCause(ex);
      throw m;
    }
}
 
Example 15
Project: javify   File: NoContextHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the NoContext from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain NoContext.
 */
public static NoContext extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (NoContext) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("NoContext expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 16
Project: javify   File: AbstractCdrOutput.java   View source code 6 votes vote down vote up
/**
 * Writes first the size of array, and then the byte array using
 * the {@link java.io.OutputStream#write(byte[]) }. The sequence
 * being written is preceeded by the int, representing the array
 * length.
 */
public void write_sequence(byte[] buf)
{
  try
    {
      write_long(buf.length);
      write(buf);
    }
  catch (IOException ex)
    {
      MARSHAL t = new MARSHAL();
      t.minor = Minor.CDR;
      t.initCause(ex);
      throw t;
    }
}
 
Example 17
Project: javify   File: AdapterAlreadyExistsHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the AdapterAlreadyExists from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain AdapterAlreadyExists.
 */
public static AdapterAlreadyExists extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (AdapterAlreadyExists) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("AdapterAlreadyExists expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 18
Project: javify   File: AdapterNonExistentHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the AdapterNonExistent from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain AdapterNonExistent.
 */
public static AdapterNonExistent extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (AdapterNonExistent) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("AdapterNonExistent expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 19
Project: javify   File: ServantNotActiveHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the ServantNotActive from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain ServantNotActive.
 */
public static ServantNotActive extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (ServantNotActive) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("ServantNotActive expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 20
Project: javify   File: ServantAlreadyActiveHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the ServantAlreadyActive from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain ServantAlreadyActive.
 */
public static ServantAlreadyActive extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (ServantAlreadyActive) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("ServantAlreadyActive expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 21
Project: javify   File: WrongPolicyHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the WrongPolicy from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain WrongPolicy.
 */
public static WrongPolicy extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (WrongPolicy) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("WrongPolicy expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 22
Project: javify   File: NoServantHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the NoServant from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain NoServant.
 */
public static NoServant extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (NoServant) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("NoServant expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 23
Project: javify   File: ObjectAlreadyActiveHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the ObjectAlreadyActive from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain ObjectAlreadyActive.
 */
public static ObjectAlreadyActive extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (ObjectAlreadyActive) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("ObjectAlreadyActive expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 24
Project: javify   File: ObjectNotActiveHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the ObjectNotActive from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain ObjectNotActive.
 */
public static ObjectNotActive extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (ObjectNotActive) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("ObjectNotActive expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 25
Project: javify   File: WrongAdapterHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the WrongAdapter from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain WrongAdapter.
 */
public static WrongAdapter extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (WrongAdapter) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("WrongAdapter expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 26
Project: javify   File: HeadlessInput.java   View source code 6 votes vote down vote up
/**
 * Try to read when having an unitialised value.
 */
public Serializable read_value(Class clz)
{
  if (subsequentCalls)
    return stream.read_value(clz);
  else
    {
      try
        {
          subsequentCalls = true;
          Serializable value = (Serializable) Vio.instantiateAnyWay(clz);
          value = Vio.readValue(this, NONE, value, null, null,
            null, null);
          return value;
        }
      catch (Exception ex)
        {
          MARSHAL m = new MARSHAL("Can't read an instance of "
            + clz.getName());
          m.minor = Minor.Value;
          m.initCause(ex);
          throw m;
        }
    }
}
 
Example 27
Project: javify   File: gnuRuntime.java   View source code 6 votes vote down vote up
/**
 * Get the object, written at the given position. This returs both shared
 * objects and repository Ids.
 *
 * @return the position, at that the object is allready written.
 *
 * @throws MARSHAL if there is no object written at that position.
 */
public Object isObjectWrittenAt(int x, int offset)
{
  Entry e = (Entry) positions.get(new Integer(x));
  if (e instanceof Redirection)
    return isObjectWrittenAt(e.at, offset);
  else if (e != null)
    return e.object;
  else
    {
      MARSHAL m = new MARSHAL("No object was written at " + x +
        " (offset " + offset + ") r " + this + dump());
      m.minor = Minor.Graph;
      throw m;
    }
}
 
Example 28
Project: javify   File: CloseMessage.java   View source code 6 votes vote down vote up
/**
 * Send the close message to the given output stream. The method,
 * however, does not close the socket itself, this must be done
 * explicitly in the calling code.
 *
 * @param socketStream a stream, where the close message is
 * written.
 */
public static void close(OutputStream socketStream)
{
  try
    {
      Singleton.write(socketStream);
      socketStream.flush();
    }
  catch (IOException ex)
    {
      MARSHAL m = new MARSHAL("Unable to flush the stream");
      m.minor = Minor.Header;
      m.initCause(ex);
      throw m;
    }
}
 
Example 29
Project: javify   File: InvalidSlotHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the InvalidSlot from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain InvalidSlot.
 */
public static InvalidSlot extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (InvalidSlot) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("InvalidSlot expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 30
Project: javify   File: AbstractCdrInput.java   View source code 6 votes vote down vote up
/**
 * Read bytes directly from the buffer.
 */
public int read(byte[] x, int ofs, int len)
  throws java.io.IOException
{
  try
    {
      return b.read(x, ofs, len);
    }
  catch (EOFException ex)
    {
      MARSHAL t = new MARSHAL(UNEXP_EOF);
      t.minor = Minor.EOF;
      t.initCause(ex);
      throw t;
    }
}
 
Example 31
Project: javify   File: ObjectReferenceTemplateHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the ObjectReferenceTemplate from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not
 * contain ObjectReferenceTemplate.
 */
public static ObjectReferenceTemplate extract(Any any)
{
  try
    {
      ObjectReferenceTemplateHolder h =
        (ObjectReferenceTemplateHolder) any.extract_Streamable();
      return h.value;
    }
  catch (ClassCastException ex)
    {
      BAD_OPERATION bad =
        new BAD_OPERATION("ObjectReferenceTemplate expected");
      bad.minor = Minor.Any;
      bad.initCause(ex);
      throw bad;
    }
}
 
Example 32
Project: javify   File: ObjectReferenceTemplateSeqHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the <code>ObjectReferenceTemplate[]</code> from the given
 * {@link Any}. This implementation expects the {@link Any} to hold the
 * instance of {@link ObjectReferenceTemplateSeqHolder} that is returned by
 * {@link Any#extract_Streamable() }.
 *
 * @param a an Any to extract the array from.
 *
 * @return the extracted array.
 *
 * @throws BAD_OPERATION if the Any contains something other than the the
 * {@link ObjectReferenceTemplateSeqHolder}.
 */
public static ObjectReferenceTemplate[] extract(Any a)
{
  try
    {
      ObjectReferenceTemplateSeqHolder h = (ObjectReferenceTemplateSeqHolder)
        a.extract_Streamable();
      return h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION(
        "ObjectReferenceTemplate[] expected");
      bad.initCause(cex);
      bad.minor = Minor.Any;
      throw bad;
    }
}
 
Example 33
Project: javify   File: IORInterceptor_3_0Helper.java   View source code 6 votes vote down vote up
/**
 * Extract the IORInterceptor_3_0 from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain
 * IORInterceptor_3_0.
 */
public static IORInterceptor_3_0 extract(Any any)
{
  try
    {
      IORInterceptor_3_0Holder holder = (IORInterceptor_3_0Holder)
        any.extract_Streamable();
      return holder.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("IORInterceptor_3_0 expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 34
Project: javify   File: InvalidNameHelper.java   View source code 6 votes vote down vote up
/**
 * Extract the InvalidName from given Any.
 *
 * @throws BAD_OPERATION if the passed Any does not contain InvalidName.
 */
public static InvalidName extract(Any any)
{
  try
    {
      EmptyExceptionHolder h =
        (EmptyExceptionHolder) any.extract_Streamable();
      return (InvalidName) h.value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("InvalidName expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 35
Project: javify   File: CorbalocParser.java   View source code 6 votes vote down vote up
/**
 * Read IOR from the file in the local file system.
 */
String readFile(String file)
{
  File f = new File(file);
  if (!f.exists())
    {
      DATA_CONVERSION err = new DATA_CONVERSION(f.getAbsolutePath()
        + " does not exist.");
      err.minor = Minor.Missing_IOR;
    }
  try
    {
      char[] c = new char[(int) f.length()];
      FileReader fr = new FileReader(f);
      fr.read(c);
      fr.close();
      return new String(c).trim();
    }
  catch (IOException ex)
    {
      DATA_CONVERSION d = new DATA_CONVERSION();
      d.initCause(ex);
      d.minor = Minor.Missing_IOR;
      throw (d);
    }
}
 
Example 36
Project: javify   File: NameParser.java   View source code 6 votes vote down vote up
/**
 * Read IOR from the file in the local file system.
 */
String readFile(String file)
{
  File f = new File(file);
  if (!f.exists())
    {
      DATA_CONVERSION err = new DATA_CONVERSION(f.getAbsolutePath()
        + " does not exist.");
      err.minor = Minor.Missing_IOR;
    }
  try
    {
      char[] c = new char[(int) f.length()];
      FileReader fr = new FileReader(f);
      fr.read(c);
      fr.close();
      return new String(c).trim();
    }
  catch (IOException ex)
    {
      DATA_CONVERSION d = new DATA_CONVERSION();
      d.initCause(ex);
      d.minor = Minor.Missing_IOR;
      throw (d);
    }
}
 
Example 37
Project: javify   File: IORHelper.java   View source code 5 votes vote down vote up
/**
 * Extract the IOR from given Any.
 * This method uses the IORHolder.
 *
 * @throws BAD_OPERATION if the passed Any does not contain IOR.
 */
public static IOR extract(Any any)
{
  try
    {
      return ((IORHolder) any.extract_Streamable()).value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("IOR expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 38
Project: javify   File: MultipleComponentProfileHelper.java   View source code 5 votes vote down vote up
/**
 * Extract the MultipleComponentProfile from given Any.
 * This method uses the MultipleComponentProfileHolder.
 *
 * @throws BAD_OPERATION if the passed Any does not contain MultipleComponentProfile.
 */
public static TaggedComponent[] extract(Any any)
{
  try
    {
      return ((MultipleComponentProfileHolder) any.extract_Streamable()).value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("MultipleComponentProfile expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 39
Project: javify   File: ServiceContextHelper.java   View source code 5 votes vote down vote up
/**
 * Extract the ServiceContext from given Any.
 * This method uses the ServiceContextHolder.
 *
 * @throws BAD_OPERATION if the passed Any does not contain ServiceContext.
 */
public static ServiceContext extract(Any any)
{
  try
    {
      return ((ServiceContextHolder) any.extract_Streamable()).value;
    }
  catch (ClassCastException cex)
    {
      BAD_OPERATION bad = new BAD_OPERATION("ServiceContext expected");
      bad.minor = Minor.Any;
      bad.initCause(cex);
      throw bad;
    }
}
 
Example 40
Project: javify   File: TaggedProfileHelper.java   View source code 5 votes vote down vote up
/**
 * Write the structure to the CDR output stream.
 *
 * @param output a org.omg.CORBA.portable stream stream to write into.
 * @param value a value to write.
 */
public static void write(OutputStream output, TaggedProfile value)
{
  output.write_long(value.tag);

  if (output instanceof BufferedCdrOutput)
    {
      // Highly probable.
      output.write_long(value.profile_data.length);
      try
        {
          output.write(value.profile_data);
        }
      catch (IOException e)
        {
          MARSHAL m = new MARSHAL();
          m.minor = Minor.Encapsulation;
          m.initCause(e);
          throw m;
        }
    }
  else
    {
      output.write_long(value.profile_data.length);
      for (int i0 = 0; i0 < value.profile_data.length; i0++)
        output.write_octet(value.profile_data[i0]);
    }
}