RTI Connext CORBA Compatibility Kit  Version 6.0.0
 All Groups Pages
MessageHelper.java

[$(NDDSHOME)/example/JAVA/corba/MessageHelper.java]

public abstract class MessageHelper
{
private volatile static org.omg.CORBA.TypeCode _type;
public static org.omg.CORBA.TypeCode type ()
{
if (_type == null)
{
synchronized(MessageHelper.class)
{
if (_type == null)
{
_type = org.omg.CORBA.ORB.init().create_struct_tc(MessageHelper.id(),"Message",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("time", org.omg.CORBA.ORB.init().create_struct_tc(DateTimeHelper.id(),"DateTime",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("year", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null),new org.omg.CORBA.StructMember("month", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null),new org.omg.CORBA.StructMember("day", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null),new org.omg.CORBA.StructMember("hour", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null),new org.omg.CORBA.StructMember("minute", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null),new org.omg.CORBA.StructMember("second", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)), null)}), null),new org.omg.CORBA.StructMember("msg", org.omg.CORBA.ORB.init().create_string_tc(255), null)});
}
}
}
return _type;
}
public static void insert (final org.omg.CORBA.Any any, final Message s)
{
any.type(type());
write( any.create_output_stream(),s);
}
public static Message extract (final org.omg.CORBA.Any any)
{
org.omg.CORBA.portable.InputStream in = any.create_input_stream();
try
{
return read (in);
}
finally
{
try
{
in.close();
}
catch (java.io.IOException e)
{
throw new RuntimeException("Unexpected exception " + e.toString() );
}
}
}
public static String id()
{
return "IDL:Message:1.0";
}
public static Message read (final org.omg.CORBA.portable.InputStream in)
{
Message result = new Message();
result.time=DateTimeHelper.read(in);
if( (result.msg=in.read_string()).length() > 255 ) throw new org.omg.CORBA.BAD_PARAM("String bounds violation for msg: only not greater than <255> length is allowed");
return result;
}
public static void write (final org.omg.CORBA.portable.OutputStream out, final Message s)
{
DateTimeHelper.write(out,s.time);
java.lang.String tmpResult0 = s.msg;
if( tmpResult0.length() > 255 ) { throw new org.omg.CORBA.BAD_PARAM( "String bounds violation for s.msg: only not greater than <255> length is allowed"); } else { out.write_string( tmpResult0 ); }
}
}

RTI Connext CORBA Compatibility Kit Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc