com.sun.corba.se.spi.ior.ObjectKeyTemplate Java Examples

The following examples show how to use com.sun.corba.se.spi.ior.ObjectKeyTemplate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TOAImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public TOAImpl( ORB orb, TransientObjectManager tom, String codebase )
{
    super( orb ) ;
    servants = tom ;

    // Make the object key template
    int serverid = ((ORB)getORB()).getTransientServerId();
    int scid = ORBConstants.TOA_SCID ;

    ObjectKeyTemplate oktemp = new JIDLObjectKeyTemplate( orb, scid, serverid ) ;

    // REVISIT - POA specific
    Policies policies = Policies.defaultPolicies;

    // REVISIT - absorb codebase into a policy
    initializeTemplate( oktemp, true,
                        policies,
                        codebase,
                        null, // manager id
                        oktemp.getObjectAdapterId()
                        ) ;
}
 
Example #2
Source File: PIHandlerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #3
Source File: TOAImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public TOAImpl( ORB orb, TransientObjectManager tom, String codebase )
{
    super( orb ) ;
    servants = tom ;

    // Make the object key template
    int serverid = ((ORB)getORB()).getTransientServerId();
    int scid = ORBConstants.TOA_SCID ;

    ObjectKeyTemplate oktemp = new JIDLObjectKeyTemplate( orb, scid, serverid ) ;

    // REVISIT - POA specific
    Policies policies = Policies.defaultPolicies;

    // REVISIT - absorb codebase into a policy
    initializeTemplate( oktemp, true,
                        policies,
                        codebase,
                        null, // manager id
                        oktemp.getObjectAdapterId()
                        ) ;
}
 
Example #4
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
Example #5
Source File: CorbaServerRequestDispatcherImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example #6
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
Example #7
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example #8
Source File: CorbaServerRequestDispatcherImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** XXX/REVISIT:
 * We do not want to look for a servant in the POA/ServantManager case,
 * but we could in most other cases.  The OA could have a method that
 * returns true if the servant MAY exist, and false only if the servant
 * definitely DOES NOT exist.
 *
 * XXX/REVISIT:
 * We may wish to indicate OBJECT_HERE by some mechanism other than
 * returning a null result.
 *
 * Called from ORB.locate when a LocateRequest arrives.
 * Result is not always absolutely correct: may indicate OBJECT_HERE
 * for non-existent objects, which is resolved on invocation.  This
 * "bug" is unavoidable, since in general the object may be destroyed
 * between a locate and a request.  Note that this only checks that
 * the appropriate ObjectAdapter is available, not that the servant
 * actually exists.
 * Need to signal one of OBJECT_HERE, OBJECT_FORWARD, OBJECT_NOT_EXIST.
 * @return Result is null if object is (possibly) implemented here, otherwise
 * an IOR indicating objref to forward the request to.
 * @exception OBJECT_NOT_EXIST is thrown if we know the object does not
 * exist here, and we are not forwarding.
 */
public IOR locate(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag)
            dprint(".locate->");

        ObjectKeyTemplate oktemp = okey.getTemplate() ;

        try {
            checkServerId(okey);
        } catch (ForwardException fex) {
            return fex.getIOR() ;
        }

        // Called only for its side-effect of throwing appropriate exceptions
        findObjectAdapter(oktemp);

        return null ;
    } finally {
        if (orb.subcontractDebugFlag)
            dprint(".locate<-");
    }
}
 
Example #9
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
Example #10
Source File: IIOPProfileTemplateImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void write( ObjectKeyTemplate okeyTemplate, ObjectId id, OutputStream os)
{
    giopVersion.write( os ) ;
    primary.write( os ) ;

    // Note that this is NOT an encapsulation: do not marshal
    // the endianness flag.  However, the length is required.
    // Note that this cannot be accomplished with a codec!

    // Use the byte order of the given stream
    OutputStream encapsulatedOS =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(
            (ORB)os.orb(), ((CDROutputStream)os).isLittleEndian() ) ;

    okeyTemplate.write( id, encapsulatedOS ) ;
    EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ;

    if (giopVersion.getMinor() > 0)
        EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
}
 
Example #11
Source File: PIHandlerImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #12
Source File: CorbaServerRequestDispatcherImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
Example #13
Source File: PIHandlerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void initializeServerPIInfo( CorbaMessageMediator request,
    ObjectAdapter oa, byte[] objectId, ObjectKeyTemplate oktemp )
{
    if( !hasServerInterceptors ) return;

    RequestInfoStack infoStack =
        (RequestInfoStack)threadLocalServerRequestInfoStack.get();
    ServerRequestInfoImpl info = new ServerRequestInfoImpl( orb );
    infoStack.push( info );
    printPush();

    // Notify request object that once response is constructed, make
    // sure we execute ending points.
    request.setExecutePIInResponseConstructor( true );

    info.setInfo( request, oa, objectId, oktemp );
}
 
Example #14
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected void checkServerId(ObjectKey okey)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId->");
        }

        ObjectKeyTemplate oktemp = okey.getTemplate() ;
        int sId = oktemp.getServerId() ;
        int scid = oktemp.getSubcontractId() ;

        if (!orb.isLocalServerId(scid, sId)) {
            if (orb.subcontractDebugFlag) {
                dprint(".checkServerId: bad server id");
            }

            orb.handleBadServerId(okey);
        }
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".checkServerId<-");
        }
    }
}
 
Example #15
Source File: LocalClientRequestDispatcherBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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() ;
}
 
Example #16
Source File: IIOPProfileTemplateImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void write( ObjectKeyTemplate okeyTemplate, ObjectId id, OutputStream os)
{
    giopVersion.write( os ) ;
    primary.write( os ) ;

    // Note that this is NOT an encapsulation: do not marshal
    // the endianness flag.  However, the length is required.
    // Note that this cannot be accomplished with a codec!

    // Use the byte order of the given stream
    OutputStream encapsulatedOS =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(
            (ORB)os.orb(), ((CDROutputStream)os).isLittleEndian() ) ;

    okeyTemplate.write( id, encapsulatedOS ) ;
    EncapsulationUtility.writeOutputStream( encapsulatedOS, os ) ;

    if (giopVersion.getMinor() > 0)
        EncapsulationUtility.writeIdentifiableSequence( this, os ) ;
}
 
Example #17
Source File: TOAImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public TOAImpl( ORB orb, TransientObjectManager tom, String codebase )
{
    super( orb ) ;
    servants = tom ;

    // Make the object key template
    int serverid = ((ORB)getORB()).getTransientServerId();
    int scid = ORBConstants.TOA_SCID ;

    ObjectKeyTemplate oktemp = new JIDLObjectKeyTemplate( orb, scid, serverid ) ;

    // REVISIT - POA specific
    Policies policies = Policies.defaultPolicies;

    // REVISIT - absorb codebase into a policy
    initializeTemplate( oktemp, true,
                        policies,
                        codebase,
                        null, // manager id
                        oktemp.getObjectAdapterId()
                        ) ;
}
 
Example #18
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter->");
        }

        RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
        int scid = oktemp.getSubcontractId() ;
        ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid);
        if (oaf == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdapterFactory");
            }

            throw wrapper.noObjectAdapterFactory() ;
        }

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        ObjectAdapter oa = oaf.find(oaid);

        if (oa == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdaptor");
            }

            throw wrapper.badAdapterId() ;
        }

        return oa ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter<-");
        }
    }
}
 
Example #19
Source File: CorbaServerRequestDispatcherImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter->");
        }

        RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
        int scid = oktemp.getSubcontractId() ;
        ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid);
        if (oaf == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdapterFactory");
            }

            throw wrapper.noObjectAdapterFactory() ;
        }

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        ObjectAdapter oa = oaf.find(oaid);

        if (oa == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdaptor");
            }

            throw wrapper.badAdapterId() ;
        }

        return oa ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter<-");
        }
    }
}
 
Example #20
Source File: IORImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void addTaggedProfiles( IORTemplate iortemp, ObjectId id )
{
    ObjectKeyTemplate oktemp = iortemp.getObjectKeyTemplate() ;
    Iterator templateIterator = iortemp.iterator() ;

    while (templateIterator.hasNext()) {
        TaggedProfileTemplate ptemp =
            (TaggedProfileTemplate)(templateIterator.next()) ;

        TaggedProfile profile = ptemp.create( oktemp, id ) ;

        add( profile ) ;
    }
}
 
Example #21
Source File: IORImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeIORTemplateList()
{
    // Maps ObjectKeyTemplate to IORTemplate
    Map oktempToIORTemplate = new HashMap() ;

    iortemps = IORFactories.makeIORTemplateList() ;
    Iterator iter = iterator() ;
    ObjectId oid = null ; // used to check that all profiles have the same oid.
    while (iter.hasNext()) {
        TaggedProfile prof = (TaggedProfile)(iter.next()) ;
        TaggedProfileTemplate ptemp = prof.getTaggedProfileTemplate() ;
        ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;

        // Check that all oids for all profiles are the same: if they are not,
        // throw exception.
        if (oid == null)
            oid = prof.getObjectId() ;
        else if (!oid.equals( prof.getObjectId() ))
            throw wrapper.badOidInIorTemplateList() ;

        // Find or create the IORTemplate for oktemp.
        IORTemplate iortemp = (IORTemplate)(oktempToIORTemplate.get( oktemp )) ;
        if (iortemp == null) {
            iortemp = IORFactories.makeIORTemplate( oktemp ) ;
            oktempToIORTemplate.put( oktemp, iortemp ) ;
            iortemps.add( iortemp ) ;
        }

        iortemp.add( ptemp ) ;
    }

    iortemps.makeImmutable() ;
}
 
Example #22
Source File: ServerRequestInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Stores the various sources of information used for this info object.
 */
protected void setInfo( CorbaMessageMediator request, ObjectAdapter oa,
    byte[] objectId, ObjectKeyTemplate oktemp )
{
    this.request = request;
    this.objectId = objectId;
    this.oktemp = oktemp;
    this.objectAdapter = oa ;
    this.connection = (com.sun.corba.se.spi.legacy.connection.Connection)
        request.getConnection();
}
 
Example #23
Source File: IIOPProfileImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public IIOPProfileImpl( ORB orb, ObjectKeyTemplate oktemp, ObjectId oid,
    IIOPProfileTemplate proftemp )
{
    this( orb ) ;
    this.oktemp = oktemp ;
    this.oid = oid ;
    this.proftemp = proftemp ;
}
 
Example #24
Source File: ObjectKeyFactoryImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** Creates an ObjectKeyTemplate from the InputStream.  Most of the
* decoding is done inside the handler.
*/
private ObjectKeyTemplate create( InputStream is, Handler handler,
    OctetSeqHolder osh )
{
    ObjectKeyTemplate oktemp = null ;

    try {
        is.mark(0) ;
        int magic = is.read_long() ;

        if (validMagic( magic )) {
            int scid = is.read_long() ;
            oktemp = handler.handle( magic, scid, is, osh ) ;
        }
    } catch (MARSHAL mexc) {
        // XXX log this error
        // ignore this: error handled below because oktemp == null
    }

    if (oktemp == null)
        // If we did not successfully construct a oktemp, reset the
        // stream so that WireObjectKeyTemplate can correctly construct the
        // object key.
        try {
            is.reset() ;
        } catch (IOException exc) {
            // XXX log this error
            // ignore this
        }

    return oktemp ;
}
 
Example #25
Source File: ObjectKeyFactoryImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/** Creates an ObjectKeyTemplate from the InputStream.  Most of the
* decoding is done inside the handler.
*/
private ObjectKeyTemplate create( InputStream is, Handler handler,
    OctetSeqHolder osh )
{
    ObjectKeyTemplate oktemp = null ;

    try {
        is.mark(0) ;
        int magic = is.read_long() ;

        if (validMagic( magic )) {
            int scid = is.read_long() ;
            oktemp = handler.handle( magic, scid, is, osh ) ;
        }
    } catch (MARSHAL mexc) {
        // XXX log this error
        // ignore this: error handled below because oktemp == null
    }

    if (oktemp == null)
        // If we did not successfully construct a oktemp, reset the
        // stream so that WireObjectKeyTemplate can correctly construct the
        // object key.
        try {
            is.reset() ;
        } catch (IOException exc) {
            // XXX log this error
            // ignore this
        }

    return oktemp ;
}
 
Example #26
Source File: CorbaServerRequestDispatcherImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter->");
        }

        RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
        int scid = oktemp.getSubcontractId() ;
        ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid);
        if (oaf == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdapterFactory");
            }

            throw wrapper.noObjectAdapterFactory() ;
        }

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        ObjectAdapter oa = oaf.find(oaid);

        if (oa == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdaptor");
            }

            throw wrapper.badAdapterId() ;
        }

        return oa ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter<-");
        }
    }
}
 
Example #27
Source File: ServerRequestInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Stores the various sources of information used for this info object.
 */
protected void setInfo( CorbaMessageMediator request, ObjectAdapter oa,
    byte[] objectId, ObjectKeyTemplate oktemp )
{
    this.request = request;
    this.objectId = objectId;
    this.oktemp = oktemp;
    this.objectAdapter = oa ;
    this.connection = (com.sun.corba.se.spi.legacy.connection.Connection)
        request.getConnection();
}
 
Example #28
Source File: ObjectKeyFactoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Creates an ObjectKeyTemplate from the InputStream.  Most of the
* decoding is done inside the handler.
*/
private ObjectKeyTemplate create( InputStream is, Handler handler,
    OctetSeqHolder osh )
{
    ObjectKeyTemplate oktemp = null ;

    try {
        is.mark(0) ;
        int magic = is.read_long() ;

        if (validMagic( magic )) {
            int scid = is.read_long() ;
            oktemp = handler.handle( magic, scid, is, osh ) ;
        }
    } catch (MARSHAL mexc) {
        // XXX log this error
        // ignore this: error handled below because oktemp == null
    }

    if (oktemp == null)
        // If we did not successfully construct a oktemp, reset the
        // stream so that WireObjectKeyTemplate can correctly construct the
        // object key.
        try {
            is.reset() ;
        } catch (IOException exc) {
            // XXX log this error
            // ignore this
        }

    return oktemp ;
}
 
Example #29
Source File: IORImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void initializeIORTemplateList()
{
    // Maps ObjectKeyTemplate to IORTemplate
    Map oktempToIORTemplate = new HashMap() ;

    iortemps = IORFactories.makeIORTemplateList() ;
    Iterator iter = iterator() ;
    ObjectId oid = null ; // used to check that all profiles have the same oid.
    while (iter.hasNext()) {
        TaggedProfile prof = (TaggedProfile)(iter.next()) ;
        TaggedProfileTemplate ptemp = prof.getTaggedProfileTemplate() ;
        ObjectKeyTemplate oktemp = prof.getObjectKeyTemplate() ;

        // Check that all oids for all profiles are the same: if they are not,
        // throw exception.
        if (oid == null)
            oid = prof.getObjectId() ;
        else if (!oid.equals( prof.getObjectId() ))
            throw wrapper.badOidInIorTemplateList() ;

        // Find or create the IORTemplate for oktemp.
        IORTemplate iortemp = (IORTemplate)(oktempToIORTemplate.get( oktemp )) ;
        if (iortemp == null) {
            iortemp = IORFactories.makeIORTemplate( oktemp ) ;
            oktempToIORTemplate.put( oktemp, iortemp ) ;
            iortemps.add( iortemp ) ;
        }

        iortemp.add( ptemp ) ;
    }

    iortemps.makeImmutable() ;
}
 
Example #30
Source File: CorbaServerRequestDispatcherImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private ObjectAdapter findObjectAdapter(ObjectKeyTemplate oktemp)
{
    try {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter->");
        }

        RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
        int scid = oktemp.getSubcontractId() ;
        ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(scid);
        if (oaf == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdapterFactory");
            }

            throw wrapper.noObjectAdapterFactory() ;
        }

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        ObjectAdapter oa = oaf.find(oaid);

        if (oa == null) {
            if (orb.subcontractDebugFlag) {
                dprint(".findObjectAdapter: failed to find ObjectAdaptor");
            }

            throw wrapper.badAdapterId() ;
        }

        return oa ;
    } finally {
        if (orb.subcontractDebugFlag) {
            dprint(".findObjectAdapter<-");
        }
    }
}