当前位置: 首页>>代码示例>>Java>>正文


Java ORBVersionFactory类代码示例

本文整理汇总了Java中com.sun.corba.se.spi.orb.ORBVersionFactory的典型用法代码示例。如果您正苦于以下问题:Java ORBVersionFactory类的具体用法?Java ORBVersionFactory怎么用?Java ORBVersionFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ORBVersionFactory类属于com.sun.corba.se.spi.orb包,在下文中一共展示了ORBVersionFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTypeCodeForNull

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
/**
 * This is used to create the TypeCode for a null reference.
 * It also handles backwards compatibility with JDK 1.3.x.
 *
 * This method will not return null.
 */
private TypeCode createTypeCodeForNull(org.omg.CORBA.ORB orb)
{
    if (orb instanceof ORB) {

        ORB ourORB = (ORB)orb;

        // Preserve backwards compatibility with Kestrel and Ladybird
        // by not fully implementing interop issue resolution 3857,
        // and returning a null TypeCode with a tk_value TCKind.
        // If we're not talking to Kestrel or Ladybird, fall through
        // to the abstract interface case (also used for foreign ORBs).
        if (!ORBVersionFactory.getFOREIGN().equals(ourORB.getORBVersion()) &&
            ORBVersionFactory.getNEWER().compareTo(ourORB.getORBVersion()) > 0) {

            return orb.get_primitive_tc(TCKind.tk_value);
        }
    }

    // Use tk_abstract_interface as detailed in the resolution

    // REVISIT: Define this in IDL and get the ID in generated code
    String abstractBaseID = "IDL:omg.org/CORBA/AbstractBase:1.0";

    return orb.create_abstract_interface_tc(abstractBaseID, "");
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:Util.java

示例2: readData

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public void readData(InputStreamHook stream) throws IOException {
    org.omg.CORBA.ORB orb = stream.getOrbStream().orb();
    if ((orb == null) ||
            !(orb instanceof com.sun.corba.se.spi.orb.ORB)) {
        throw new StreamCorruptedException(
                             "Default data must be read first");
    }
    ORBVersion clientOrbVersion =
        ((com.sun.corba.se.spi.orb.ORB)orb).getORBVersion();

    // Fix Date interop bug. For older versions of the ORB don't do
    // anything for readData(). Before this used to throw
    // StreamCorruptedException for older versions of the ORB where
    // calledDefaultWriteObject always returns true.
    if ((ORBVersionFactory.getPEORB().compareTo(clientOrbVersion) <= 0) ||
            (clientOrbVersion.equals(ORBVersionFactory.getFOREIGN()))) {
        // XXX I18N and logging needed.
        throw new StreamCorruptedException("Default data must be read first");
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:InputStreamHook.java

示例3: createValueHandler

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
/**
 * Creates the correct ValueHandler for the given ORB,
 * querying ORBVersion information.  If the ORB or
 * ORBVersion is null, gets the ValueHandler from
 * Util.createValueHandler.
 */
public static ValueHandler createValueHandler(ORB orb) {

    if (orb == null)
        return Util.createValueHandler();

    ORBVersion version = orb.getORBVersion();

    if (version == null)
        return Util.createValueHandler();

    if (version.equals(ORBVersionFactory.getOLD()))
        return new ValueHandlerImpl_1_3();
    if (version.equals(ORBVersionFactory.getNEW()))
        return new ValueHandlerImpl_1_3_1();

    return Util.createValueHandler();
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:24,代码来源:ORBUtility.java

示例4: ORBVersionServiceContext

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public ORBVersionServiceContext(InputStream is, GIOPVersion gv)
{
    super(is, gv) ;
    // pay particular attention to where the version is being read from!
    // is contains an encapsulation, ServiceContext reads off the
    // encapsulation and leaves the pointer in the variable "in",
    // which points to the long value.

    version = ORBVersionFactory.create( in ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ORBVersionServiceContext.java

示例5: chooseRequestVersion

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
/**
 * This chooses the appropriate GIOP version.
 *
 * @return the GIOP version 13.00 if Java serialization is enabled, or
 *         smallest(profGIOPVersion, orbGIOPVersion)
 */
public static GIOPVersion chooseRequestVersion(ORB orb, IOR ior ) {

    GIOPVersion orbVersion = orb.getORBData().getGIOPVersion();
    IIOPProfile prof = ior.getProfile() ;
    GIOPVersion profVersion = prof.getGIOPVersion();

    // Check if the profile is from a legacy Sun ORB.

    ORBVersion targetOrbVersion = prof.getORBVersion();
    if (!(targetOrbVersion.equals(ORBVersionFactory.getFOREIGN())) &&
            targetOrbVersion.lessThan(ORBVersionFactory.getNEWER())) {
        // we are dealing with a SUN legacy orb which emits 1.1 IORs,
        // in spite of being able to handle only GIOP 1.0 messages.
        return V1_0;
    }

    // Now the target has to be (FOREIGN | NEWER*)

    byte prof_major = profVersion.getMajor();
    byte prof_minor = profVersion.getMinor();

    byte orb_major = orbVersion.getMajor();
    byte orb_minor = orbVersion.getMinor();

    if (orb_major < prof_major) {
        return orbVersion;
    } else if (orb_major > prof_major) {
        return profVersion;
    } else { // both major version are the same
        if (orb_minor <= prof_minor) {
            return orbVersion;
        } else {
            return profVersion;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:GIOPVersion.java

示例6: addServiceContexts

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
protected void addServiceContexts(CorbaMessageMediator messageMediator)
{
    ORB orb = (ORB)messageMediator.getBroker();
    CorbaConnection c = (CorbaConnection) messageMediator.getConnection();
    GIOPVersion giopVersion = messageMediator.getGIOPVersion();

    ServiceContexts contexts = messageMediator.getRequestServiceContexts();

    addCodeSetServiceContext(c, contexts, giopVersion);

    // Add the RMI-IIOP max stream format version
    // service context to every request.  Once we have GIOP 1.3,
    // we could skip it since we now support version 2, but
    // probably safer to always send it.
    contexts.put(MaxStreamFormatVersionServiceContext.singleton);

    // ORBVersion servicecontext needs to be sent
    ORBVersionServiceContext ovsc = new ORBVersionServiceContext(
                    ORBVersionFactory.getORBVersion() ) ;
    contexts.put( ovsc ) ;

    // NOTE : We only want to send the runtime context the first time
    if ((c != null) && !c.isPostInitialContexts()) {
        // Do not do c.setPostInitialContexts() here.
        // If a client interceptor send_request does a ForwardRequest
        // which ends up using the same connection then the service
        // context would not be sent.
        SendingContextServiceContext scsc =
            new SendingContextServiceContext( orb.getFVDCodeBaseIOR() ) ; //d11638
        contexts.put( scsc ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:CorbaClientRequestDispatcherImpl.java

示例7: writeClassBody

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
private void writeClassBody(Class clz) {
    if (orb == null ||
        ORBVersionFactory.getFOREIGN().equals(orb.getORBVersion()) ||
        ORBVersionFactory.getNEWER().compareTo(orb.getORBVersion()) <= 0) {

        write_value(Util.getCodebase(clz));
        write_value(repIdStrs.createForAnyType(clz));
    } else {

        write_value(repIdStrs.createForAnyType(clz));
        write_value(Util.getCodebase(clz));
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:CDROutputStream_1_0.java

示例8: isForeignORB

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
/**
 * Returns true if it was accurately determined that the remote ORB is
 * a foreign (non-JavaSoft) ORB.  Note:  If passed the ORBSingleton, this
 * will return false.
 */
public static boolean isForeignORB(ORB orb)
{
    if (orb == null)
        return false;

    try {
        return orb.getORBVersion().equals(ORBVersionFactory.getFOREIGN());
    } catch (SecurityException se) {
        return false;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ORBUtility.java

示例9: OldJIDLObjectKeyTemplate

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public OldJIDLObjectKeyTemplate( ORB orb, int magic, int scid,
    InputStream is, OctetSeqHolder osh )
{
    this( orb, magic, scid, is );

    osh.value = readObjectKey( is ) ;

    /**
     * Beginning with JDK 1.3.1_01, a byte was placed at the end of
     * the object key with a value indicating the patch version.
     * JDK 1.3.1_01 had the value 1.  If other patches are necessary
     * which involve ORB versioning changes, they should increment
     * the patch version.
     *
     * Note that if we see a value greater than 1 in this code, we
     * will treat it as if we're talking to the most recent ORB version.
     *
     * WARNING: This code is sensitive to changes in CDRInputStream
     * getPosition.  It assumes that the CDRInputStream is an
     * encapsulation whose position can be compared to the object
     * key array length.
     */
    if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW &&
        osh.value.length > ((CDRInputStream)is).getPosition()) {

        patchVersion = is.read_octet();

        if (patchVersion == ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL)
            setORBVersion(ORBVersionFactory.getJDK1_3_1_01());
        else if (patchVersion > ObjectKeyFactoryImpl.JDK1_3_1_01_PATCH_LEVEL)
            setORBVersion(ORBVersionFactory.getORBVersion());
        else
            throw wrapper.invalidJdk131PatchLevel( new Integer( patchVersion ) ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:OldJIDLObjectKeyTemplate.java

示例10: POAObjectKeyTemplate

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public POAObjectKeyTemplate( ORB orb, int scid, int serverid, String orbid,
    ObjectAdapterId objectAdapterId)
{
    super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, orbid,
        objectAdapterId ) ;

    setORBVersion( ORBVersionFactory.getORBVersion() ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:POAObjectKeyTemplate.java

示例11: JIDLObjectKeyTemplate

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public JIDLObjectKeyTemplate( ORB orb, int scid, int serverid )
{
    super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid,
        JIDL_ORB_ID, JIDL_OAID ) ;

    setORBVersion( ORBVersionFactory.getORBVersion() ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:JIDLObjectKeyTemplate.java

示例12: OldObjectKeyTemplateBase

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public OldObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid,
    String orbid, ObjectAdapterId oaid )
{
    super( orb, magic, scid, serverid, orbid, oaid ) ;

    // set version based on magic
    if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_OLD)
        setORBVersion( ORBVersionFactory.getOLD() ) ;
    else if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW)
        setORBVersion( ORBVersionFactory.getNEW() ) ;
    else // any other magic should not be here
        throw wrapper.badMagic( new Integer( magic ) ) ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:OldObjectKeyTemplateBase.java

示例13: getORBVersion

import com.sun.corba.se.spi.orb.ORBVersionFactory; //导入依赖的package包/类
public ORBVersion getORBVersion()
{
    if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_OLD)
        return ORBVersionFactory.getOLD() ;
    else if (getMagic() == ObjectKeyFactoryImpl.JAVAMAGIC_NEW)
        return ORBVersionFactory.getNEW() ;
    else
        throw new INTERNAL() ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:OldPOAObjectKeyTemplate.java


注:本文中的com.sun.corba.se.spi.orb.ORBVersionFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。