org.omg.IOP.Encoding.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中org.omg.IOP.Encoding.<init>()方法的一些代码示例,展示了Encoding.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Encoding.<init>()方法的具体详情如下:
包路径:org.omg.IOP.Encoding
类名称:Encoding
方法名:<init>

Encoding.<init>介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

public void post_init(ORBInitInfo info) {
    try {
      // Use CDR encapsulation with GIOP 1.0 encoding
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);
      info.add_ior_interceptor(new TxIORInterceptor(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
  public void post_init(ORBInitInfo info) {
    try {
      // use CDR encapsulation with GIOP 1.0 encoding.
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);

      // add IOR interceptor for CSIv2.
        info.add_ior_interceptor(new CSIv2IORInterceptor(codec));

      // register CSIv2-related policy factories.
      info.register_policy_factory(CSIv2Policy.TYPE, new CSIv2PolicyFactory(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

public void post_init(ORBInitInfo info) {
  try {
    // Use CDR encapsulation with GIOP 1.0 encoding
    Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
        (byte) 1, /* GIOP version */
        (byte) 0  /* GIOP revision*/);
    Codec codec = info.codec_factory().create_codec(encoding);
    // Get a reference to the PICurrent
    org.omg.CORBA.Object obj =
        info.resolve_initial_references("PICurrent");
    org.omg.PortableInterceptor.Current piCurrent =
        org.omg.PortableInterceptor.CurrentHelper.narrow(obj);
    // Initialize the fields slot id, codec, and piCurrent
    // in the interceptor class
    TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent);
    // Create and register interceptor
    TxServerInterceptor interceptor = new TxServerInterceptor();
    info.add_server_request_interceptor(interceptor);
  } catch (Exception e) {
    throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
  public void post_init(ORBInitInfo info) {
    try {
      org.omg.CORBA.Object obj;

      // Use CDR encapsulations with GIOP 1.0 encoding.
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);

      // Create and register client interceptor.
      obj = info.resolve_initial_references("SASCurrent");
      SASCurrentImpl sasCurrentImpl = (SASCurrentImpl) obj;
      SASClientInterceptor clientInterceptor = new SASClientInterceptor(codec);
      info.add_client_request_interceptor(clientInterceptor);

      // Create and register server interceptor.
      SASTargetInterceptor serverInterceptor = new SASTargetInterceptor(codec);
      info.add_server_request_interceptor(serverInterceptor);

      // Initialize the SASCurrent implementation.
      sasCurrentImpl.init(serverInterceptor);
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

@Override
  public void post_init(ORBInitInfo info) {
    try {
      org.omg.CORBA.Object obj;

      // Use CDR encapsulations with GIOP 1.0 encoding.
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);

      // Create and register client interceptor.
      obj = info.resolve_initial_references("SASCurrent");
      SASCurrentImpl sasCurrentImpl = (SASCurrentImpl) obj;
      ElytronSASClientInterceptor clientInterceptor = new ElytronSASClientInterceptor(codec);
      info.add_client_request_interceptor(clientInterceptor);

      // Create and register server interceptor.
      SASTargetInterceptor serverInterceptor = new SASTargetInterceptor(codec);
      info.add_server_request_interceptor(serverInterceptor);

      // Initialize the SASCurrent implementation.
      sasCurrentImpl.init(serverInterceptor);
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: wildfly/wildfly

Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
    (byte) 1, /* GIOP version */
    (byte) 0  /* GIOP revision*/);

代码示例来源:origin: org.jacorb/jacorb-omgapi

public static org.omg.IOP.Encoding read (final org.omg.CORBA.portable.InputStream in)
{
  org.omg.IOP.Encoding result = new org.omg.IOP.Encoding();
  result.format=in.read_short();
  result.major_version=in.read_octet();
  result.minor_version=in.read_octet();
  return result;
}
public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.Encoding s)

代码示例来源:origin: org.apache.yoko/yoko-spec-corba

public static Encoding
read(org.omg.CORBA.portable.InputStream in)
{
  Encoding _ob_v = new Encoding();
  _ob_v.format = EncodingFormatHelper.read(in);
  _ob_v.major_version = in.read_octet();
  _ob_v.minor_version = in.read_octet();
  return _ob_v;
}

代码示例来源:origin: org.jboss.openjdk-orb/openjdk-orb

public static org.omg.IOP.Encoding read (org.omg.CORBA.portable.InputStream istream)
{
 org.omg.IOP.Encoding value = new org.omg.IOP.Encoding ();
 value.format = istream.read_short ();
 value.major_version = istream.read_octet ();
 value.minor_version = istream.read_octet ();
 return value;
}

代码示例来源:origin: JacORB/JacORB

public static org.omg.IOP.Encoding read (final org.omg.CORBA.portable.InputStream in)
{
  org.omg.IOP.Encoding result = new org.omg.IOP.Encoding();
  result.format=in.read_short();
  result.major_version=in.read_octet();
  result.minor_version=in.read_octet();
  return result;
}
public static void write (final org.omg.CORBA.portable.OutputStream out, final org.omg.IOP.Encoding s)

代码示例来源:origin: org.apache.yoko/yoko-rmi-impl

public void pre_init(ORBInitInfo info) {
  Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte)1,(byte) 0);
  CodecFactory codecFactory = info.codec_factory();
  try {
    Codec codec = codecFactory.create_codec(encoding);
    RMIInterceptor rmiInterceptor = new RMIInterceptor(codec);
    info.add_ior_interceptor(rmiInterceptor);
  } catch (UserException e) {
    logger.log(Level.FINER, "cannot register RMI Interceptor" + e.getMessage(), e);
  }
}

代码示例来源:origin: org.jacorb/jacorb

public SASComponentInterceptor(ORBInitInfo info)
{
  super();
  orb = ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl)info).getORB();
  config = orb.getConfiguration();
  logger = config.getLogger("org.jacorb.SAS.IOR");
  try
  {
    Encoding encoding =
      new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 0);
    CodecFactory codec_factory =
      (CodecFactory)orb.resolve_initial_references("CodecFactory");
    codec = codec_factory.create_codec(encoding);
  }
  catch (Exception e)
  {
    logger.error("Error initing SASComponentInterceptor: ",e);
  }
  sasContext = newSasContext();
  if (sasContext == null && logger.isErrorEnabled())
  {
    logger.error("Could not load SAS context class: "+ config.getAttribute("jacorb.security.sas.contextClass", ""));
  }
}

代码示例来源:origin: org.jacorb/jacorb

public SASClientInterceptor(ORBInitInfo info)
  throws UnknownEncoding, ConfigurationException
{
  name = DEFAULT_NAME;
  Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 0);
  codec = info.codec_factory().create_codec(encoding);
  org.jacorb.orb.ORB orb =
    ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl)info).getORB ();
  configure( orb.getConfiguration());
}

代码示例来源:origin: org.jboss.eap/wildfly-iiop-openjdk

public void post_init(ORBInitInfo info) {
    try {
      // Use CDR encapsulation with GIOP 1.0 encoding
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);
      info.add_ior_interceptor(new TxIORInterceptor(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: org.wildfly/wildfly-iiop-openjdk

public void post_init(ORBInitInfo info) {
    try {
      // Use CDR encapsulation with GIOP 1.0 encoding
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);
      info.add_ior_interceptor(new TxIORInterceptor(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: org.jacorb/jacorb

public SASTargetInterceptor(ORBInitInfo info)
  throws UnknownEncoding, ConfigurationException
{
  sasReplySlotID = info.allocate_slot_id();
  sasContextsCubby = org.jacorb.orb.giop.GIOPConnection.allocate_cubby_id();
  Encoding encoding =
    new Encoding(ENCODING_CDR_ENCAPS.value, (byte) 1, (byte) 0);
  codec =
    info.codec_factory().create_codec(encoding);
  orb = ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl)info).getORB ();
  configure( orb.getConfiguration());
}

代码示例来源:origin: org.wildfly/wildfly-iiop-openjdk

@Override
  public void post_init(ORBInitInfo info) {
    try {
      // use CDR encapsulation with GIOP 1.0 encoding.
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);

      // add IOR interceptor for CSIv2.
        info.add_ior_interceptor(new CSIv2IORInterceptor(codec));

      // register CSIv2-related policy factories.
      info.register_policy_factory(CSIv2Policy.TYPE, new CSIv2PolicyFactory(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-iiop-openjdk

@Override
  public void post_init(ORBInitInfo info) {
    try {
      // use CDR encapsulation with GIOP 1.0 encoding.
      Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
          (byte) 1, /* GIOP version */
          (byte) 0  /* GIOP revision*/);
      Codec codec = info.codec_factory().create_codec(encoding);

      // add IOR interceptor for CSIv2.
        info.add_ior_interceptor(new CSIv2IORInterceptor(codec));

      // register CSIv2-related policy factories.
      info.register_policy_factory(CSIv2Policy.TYPE, new CSIv2PolicyFactory(codec));
    } catch (Exception e) {
      throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
    }
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-iiop-openjdk

public void post_init(ORBInitInfo info) {
  try {
    // Use CDR encapsulation with GIOP 1.0 encoding
    Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
        (byte) 1, /* GIOP version */
        (byte) 0  /* GIOP revision*/);
    Codec codec = info.codec_factory().create_codec(encoding);
    // Get a reference to the PICurrent
    org.omg.CORBA.Object obj =
        info.resolve_initial_references("PICurrent");
    org.omg.PortableInterceptor.Current piCurrent =
        org.omg.PortableInterceptor.CurrentHelper.narrow(obj);
    // Initialize the fields slot id, codec, and piCurrent
    // in the interceptor class
    TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent);
    // Create and register interceptor
    TxServerInterceptor interceptor = new TxServerInterceptor();
    info.add_server_request_interceptor(interceptor);
  } catch (Exception e) {
    throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
  }
}

代码示例来源:origin: org.wildfly/wildfly-iiop-openjdk

public void post_init(ORBInitInfo info) {
  try {
    // Use CDR encapsulation with GIOP 1.0 encoding
    Encoding encoding = new Encoding(ENCODING_CDR_ENCAPS.value,
        (byte) 1, /* GIOP version */
        (byte) 0  /* GIOP revision*/);
    Codec codec = info.codec_factory().create_codec(encoding);
    // Get a reference to the PICurrent
    org.omg.CORBA.Object obj =
        info.resolve_initial_references("PICurrent");
    org.omg.PortableInterceptor.Current piCurrent =
        org.omg.PortableInterceptor.CurrentHelper.narrow(obj);
    // Initialize the fields slot id, codec, and piCurrent
    // in the interceptor class
    TxServerInterceptor.init(info.allocate_slot_id(), codec, piCurrent);
    // Create and register interceptor
    TxServerInterceptor interceptor = new TxServerInterceptor();
    info.add_server_request_interceptor(interceptor);
  } catch (Exception e) {
    throw IIOPLogger.ROOT_LOGGER.unexpectedException(e);
  }
}

相关文章

Encoding类方法