private Codec getCodec(ORB orb)
{
if (codec == null) {
synchronized (this) {
CodecFactory codecFactory = null;
try {
codecFactory = CodecFactoryHelper.narrow(
orb.resolve_initial_references("CodecFactory"));
} catch (org.omg.CORBA.ORBPackage.InvalidName e) {
System.out.println("Getting org.omg.CORBA.ORBPackage.InvalidName exception");
}
Encoding encoding = new Encoding((short)0, (byte)1, (byte)2);
try {
codec = codecFactory.create_codec(encoding);
} catch (org.omg.IOP.CodecFactoryPackage.UnknownEncoding e) {
System.out.println("Getting org.omg.IOP.CodecFactoryPackage.UnknownEncoding exception");
}
}
}