本文整理汇总了Java中com.sun.corba.se.impl.protocol.giopmsgheaders.Message.CDR_ENC_VERSION属性的典型用法代码示例。如果您正苦于以下问题:Java Message.CDR_ENC_VERSION属性的具体用法?Java Message.CDR_ENC_VERSION怎么用?Java Message.CDR_ENC_VERSION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.sun.corba.se.impl.protocol.giopmsgheaders.Message
的用法示例。
在下文中一共展示了Message.CDR_ENC_VERSION属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newOutputStream
public static CDROutputStreamBase newOutputStream(
ORB orb, GIOPVersion version, byte encodingVersion) {
switch(version.intValue()) {
case GIOPVersion.VERSION_1_0:
return new CDROutputStream_1_0();
case GIOPVersion.VERSION_1_1:
return new CDROutputStream_1_1();
case GIOPVersion.VERSION_1_2:
if (encodingVersion != Message.CDR_ENC_VERSION) {
return
new IDLJavaSerializationOutputStream(encodingVersion);
}
return new CDROutputStream_1_2();
default:
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.RPC_ENCODING ) ;
// REVISIT - what is appropriate? INTERNAL exceptions
// are really hard to track later.
throw wrapper.unsupportedGiopVersion( version ) ;
}
}
示例2: EncapsInputStream
/**
* Full constructor with a CodeBase parameter useful for
* unmarshaling RMI-IIOP valuetypes (technically against the
* intention of an encapsulation, but necessary due to OMG
* issue 4795. Used by ServiceContexts.
*/
public EncapsInputStream(org.omg.CORBA.ORB orb,
byte[] data,
int size,
GIOPVersion version,
CodeBase codeBase) {
super(orb,
ByteBuffer.wrap(data),
size,
false,
version, Message.CDR_ENC_VERSION,
BufferManagerFactory.newBufferManagerRead(
BufferManagerFactory.GROW,
Message.CDR_ENC_VERSION,
(ORB)orb));
this.codeBase = codeBase;
performORBVersionSpecificInit();
}
示例3: newBufferManagerRead
public static BufferManagerRead newBufferManagerRead(
GIOPVersion version, byte encodingVersion, ORB orb) {
// REVISIT - On the reading side, shouldn't we monitor the incoming
// fragments on a given connection to determine what fragment size
// they're using, then use that ourselves?
if (encodingVersion != Message.CDR_ENC_VERSION) {
return new BufferManagerReadGrow(orb);
}
switch (version.intValue())
{
case GIOPVersion.VERSION_1_0:
return new BufferManagerReadGrow(orb);
case GIOPVersion.VERSION_1_1:
case GIOPVersion.VERSION_1_2:
// The stream reader can handle fragmented and
// non fragmented messages
return new BufferManagerReadStream(orb);
default:
// REVISIT - what is appropriate?
throw new INTERNAL("Unknown GIOP version: "
+ version);
}
}
示例4: newBufferManagerWrite
public static BufferManagerWrite newBufferManagerWrite(
int strategy, byte encodingVersion, ORB orb) {
if (encodingVersion != Message.CDR_ENC_VERSION) {
if (strategy != BufferManagerFactory.GROW) {
ORBUtilSystemException wrapper =
ORBUtilSystemException.get((ORB)orb,
CORBALogDomains.RPC_ENCODING);
throw wrapper.invalidBuffMgrStrategy("newBufferManagerWrite");
}
return new BufferManagerWriteGrow(orb);
}
switch (strategy) {
case BufferManagerFactory.GROW:
return new BufferManagerWriteGrow(orb);
case BufferManagerFactory.COLLECT:
return new BufferManagerWriteCollect(orb);
case BufferManagerFactory.STREAM:
return new BufferManagerWriteStream(orb);
default:
throw new INTERNAL("Unknown buffer manager write strategy: "
+ strategy);
}
}
示例5: newInputStream
public static CDRInputStreamBase newInputStream(
ORB orb, GIOPVersion version, byte encodingVersion) {
switch(version.intValue()) {
case GIOPVersion.VERSION_1_0:
return new CDRInputStream_1_0();
case GIOPVersion.VERSION_1_1:
return new CDRInputStream_1_1();
case GIOPVersion.VERSION_1_2:
if (encodingVersion != Message.CDR_ENC_VERSION) {
return
new IDLJavaSerializationInputStream(encodingVersion);
}
return new CDRInputStream_1_2();
// else fall through and report exception.
default:
ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.RPC_ENCODING ) ;
throw wrapper.unsupportedGiopVersion( version ) ;
}
}
示例6: newBufferManagerRead
public static BufferManagerRead newBufferManagerRead(
int strategy, byte encodingVersion, ORB orb) {
if (encodingVersion != Message.CDR_ENC_VERSION) {
if (strategy != BufferManagerFactory.GROW) {
ORBUtilSystemException wrapper =
ORBUtilSystemException.get((ORB)orb,
CORBALogDomains.RPC_ENCODING);
throw wrapper.invalidBuffMgrStrategy("newBufferManagerRead");
}
return new BufferManagerReadGrow(orb);
}
switch (strategy) {
case BufferManagerFactory.GROW:
return new BufferManagerReadGrow(orb);
case BufferManagerFactory.COLLECT:
throw new INTERNAL("Collect strategy invalid for reading");
case BufferManagerFactory.STREAM:
return new BufferManagerReadStream(orb);
default:
throw new INTERNAL("Unknown buffer manager read strategy: "
+ strategy);
}
}
示例7: getEncodingVersion
/**
* @return the Java serialization encoding version.
*/
public static byte getEncodingVersion(ORB orb, IOR ior) {
// Is Java serialization enabled?
// Check the JavaSerializationComponent (tagged component)
// in the IIOPProfile. If present, the peer ORB's GIOP is capable
// of using Java serialization instead of CDR serialization.
// In such a case, use Java serialization, iff the java serialization
// versions match.
if (orb.getORBData().isJavaSerializationEnabled()) {
IIOPProfile prof = ior.getProfile();
IIOPProfileTemplate profTemp =
(IIOPProfileTemplate) prof.getTaggedProfileTemplate();
java.util.Iterator iter = profTemp.iteratorById(
ORBConstants.TAG_JAVA_SERIALIZATION_ID);
if (iter.hasNext()) {
JavaSerializationComponent jc =
(JavaSerializationComponent) iter.next();
byte jcVersion = jc.javaSerializationVersion();
if (jcVersion >= Message.JAVA_ENC_VERSION) {
return Message.JAVA_ENC_VERSION;
} else if (jcVersion > Message.CDR_ENC_VERSION) {
return jc.javaSerializationVersion();
} else {
// throw error?
// Since encodingVersion is <= 0 (CDR_ENC_VERSION).
}
}
}
return Message.CDR_ENC_VERSION; // default
}
示例8: EncapsOutputStream
public EncapsOutputStream(ORB orb,
GIOPVersion version,
boolean isLittleEndian)
{
super(orb, version, Message.CDR_ENC_VERSION, isLittleEndian,
BufferManagerFactory.newBufferManagerWrite(
BufferManagerFactory.GROW,
Message.CDR_ENC_VERSION,
orb),
ORBConstants.STREAM_FORMAT_VERSION_1,
usePooledByteBuffers);
}
示例9: newBufferManagerWrite
public static BufferManagerWrite newBufferManagerWrite(
GIOPVersion version, byte encodingVersion, ORB orb) {
if (encodingVersion != Message.CDR_ENC_VERSION) {
return new BufferManagerWriteGrow(orb);
}
return BufferManagerFactory.newBufferManagerWrite(
orb.getORBData().getGIOPBuffMgrStrategy(version),
encodingVersion, orb);
}
示例10: EncapsInputStream
public EncapsInputStream(org.omg.CORBA.ORB orb, ByteBuffer byteBuffer,
int size, boolean littleEndian,
GIOPVersion version) {
super(orb, byteBuffer, size, littleEndian,
version, Message.CDR_ENC_VERSION,
BufferManagerFactory.newBufferManagerRead(
BufferManagerFactory.GROW,
Message.CDR_ENC_VERSION,
(com.sun.corba.se.spi.orb.ORB)orb));
performORBVersionSpecificInit();
}
示例11: EncapsInputStream
public EncapsInputStream(org.omg.CORBA.ORB orb, byte[] buf,
int size, boolean littleEndian,
GIOPVersion version) {
super(orb, ByteBuffer.wrap(buf), size, littleEndian,
version, Message.CDR_ENC_VERSION,
BufferManagerFactory.newBufferManagerRead(
BufferManagerFactory.GROW,
Message.CDR_ENC_VERSION,
(ORB)orb));
wrapper = ORBUtilSystemException.get( (ORB)orb,
CORBALogDomains.RPC_ENCODING ) ;
performORBVersionSpecificInit();
}