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

The following examples show how to use com.sun.corba.se.spi.ior.IORFactories. 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: CDROutputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example #2
Source File: POAImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #3
Source File: POAImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #4
Source File: BootstrapResolverImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public BootstrapResolverImpl(ORB orb, String host, int port) {
    wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.ORB_RESOLVER ) ;

    // Create a new IOR with the magic of INIT
    byte[] initialKey = "INIT".getBytes() ;
    ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;

    IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
    IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
        orb, GIOPVersion.V1_0, addr);

    IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
    iortemp.add( ptemp ) ;

    IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
        "", okey.getId() ) ;

    bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
 
Example #5
Source File: CDROutputStream_1_0.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example #6
Source File: BootstrapResolverImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public BootstrapResolverImpl(ORB orb, String host, int port) {
    wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.ORB_RESOLVER ) ;

    // Create a new IOR with the magic of INIT
    byte[] initialKey = "INIT".getBytes() ;
    ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;

    IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
    IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
        orb, GIOPVersion.V1_0, addr);

    IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
    iortemp.add( ptemp ) ;

    IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
        "", okey.getId() ) ;

    bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
 
Example #7
Source File: CDROutputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example #8
Source File: POAImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
private byte[] internalReferenceToId(
    org.omg.CORBA.Object reference ) throws WrongAdapter
{
    IOR ior = ORBUtility.getIOR( reference ) ;
    IORTemplateList thisTemplate = ior.getIORTemplates() ;

    ObjectReferenceFactory orf = getCurrentFactory() ;
    IORTemplateList poaTemplate =
        IORFactories.getIORTemplateList( orf ) ;

    if (!poaTemplate.isEquivalent( thisTemplate ))
        throw new WrongAdapter();

    // Extract the ObjectId from the first TaggedProfile in the IOR.
    // If ior was created in this POA, the same ID was used for
    // every profile through the profile templates in the currentFactory,
    // so we will get the same result from any profile.
    Iterator iter = ior.iterator() ;
    if (!iter.hasNext())
        throw iorWrapper().noProfilesInIor() ;
    TaggedProfile prof = (TaggedProfile)(iter.next()) ;
    ObjectId oid = prof.getObjectId() ;

    return oid.getId();
}
 
Example #9
Source File: BootstrapResolverImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public BootstrapResolverImpl(ORB orb, String host, int port) {
    wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.ORB_RESOLVER ) ;

    // Create a new IOR with the magic of INIT
    byte[] initialKey = "INIT".getBytes() ;
    ObjectKey okey = orb.getObjectKeyFactory().create(initialKey) ;

    IIOPAddress addr = IIOPFactories.makeIIOPAddress( orb, host, port ) ;
    IIOPProfileTemplate ptemp = IIOPFactories.makeIIOPProfileTemplate(
        orb, GIOPVersion.V1_0, addr);

    IORTemplate iortemp = IORFactories.makeIORTemplate( okey.getTemplate() ) ;
    iortemp.add( ptemp ) ;

    IOR initialIOR = iortemp.makeIOR( (com.sun.corba.se.spi.orb.ORB)orb,
        "", okey.getId() ) ;

    bootstrapDelegate = ORBUtility.makeClientDelegate( initialIOR ) ;
}
 
Example #10
Source File: CDROutputStream_1_0.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
public void write_Object(org.omg.CORBA.Object ref)
{
    if (ref == null) {
        IOR nullIOR = IORFactories.makeIOR( orb ) ;
        nullIOR.write(parent);
        return;
    }

    // IDL to Java formal 01-06-06 1.21.4.2
    if (ref instanceof org.omg.CORBA.LocalObject)
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);

    IOR ior = ORBUtility.connectAndGetIOR( orb, ref ) ;
    ior.write(parent);
    return;
}
 
Example #11
Source File: ORBConfiguratorImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initIORFinders( ORB orb )
{
    IdentifiableFactoryFinder profFinder =
        orb.getTaggedProfileFactoryFinder() ;
    profFinder.registerFactory( IIOPFactories.makeIIOPProfileFactory() ) ;

    IdentifiableFactoryFinder profTempFinder =
        orb.getTaggedProfileTemplateFactoryFinder() ;
    profTempFinder.registerFactory(
        IIOPFactories.makeIIOPProfileTemplateFactory() ) ;

    IdentifiableFactoryFinder compFinder =
        orb.getTaggedComponentFactoryFinder() ;
    compFinder.registerFactory(
        IIOPFactories.makeCodeSetsComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaCodebaseComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeORBTypeComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeMaxStreamFormatVersionComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeAlternateIIOPAddressComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeRequestPartitioningComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaSerializationComponentFactory());

    // Register the ValueFactory instances for ORT
    IORFactories.registerValueFactories( orb ) ;

    // Register an ObjectKeyFactory
    orb.setObjectKeyFactory( IORFactories.makeObjectKeyFactory(orb) ) ;
}
 
Example #12
Source File: ReplyMessage_1_1.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR(cdr) ;
    }
}
 
Example #13
Source File: ObjectReferenceFactoryImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/** Read the data into a (presumably) empty ObjectReferenceFactoryImpl.
* This sets the orb to the ORB of the InputStream.
*/
public void _read( InputStream is )
{
    org.omg.CORBA_2_3.portable.InputStream istr =
        (org.omg.CORBA_2_3.portable.InputStream)is ;

    iorTemplates = IORFactories.makeIORTemplateList( istr ) ;
}
 
Example #14
Source File: ObjectReferenceTemplateImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public IORTemplateList getIORTemplateList()
{
    IORTemplateList tl = IORFactories.makeIORTemplateList() ;
    tl.add( iorTemplate ) ;
    tl.makeImmutable() ;
    return tl ;
}
 
Example #15
Source File: ObjectReferenceTemplateImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public IORTemplateList getIORTemplateList()
{
    IORTemplateList tl = IORFactories.makeIORTemplateList() ;
    tl.add( iorTemplate ) ;
    tl.makeImmutable() ;
    return tl ;
}
 
Example #16
Source File: ORBConfiguratorImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void initIORFinders( ORB orb )
{
    IdentifiableFactoryFinder profFinder =
        orb.getTaggedProfileFactoryFinder() ;
    profFinder.registerFactory( IIOPFactories.makeIIOPProfileFactory() ) ;

    IdentifiableFactoryFinder profTempFinder =
        orb.getTaggedProfileTemplateFactoryFinder() ;
    profTempFinder.registerFactory(
        IIOPFactories.makeIIOPProfileTemplateFactory() ) ;

    IdentifiableFactoryFinder compFinder =
        orb.getTaggedComponentFactoryFinder() ;
    compFinder.registerFactory(
        IIOPFactories.makeCodeSetsComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaCodebaseComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeORBTypeComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeMaxStreamFormatVersionComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeAlternateIIOPAddressComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeRequestPartitioningComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaSerializationComponentFactory());

    // Register the ValueFactory instances for ORT
    IORFactories.registerValueFactories( orb ) ;

    // Register an ObjectKeyFactory
    orb.setObjectKeyFactory( IORFactories.makeObjectKeyFactory(orb) ) ;
}
 
Example #17
Source File: ObjectAdapterBase.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
final public void initializeTemplate( ObjectKeyTemplate oktemp,
    boolean notifyORB, Policies policies, String codebase,
    String objectAdapterManagerId, ObjectAdapterId objectAdapterId)
{
    adapterId = oktemp.getAdapterId() ;

    iortemp = IORFactories.makeIORTemplate(oktemp) ;

    // This calls acceptors which create profiles and may
    // add tagged components to those profiles.
    orb.getCorbaTransportManager().addToIORTemplate(
        iortemp, policies,
        codebase, objectAdapterManagerId, objectAdapterId);

    adapterTemplate = IORFactories.makeObjectReferenceTemplate( orb,
        iortemp ) ;
    currentFactory = adapterTemplate ;

    if (notifyORB) {
        PIHandler pih = orb.getPIHandler() ;
        if (pih != null)
            // This runs the IORInterceptors.
            pih.objectAdapterCreated( this ) ;
    }

    iortemp.makeImmutable() ;
}
 
Example #18
Source File: IDLJavaSerializationOutputStream.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example #19
Source File: ObjectReferenceProducerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #20
Source File: ReplyMessage_1_1.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }
    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR(cdr) ;
    }
}
 
Example #21
Source File: LocateReplyMessage_1_1.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body if status is OBJECT_FORWARD
    if (this.reply_status == OBJECT_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example #22
Source File: ReplyMessage_1_0.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example #23
Source File: IDLJavaSerializationOutputStream.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example #24
Source File: IORTemplateListImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public IORTemplateListImpl( InputStream is )
{
    this() ;
    int size = is.read_long() ;
    for (int ctr=0; ctr<size; ctr++) {
        IORTemplate iortemp = IORFactories.makeIORTemplate( is ) ;
        add( iortemp ) ;
    }

    makeImmutable() ;
}
 
Example #25
Source File: IORTemplateListImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public IORTemplateListImpl( InputStream is )
{
    this() ;
    int size = is.read_long() ;
    for (int ctr=0; ctr<size; ctr++) {
        IORTemplate iortemp = IORFactories.makeIORTemplate( is ) ;
        add( iortemp ) ;
    }

    makeImmutable() ;
}
 
Example #26
Source File: ObjectReferenceProducerBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public org.omg.CORBA.Object make_object (String repositoryId,
    byte[] objectId)
{
    ObjectId oid = IORFactories.makeObjectId( objectId ) ;
    IOR ior = getIORFactory().makeIOR( orb, repositoryId, oid ) ;

    return ORBUtility.makeObjectReference( ior ) ;
}
 
Example #27
Source File: ReplyMessage_1_0.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void read(org.omg.CORBA.portable.InputStream istream) {
    super.read(istream);
    this.service_contexts
        = new ServiceContexts((org.omg.CORBA_2_3.portable.InputStream) istream);
    this.request_id = istream.read_ulong();
    this.reply_status = istream.read_long();
    isValidReplyStatus(this.reply_status); // raises exception on error

    // The code below reads the reply body in some cases
    // SYSTEM_EXCEPTION & LOCATION_FORWARD
    if (this.reply_status == SYSTEM_EXCEPTION) {

        String reposId = istream.read_string();
        this.exClassName = ORBUtility.classNameOf(reposId);
        this.minorCode = istream.read_long();
        int status = istream.read_long();

        switch (status) {
        case CompletionStatus._COMPLETED_YES:
            this.completionStatus = CompletionStatus.COMPLETED_YES;
            break;
        case CompletionStatus._COMPLETED_NO:
            this.completionStatus = CompletionStatus.COMPLETED_NO;
            break;
        case CompletionStatus._COMPLETED_MAYBE:
            this.completionStatus = CompletionStatus.COMPLETED_MAYBE;
            break;
        default:
            throw wrapper.badCompletionStatusInReply(
                CompletionStatus.COMPLETED_MAYBE, new Integer(status) );
        }

    } else if (this.reply_status == USER_EXCEPTION) {
        // do nothing. The client stub will read the exception from body.
    } else if (this.reply_status == LOCATION_FORWARD) {
        CDRInputStream cdr = (CDRInputStream) istream;
        this.ior = IORFactories.makeIOR( cdr ) ;
    }
}
 
Example #28
Source File: ORBConfiguratorImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initIORFinders( ORB orb )
{
    IdentifiableFactoryFinder profFinder =
        orb.getTaggedProfileFactoryFinder() ;
    profFinder.registerFactory( IIOPFactories.makeIIOPProfileFactory() ) ;

    IdentifiableFactoryFinder profTempFinder =
        orb.getTaggedProfileTemplateFactoryFinder() ;
    profTempFinder.registerFactory(
        IIOPFactories.makeIIOPProfileTemplateFactory() ) ;

    IdentifiableFactoryFinder compFinder =
        orb.getTaggedComponentFactoryFinder() ;
    compFinder.registerFactory(
        IIOPFactories.makeCodeSetsComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaCodebaseComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeORBTypeComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeMaxStreamFormatVersionComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeAlternateIIOPAddressComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeRequestPartitioningComponentFactory() ) ;
    compFinder.registerFactory(
        IIOPFactories.makeJavaSerializationComponentFactory());

    // Register the ValueFactory instances for ORT
    IORFactories.registerValueFactories( orb ) ;

    // Register an ObjectKeyFactory
    orb.setObjectKeyFactory( IORFactories.makeObjectKeyFactory(orb) ) ;
}
 
Example #29
Source File: IDLJavaSerializationOutputStream.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public final void write_Object(org.omg.CORBA.Object value) {
    if (value == null) {
        IOR nullIOR = IORFactories.makeIOR(orb);
        nullIOR.write(parent);
        return;
    }
    // IDL to Java formal 01-06-06 1.21.4.2
    if (value instanceof org.omg.CORBA.LocalObject) {
        throw wrapper.writeLocalObject(CompletionStatus.COMPLETED_MAYBE);
    }
    IOR ior = ORBUtility.connectAndGetIOR(orb, value);
    ior.write(parent);
    return;
}
 
Example #30
Source File: ObjectAdapterBase.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
final public void initializeTemplate( ObjectKeyTemplate oktemp,
    boolean notifyORB, Policies policies, String codebase,
    String objectAdapterManagerId, ObjectAdapterId objectAdapterId)
{
    adapterId = oktemp.getAdapterId() ;

    iortemp = IORFactories.makeIORTemplate(oktemp) ;

    // This calls acceptors which create profiles and may
    // add tagged components to those profiles.
    orb.getCorbaTransportManager().addToIORTemplate(
        iortemp, policies,
        codebase, objectAdapterManagerId, objectAdapterId);

    adapterTemplate = IORFactories.makeObjectReferenceTemplate( orb,
        iortemp ) ;
    currentFactory = adapterTemplate ;

    if (notifyORB) {
        PIHandler pih = orb.getPIHandler() ;
        if (pih != null)
            // This runs the IORInterceptors.
            pih.objectAdapterCreated( this ) ;
    }

    iortemp.makeImmutable() ;
}