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


Java ORB类代码示例

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


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

示例1: extractObjectKey

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * Construct an ObjectKey from a byte[].
 *
 * @return ObjectKey the object key.
 */
static ObjectKey extractObjectKey(byte[] objKey, ORB orb) {

    try {
        if (objKey != null) {
            ObjectKey objectKey =
                orb.getObjectKeyFactory().create(objKey);
            if (objectKey != null) {
                return objectKey;
            }
        }
    } catch (Exception e) {
        // XXX log this exception
    }

    // This exception is thrown if any exceptions are raised while
    // extracting the object key or if the object key is empty.
    throw wrapper.invalidObjectKey();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:24,代码来源:MessageBase.java

示例2: EncapsInputStream

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * 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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:EncapsInputStream.java

示例3: createORB

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
protected ORB createORB(String[] args)
{
    Properties props = System.getProperties();

    // For debugging.
    //props.put( ORBConstants.DEBUG_PROPERTY, "naming" ) ;
    //props.put( ORBConstants.DEBUG_PROPERTY, "transport,giop,naming" ) ;

    props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ;
    props.put( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
        props.getProperty( ORBConstants.ORBD_PORT_PROPERTY,
            Integer.toString(
                ORBConstants.DEFAULT_ACTIVATION_PORT ) ) ) ;

    // See Bug 4396928 for more information about why we are initializing
    // the ORBClass to PIORB (now ORBImpl, but should check the bugid).
    props.put("org.omg.CORBA.ORBClass",
        "com.sun.corba.se.impl.orb.ORBImpl");

    return (ORB) ORB.init(args, props);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ORBD.java

示例4: ServiceContexts

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * Read the Service contexts from the input stream.
 */
public ServiceContexts(InputStream s)
{
    this( (ORB)(s.orb()) ) ;

    // We need to store this so that we can have access
    // to the CodeBase for unmarshaling possible
    // RMI-IIOP valuetype data within an encapsulation.
    // (Known case: UnknownExceptionInfo)
    codeBase = ((CDRInputStream)s).getCodeBase();

    createMapFromInputStream(s);

    // Fix for bug 4904723
    giopVersion = ((CDRInputStream)s).getGIOPVersion();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ServiceContexts.java

示例5: newOutputStream

import com.sun.corba.se.spi.orb.ORB; //导入依赖的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 ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:CDROutputStream.java

示例6: initializeNaming

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
private void initializeNaming( ORB orb )
{
    LocalResolver localResolver = ResolverDefault.makeLocalResolver() ;
    orb.setLocalResolver( localResolver ) ;

    Resolver bootResolver = ResolverDefault.makeBootstrapResolver( orb,
        orb.getORBData().getORBInitialHost(),
        orb.getORBData().getORBInitialPort() ) ;

    Operation urlOperation = ResolverDefault.makeINSURLOperation( orb,
        bootResolver ) ;
    orb.setURLOperation( urlOperation ) ;

    Resolver irResolver = ResolverDefault.makeORBInitRefResolver( urlOperation,
        orb.getORBData().getORBInitialReferences() ) ;

    Resolver dirResolver = ResolverDefault.makeORBDefaultInitRefResolver(
        urlOperation, orb.getORBData().getORBDefaultInitialReference() ) ;

    Resolver resolver =
        ResolverDefault.makeCompositeResolver( localResolver,
            ResolverDefault.makeCompositeResolver( irResolver,
                ResolverDefault.makeCompositeResolver( dirResolver,
                    bootResolver ) ) ) ;
    orb.setResolver( resolver ) ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:ORBConfiguratorImpl.java

示例7: createTypeCode

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * When using our own ORB and Any implementations, we need to get
 * the ORB version and create the type code appropriately.  This is
 * to overcome a bug in which the JDK 1.3.x ORBs used a tk_char
 * rather than a tk_wchar to describe a Java char field.
 *
 * This only works in RMI-IIOP with Util.writeAny since we actually
 * know what ORB and stream we're writing with when we insert
 * the value.
 *
 * Returns null if it wasn't possible to create the TypeCode (means
 * it wasn't our ORB or Any implementation).
 *
 * This does not handle null objs.
 */
private TypeCode createTypeCode(Serializable obj,
                                org.omg.CORBA.Any any,
                                org.omg.CORBA.ORB orb) {

    if (any instanceof com.sun.corba.se.impl.corba.AnyImpl &&
        orb instanceof ORB) {

        com.sun.corba.se.impl.corba.AnyImpl anyImpl
            = (com.sun.corba.se.impl.corba.AnyImpl)any;

        ORB ourORB = (ORB)orb;

        return anyImpl.createTypeCodeForClass(obj.getClass(), ourORB);

    } else
        return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:33,代码来源:Util.java

示例8: createMessageMediator

import com.sun.corba.se.spi.orb.ORB; //导入依赖的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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:SharedCDRContactInfoImpl.java

示例9: ORBInitInfoImpl

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * Creates a new ORBInitInfoImpl object (scoped to package)
 *
 * @param args The arguments passed to ORB_init.
 */
ORBInitInfoImpl( ORB orb, String[] args,
    String orbId, CodecFactory codecFactory )
{
    this.orb = orb;

    wrapper = InterceptorsSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    orbutilWrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    omgWrapper = OMGSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;

    this.args = args;
    this.orbId = orbId;
    this.codecFactory = codecFactory;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ORBInitInfoImpl.java

示例10: NamingContextImpl

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/**
 * Create a naming context servant.
 * Runs the super constructor.
 * @param orb an ORB object.
 * @param objKey as String
 * @param theNameService as NameService
 * @param theServantManagerImpl as ServantManagerImpl
 * @exception java.lang.Exception a Java exception.
 */

public NamingContextImpl(ORB orb, String objKey,
    NameService theNameService, ServantManagerImpl theServantManagerImpl  )
    throws Exception
{
    super();

    this.orb = orb;
    readWrapper = NamingSystemException.get( orb,
        CORBALogDomains.NAMING_READ ) ;
    updateWrapper = NamingSystemException.get( orb,
        CORBALogDomains.NAMING_UPDATE ) ;

    debug = true ; // orb.namingDebugFlag ;
    this.objKey = objKey;
    theNameServiceHandle = theNameService;
    theServantManagerImplHandle = theServantManagerImpl;
    insImpl =
        new com.sun.corba.se.impl.naming.cosnaming.InterOperableNamingImpl();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:NamingContextImpl.java

示例11: invoke

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
public CorbaMessageMediator invoke(java.lang.Object servant,
                                   CorbaMessageMediator request,
                                   byte[] objectId,
                                   ObjectAdapter objectAdapter)
{
    ORB orb = (ORB)request.getBroker() ;
    ORBUtilSystemException wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.OA_INVOCATION ) ;

    if ((servant == null) || (servant instanceof NullServant)) {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.badSkeleton(), null);
    } else {
        return request.getProtocolHandler().createSystemExceptionResponse(
            request, wrapper.getinterfaceNotImplemented(), null);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:SpecialMethod.java

示例12: getExceptionDetailMessage

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
protected void getExceptionDetailMessage(
    CorbaMessageMediator  messageMediator,
    ORBUtilSystemException wrapper)
{
    ServiceContext sc = messageMediator.getReplyServiceContexts()
        .get(ExceptionDetailMessage.value);
    if (sc == null)
        return ;

    if (! (sc instanceof UnknownServiceContext)) {
        throw wrapper.badExceptionDetailMessageServiceContextType();
    }
    byte[] data = ((UnknownServiceContext)sc).getData();
    EncapsInputStream in =
            EncapsInputStreamFactory.newEncapsInputStream((ORB)messageMediator.getBroker(),
                                  data, data.length);
    in.consumeEndian();

    String msg =
          "----------BEGIN server-side stack trace----------\n"
        + in.read_wstring() + "\n"
        + "----------END server-side stack trace----------";

    messageMediator.setReplyExceptionDetailMessage(msg);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:CorbaClientRequestDispatcherImpl.java

示例13: createTypeCodeForNull

import com.sun.corba.se.spi.orb.ORB; //导入依赖的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

示例14: LocalClientRequestDispatcherBase

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
protected LocalClientRequestDispatcherBase(ORB orb, int scid, IOR ior)
{
    this.orb = orb ;

    TaggedProfile prof = ior.getProfile() ;
    servantIsLocal = orb.getORBData().isLocalOptimizationAllowed() &&
        prof.isLocal();

    ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;
    this.scid = oktemp.getSubcontractId() ;
    RequestDispatcherRegistry sreg = orb.getRequestDispatcherRegistry() ;
    oaf = sreg.getObjectAdapterFactory( scid ) ;
    oaid = oktemp.getObjectAdapterId() ;
    ObjectId oid = prof.getObjectId() ;
    objectId = oid.getId() ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:LocalClientRequestDispatcherBase.java

示例15: connectAndGetIOR

import com.sun.corba.se.spi.orb.ORB; //导入依赖的package包/类
/** Obtains an IOR for the object reference obj, first connecting it to
* the ORB if necessary.
* @return IOR the IOR that represents this objref.  This will
* never be null.
* @exception BAD_OPERATION if the object could not be connected,
* if a connection attempt was needed.
* @exception BAD_PARAM if obj is a local object, or else was
* created by a foreign ORB.
*/
public static IOR connectAndGetIOR( ORB orb, org.omg.CORBA.Object obj )
{
    IOR result ;
    try {
        result = getIOR( obj ) ;
    } catch (BAD_OPERATION bop) {
        if (StubAdapter.isStub(obj)) {
            try {
                StubAdapter.connect( obj, orb ) ;
            } catch (java.rmi.RemoteException exc) {
                throw wrapper.connectingServant( exc ) ;
            }
        } else {
            orb.connect( obj ) ;
        }

        result = getIOR( obj ) ;
    }

    return result ;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:ORBUtility.java


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