本文整理汇总了Java中com.sun.corba.se.spi.ior.iiop.GIOPVersion类的典型用法代码示例。如果您正苦于以下问题:Java GIOPVersion类的具体用法?Java GIOPVersion怎么用?Java GIOPVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GIOPVersion类属于com.sun.corba.se.spi.ior.iiop包,在下文中一共展示了GIOPVersion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStreamFormatVersionForThisRequest
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
private byte getStreamFormatVersionForThisRequest(IOR ior,
GIOPVersion giopVersion)
{
byte localMaxVersion
= ORBUtility.getMaxStreamFormatVersion();
IOR effectiveTargetIOR =
((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR();
IIOPProfileTemplate temp =
(IIOPProfileTemplate)effectiveTargetIOR.getProfile().getTaggedProfileTemplate();
Iterator iter = temp.iteratorById(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value);
if (!iter.hasNext()) {
// Didn't have the max stream format version tagged
// component.
if (giopVersion.lessThan(GIOPVersion.V1_3))
return ORBConstants.STREAM_FORMAT_VERSION_1;
else
return ORBConstants.STREAM_FORMAT_VERSION_2;
}
byte remoteMaxVersion
= ((MaxStreamFormatVersionComponent)iter.next()).getMaxStreamFormatVersion();
return (byte)Math.min(localMaxVersion, remoteMaxVersion);
}
示例2: createMessageMediator
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public MessageMediator createMessageMediator(Broker broker,
ContactInfo contactInfo,
Connection connection,
String methodName,
boolean isOneWay)
{
if (connection != null) {
/// XXX LOGGING
throw new RuntimeException("connection is not null");
}
CorbaMessageMediator messageMediator =
new CorbaMessageMediatorImpl(
(ORB) broker,
contactInfo,
null, // Connection;
GIOPVersion.chooseRequestVersion( (ORB)broker,
effectiveTargetIOR),
effectiveTargetIOR,
requestId++, // Fake RequestId
getAddressingDisposition(),
methodName,
isOneWay);
return messageMediator;
}
示例3: createCloseConnection
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public static Message createCloseConnection(GIOPVersion gv) {
if (gv.equals(GIOPVersion.V1_0)) { // 1.0
return new Message_1_0(Message.GIOPBigMagic, false,
Message.GIOPCloseConnection, 0);
} else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_1,
FLAG_NO_FRAG_BIG_ENDIAN,
Message.GIOPCloseConnection, 0);
} else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
return new Message_1_1(Message.GIOPBigMagic, GIOPVersion.V1_2,
FLAG_NO_FRAG_BIG_ENDIAN,
Message.GIOPCloseConnection, 0);
} else {
throw wrapper.giopVersionError(
CompletionStatus.COMPLETED_MAYBE);
}
}
示例4: CDROutputObject
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
private CDROutputObject(
ORB orb, GIOPVersion giopVersion, Message header,
BufferManagerWrite manager, byte streamFormatVersion,
CorbaMessageMediator mediator)
{
super(orb, giopVersion, header.getEncodingVersion(),
false, manager, streamFormatVersion,
((mediator != null && mediator.getConnection() != null) ?
((CorbaConnection)mediator.getConnection()).
shouldUseDirectByteBuffers() : false));
this.header = header;
this.orb = orb;
this.wrapper = ORBUtilSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;
this.omgWrapper = OMGSystemException.get( orb, CORBALogDomains.RPC_ENCODING ) ;
getBufferManager().setOutputObject(this);
this.corbaMessageMediator = mediator;
}
示例5: createAppropriateOutputObject
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
private CDROutputObject createAppropriateOutputObject(
CorbaMessageMediator messageMediator,
Message msg, LocateReplyMessage reply)
{
CDROutputObject outputObject;
if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
// locate msgs 1.0 & 1.1 :=> grow,
outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
(ORB) messageMediator.getBroker(),
this,
GIOPVersion.V1_0,
(CorbaConnection) messageMediator.getConnection(),
reply,
ORBConstants.STREAM_FORMAT_VERSION_1);
} else {
// 1.2 :=> stream
outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
(ORB) messageMediator.getBroker(),
messageMediator,
reply,
ORBConstants.STREAM_FORMAT_VERSION_1);
}
return outputObject;
}
示例6: RequestMessage_1_1
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
int _request_id, boolean _response_expected, byte[] _reserved,
byte[] _object_key, String _operation,
Principal _requesting_principal) {
super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
Message.GIOPRequest, 0);
this.orb = orb;
this.wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.RPC_PROTOCOL ) ;
service_contexts = _service_contexts;
request_id = _request_id;
response_expected = _response_expected;
reserved = _reserved;
object_key = _object_key;
operation = _operation;
requesting_principal = _requesting_principal;
}
示例7: newBufferManagerRead
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
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);
}
}
示例8: newOutputStream
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
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 ) ;
}
}
示例9: writeServiceContextsInOrder
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
/**
* Write the service contexts in scMap in a desired order.
* Right now, the only special case we have is UnknownExceptionInfo,
* so I'm merely writing it last if present.
*/
private void writeServiceContextsInOrder(OutputStream os, GIOPVersion gv) {
// Temporarily remove this rather than check it per iteration
Integer ueInfoId
= new Integer(UEInfoServiceContext.SERVICE_CONTEXT_ID);
Object unknownExceptionInfo = scMap.remove(ueInfoId);
Iterator iter = scMap.keySet().iterator();
while (iter.hasNext()) {
Integer id = (Integer)iter.next();
writeMapEntry(os, id, scMap.get(id), gv);
}
// Write the UnknownExceptionInfo service context last
// (so it will be after the CodeBase) and restore it in
// the map.
if (unknownExceptionInfo != null) {
writeMapEntry(os, ueInfoId, unknownExceptionInfo, gv);
scMap.put(ueInfoId, unknownExceptionInfo);
}
}
示例10: CDROutputStream
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public CDROutputStream(ORB orb,
GIOPVersion version,
byte encodingVersion,
boolean littleEndian,
BufferManagerWrite bufferManager,
byte streamFormatVersion,
boolean usePooledByteBuffers)
{
impl = OutputStreamFactory.newOutputStream(orb, version,
encodingVersion);
impl.init(orb, littleEndian, bufferManager,
streamFormatVersion, usePooledByteBuffers);
impl.setParent(this);
this.orb = orb ;
this.wrapper = ORBUtilSystemException.get( orb,
CORBALogDomains.RPC_ENCODING ) ;
}
示例11: newInputStream
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
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 ) ;
}
}
示例12: write
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public void write(org.omg.CORBA.portable.OutputStream ostream) {
super.write(ostream);
ostream.write_ulong(this.request_id);
ostream.write_long(this.reply_status);
if (this.service_contexts != null) {
service_contexts.write(
(org.omg.CORBA_2_3.portable.OutputStream) ostream,
GIOPVersion.V1_2);
} else {
ServiceContexts.writeNullServiceContext(
(org.omg.CORBA_2_3.portable.OutputStream) ostream);
}
// CORBA formal 00-11-0 15.4.2.2 GIOP 1.2 body must be
// aligned on an 8 octet boundary.
// Ensures that the first write operation called from the stub code,
// during body construction, would insert a header padding, such that
// the body is aligned on an 8-octet boundary.
((CDROutputStream)ostream).setHeaderPadding(true);
}
示例13: createMessageMediator
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public MessageMediator createMessageMediator(Broker broker,
ContactInfo contactInfo,
Connection connection,
String methodName,
boolean isOneWay)
{
// REVISIT: Would like version, ior, requestid, etc., decisions
// to be in client subcontract. Cannot pass these to this
// factory method because it breaks generic abstraction.
// Maybe set methods on mediator called from subcontract
// after creation?
CorbaMessageMediator messageMediator =
new CorbaMessageMediatorImpl(
(ORB) broker,
contactInfo,
connection,
GIOPVersion.chooseRequestVersion( (ORB)broker,
effectiveTargetIOR),
effectiveTargetIOR,
((CorbaConnection)connection).getNextRequestId(),
getAddressingDisposition(),
methodName,
isOneWay);
return messageMediator;
}
示例14: createWCharCTBConverter
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
protected CodeSetConversion.CTBConverter createWCharCTBConverter() {
if (getGIOPVersion().equals(GIOPVersion.V1_0))
throw wrapper.wcharDataInGiop10(CompletionStatus.COMPLETED_MAYBE);
// In the case of GIOP 1.1, we take the byte order of the stream and don't
// use byte order markers since we're limited to a 2 byte fixed width encoding.
if (getGIOPVersion().equals(GIOPVersion.V1_1))
return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
isLittleEndian(),
false);
// Assume anything else meets GIOP 1.2 requirements
//
// Use byte order markers? If not, use big endian in GIOP 1.2.
// (formal 00-11-03 15.3.16)
boolean useBOM = ((ORB)orb()).getORBData().useByteOrderMarkersInEncapsulations();
return CodeSetConversion.impl().getCTBConverter(OSFCodeSetRegistry.UTF_16,
false,
useBOM);
}
示例15: newEncapsInputStream
import com.sun.corba.se.spi.ior.iiop.GIOPVersion; //导入依赖的package包/类
public static EncapsInputStream newEncapsInputStream(
final org.omg.CORBA.ORB orb, final byte[] buf, final int size,
final boolean littleEndian, final GIOPVersion version) {
return AccessController
.doPrivileged(new PrivilegedAction<EncapsInputStream>() {
@Override
public EncapsInputStream run() {
return new EncapsInputStream(orb, buf, size,
littleEndian, version);
}
});
}