org.omg.PortableInterceptor.ObjectReferenceFactory Java Examples

The following examples show how to use org.omg.PortableInterceptor.ObjectReferenceFactory. 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: POAImpl.java    From openjdk-jdk8u-backup 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 #2
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 #3
Source File: POAImpl.java    From openjdk-8-source 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: 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 #5
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 #6
Source File: POAImpl.java    From JDKSourceCode1.8 with MIT License 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 #7
Source File: POAImpl.java    From openjdk-jdk8u 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 #8
Source File: IORFactories.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #9
Source File: TOAImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #10
Source File: TOAImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #11
Source File: IORFactories.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #12
Source File: IORFactories.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #13
Source File: TOAImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #14
Source File: TOAImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #15
Source File: IORFactories.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #16
Source File: IORFactories.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #17
Source File: IORFactories.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #18
Source File: TOAImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #19
Source File: IORFactories.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public static IORTemplateList getIORTemplateList( ObjectReferenceFactory orf )
{
    if (orf instanceof ObjectReferenceProducerBase) {
        ObjectReferenceProducerBase base =
            (ObjectReferenceProducerBase)orf ;
        return base.getIORTemplateList() ;
    }

    throw new BAD_PARAM() ;
}
 
Example #20
Source File: TOAImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #21
Source File: TOAImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void connect( org.omg.CORBA.Object objref)
{
    // Store the objref and get a userkey allocated by the transient
    // object manager.
    byte[] key = servants.storeServant(objref, null);

    // Find out the repository ID for this objref.
    String id = StubAdapter.getTypeIds( objref )[0] ;

    // Create the new objref
    ObjectReferenceFactory orf = getCurrentFactory() ;
    org.omg.CORBA.Object obj = orf.make_object( id, key ) ;

    // Copy the delegate from the new objref to the argument
    // XXX handle the case of an attempt to connect a local object.

    org.omg.CORBA.portable.Delegate delegate = StubAdapter.getDelegate(
        obj ) ;
    CorbaContactInfoList ccil = (CorbaContactInfoList)
        ((ClientDelegate)delegate).getContactInfoList() ;
    LocalClientRequestDispatcher lcs =
        ccil.getLocalClientRequestDispatcher() ;

    if (lcs instanceof JIDLLocalCRDImpl) {
        JIDLLocalCRDImpl jlcs = (JIDLLocalCRDImpl)lcs ;
        jlcs.setServant( objref ) ;
    } else {
        throw new RuntimeException(
            "TOAImpl.connect can not be called on " + lcs ) ;
    }

    StubAdapter.setDelegate( objref, delegate ) ;
}
 
Example #22
Source File: ObjectAdapterBase.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
final public ObjectReferenceFactory getCurrentFactory()
{
    return currentFactory ;
}
 
Example #23
Source File: IORInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void current_factory( ObjectReferenceFactory factory )
{
    checkState( STATE_ESTABLISHED) ;

    adapter.setCurrentFactory( factory ) ;
}
 
Example #24
Source File: ObjectAdapterBase.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
final public void setCurrentFactory( ObjectReferenceFactory factory )
{
    currentFactory = factory ;
}
 
Example #25
Source File: IORFactories.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static ObjectReferenceFactory makeObjectReferenceFactory( ORB orb,
    IORTemplateList iortemps )
{
    return new ObjectReferenceFactoryImpl( orb, iortemps ) ;
}
 
Example #26
Source File: IORFactories.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static ObjectReferenceFactory makeObjectReferenceFactory( ORB orb,
    IORTemplateList iortemps )
{
    return new ObjectReferenceFactoryImpl( orb, iortemps ) ;
}
 
Example #27
Source File: ObjectAdapterBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
final public void setCurrentFactory( ObjectReferenceFactory factory )
{
    currentFactory = factory ;
}
 
Example #28
Source File: ObjectAdapterBase.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
final public void setCurrentFactory( ObjectReferenceFactory factory )
{
    currentFactory = factory ;
}
 
Example #29
Source File: IORFactories.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static ObjectReferenceFactory makeObjectReferenceFactory( ORB orb,
    IORTemplateList iortemps )
{
    return new ObjectReferenceFactoryImpl( orb, iortemps ) ;
}
 
Example #30
Source File: ObjectAdapterBase.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
final public void setCurrentFactory( ObjectReferenceFactory factory )
{
    currentFactory = factory ;
}