Java Code Examples for com.sun.corba.se.spi.ior.ObjectAdapterId

The following examples show how to use com.sun.corba.se.spi.ior.ObjectAdapterId. These examples are extracted from open source projects. 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
public boolean equals( Object other )
{
    if (!(other instanceof ObjectAdapterId))
        return false ;

    ObjectAdapterId theOther = (ObjectAdapterId)other ;

    Iterator iter1 = iterator() ;
    Iterator iter2 = theOther.iterator() ;

    while (iter1.hasNext() && iter2.hasNext()) {
        String str1 = (String)(iter1.next()) ;
        String str2 = (String)(iter2.next()) ;

        if (!str1.equals( str2 ))
            return false ;
    }

    return iter1.hasNext() == iter2.hasNext() ;
}
 
Example 2
public boolean equals( Object other )
{
    if (!(other instanceof ObjectAdapterId))
        return false ;

    ObjectAdapterId theOther = (ObjectAdapterId)other ;

    Iterator iter1 = iterator() ;
    Iterator iter2 = theOther.iterator() ;

    while (iter1.hasNext() && iter2.hasNext()) {
        String str1 = (String)(iter1.next()) ;
        String str2 = (String)(iter2.next()) ;

        if (!str1.equals( str2 ))
            return false ;
    }

    return iter1.hasNext() == iter2.hasNext() ;
}
 
Example 3
public boolean equals( Object other )
{
    if (!(other instanceof ObjectAdapterId))
        return false ;

    ObjectAdapterId theOther = (ObjectAdapterId)other ;

    Iterator iter1 = iterator() ;
    Iterator iter2 = theOther.iterator() ;

    while (iter1.hasNext() && iter2.hasNext()) {
        String str1 = (String)(iter1.next()) ;
        String str2 = (String)(iter2.next()) ;

        if (!str1.equals( str2 ))
            return false ;
    }

    return iter1.hasNext() == iter2.hasNext() ;
}
 
Example 4
public Collection getAcceptors(String objectAdapterManagerId,
                               ObjectAdapterId objectAdapterId)
{
    // REVISIT - need to filter based on arguments.

    // REVISIT - initialization will be moved to OA.
    // Lazy initialization of acceptors.
    Iterator iterator = acceptors.iterator();
    while (iterator.hasNext()) {
        Acceptor acceptor = (Acceptor) iterator.next();
        if (acceptor.initialize()) {
            if (acceptor.shouldRegisterAcceptEvent()) {
                orb.getTransportManager().getSelector(0)
                    .registerForEvent(acceptor.getEventHandler());
            }
        }
    }
    return acceptors;
}
 
Example 5
Source Project: jdk8u60   Source File: ObjectAdapterIdBase.java    License: GNU General Public License v2.0 6 votes vote down vote up
public boolean equals( Object other )
{
    if (!(other instanceof ObjectAdapterId))
        return false ;

    ObjectAdapterId theOther = (ObjectAdapterId)other ;

    Iterator iter1 = iterator() ;
    Iterator iter2 = theOther.iterator() ;

    while (iter1.hasNext() && iter2.hasNext()) {
        String str1 = (String)(iter1.next()) ;
        String str2 = (String)(iter2.next()) ;

        if (!str1.equals( str2 ))
            return false ;
    }

    return iter1.hasNext() == iter2.hasNext() ;
}
 
Example 6
public Collection getAcceptors(String objectAdapterManagerId,
                               ObjectAdapterId objectAdapterId)
{
    // REVISIT - need to filter based on arguments.

    // REVISIT - initialization will be moved to OA.
    // Lazy initialization of acceptors.
    Iterator iterator = acceptors.iterator();
    while (iterator.hasNext()) {
        Acceptor acceptor = (Acceptor) iterator.next();
        if (acceptor.initialize()) {
            if (acceptor.shouldRegisterAcceptEvent()) {
                orb.getTransportManager().getSelector(0)
                    .registerForEvent(acceptor.getEventHandler());
            }
        }
    }
    return acceptors;
}
 
Example 7
public boolean equals( Object other )
{
    if (!(other instanceof ObjectAdapterId))
        return false ;

    ObjectAdapterId theOther = (ObjectAdapterId)other ;

    Iterator iter1 = iterator() ;
    Iterator iter2 = theOther.iterator() ;

    while (iter1.hasNext() && iter2.hasNext()) {
        String str1 = (String)(iter1.next()) ;
        String str2 = (String)(iter2.next()) ;

        if (!str1.equals( str2 ))
            return false ;
    }

    return iter1.hasNext() == iter2.hasNext() ;
}
 
Example 8
public Collection getAcceptors(String objectAdapterManagerId,
                               ObjectAdapterId objectAdapterId)
{
    // REVISIT - need to filter based on arguments.

    // REVISIT - initialization will be moved to OA.
    // Lazy initialization of acceptors.
    Iterator iterator = acceptors.iterator();
    while (iterator.hasNext()) {
        Acceptor acceptor = (Acceptor) iterator.next();
        if (acceptor.initialize()) {
            if (acceptor.shouldRegisterAcceptEvent()) {
                orb.getTransportManager().getSelector(0)
                    .registerForEvent(acceptor.getEventHandler());
            }
        }
    }
    return acceptors;
}
 
Example 9
Source Project: jdk1.8-source-analysis   Source File: ObjectAdapterBase.java    License: 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() ;
}
 
Example 10
/** Return the servant for this IOR, if it is local AND if the OA that
 * implements this objref supports direct access to servants outside of an
 * invocation.
 * XXX revisit: do we want this at all?  If we do, it might move to the
 * ObjectKeyTemplate instead.
 */
public java.lang.Object getServant()
{
    if (!isLocal())
        return null ;

    RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
    ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(
        oktemp.getSubcontractId() ) ;

    ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
    ObjectAdapter oa = null ;

    try {
        oa = oaf.find( oaid ) ;
    } catch (SystemException exc) {
        // Could not find the OA, so just return null.
        // This usually happens when POAs are being deleted,
        // and the POA always return null for getLocalServant anyway.
        wrapper.getLocalServantFailure( exc, oaid.toString() ) ;
        return null ;
    }

    byte[] boid = oid.getId() ;
    java.lang.Object servant = oa.getLocalServant( boid ) ;
    return servant ;
}
 
Example 11
public POAObjectKeyTemplate( ORB orb, int scid, int serverid, String orbid,
    ObjectAdapterId objectAdapterId)
{
    super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, orbid,
        objectAdapterId ) ;

    setORBVersion( ORBVersionFactory.getORBVersion() ) ;
}
 
Example 12
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 13
Source Project: jdk1.8-source-analysis   Source File: TOAFactory.java    License: Apache License 2.0 5 votes vote down vote up
public ObjectAdapter find ( ObjectAdapterId oaid )
{
    if (oaid.equals( ObjectKeyTemplateBase.JIDL_OAID )  )
        // Return the dispatch-only TOA, which can dispatch
        // request for objects created by any TOA.
        return getTOA() ;
    else
        throw wrapper.badToaOaid() ;
}
 
Example 14
public NewObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid,
    String orbid, ObjectAdapterId oaid )
{
    super( orb, magic, scid, serverid, orbid, oaid ) ;
    // subclass must set the version, since we don't have the object key here.

    if (magic != ObjectKeyFactoryImpl.JAVAMAGIC_NEWER)
        throw wrapper.badMagic( new Integer( magic ) ) ;
}
 
Example 15
synchronized public String[] adapter_name()
{
    checkAccess( MID_ADAPTER_NAME ) ;

    if (adapterName == null) {
        checkForNullTemplate() ;

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        adapterName = oaid.getAdapterName() ;
    }

    return adapterName ;
}
 
Example 16
synchronized public String[] adapter_name()
{
    checkAccess( MID_ADAPTER_NAME ) ;

    if (adapterName == null) {
        checkForNullTemplate() ;

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        adapterName = oaid.getAdapterName() ;
    }

    return adapterName ;
}
 
Example 17
Source Project: openjdk-8   Source File: IIOPProfileImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
/** Return the servant for this IOR, if it is local AND if the OA that
 * implements this objref supports direct access to servants outside of an
 * invocation.
 * XXX revisit: do we want this at all?  If we do, it might move to the
 * ObjectKeyTemplate instead.
 */
public java.lang.Object getServant()
{
    if (!isLocal())
        return null ;

    RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
    ObjectAdapterFactory oaf = scr.getObjectAdapterFactory(
        oktemp.getSubcontractId() ) ;

    ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
    ObjectAdapter oa = null ;

    try {
        oa = oaf.find( oaid ) ;
    } catch (SystemException exc) {
        // Could not find the OA, so just return null.
        // This usually happens when POAs are being deleted,
        // and the POA always return null for getLocalServant anyway.
        wrapper.getLocalServantFailure( exc, oaid.toString() ) ;
        return null ;
    }

    byte[] boid = oid.getId() ;
    java.lang.Object servant = oa.getLocalServant( boid ) ;
    return servant ;
}
 
Example 18
public POAObjectKeyTemplate( ORB orb, int scid, int serverid, String orbid,
    ObjectAdapterId objectAdapterId)
{
    super( orb, ObjectKeyFactoryImpl.JAVAMAGIC_NEWER, scid, serverid, orbid,
        objectAdapterId ) ;

    setORBVersion( ORBVersionFactory.getORBVersion() ) ;
}
 
Example 19
public void addToIORTemplate(IORTemplate iorTemplate,
                             Policies policies,
                             String codebase,
                             String objectAdapterManagerId,
                             ObjectAdapterId objectAdapterId)
{
    Iterator iterator =
        getAcceptors(objectAdapterManagerId, objectAdapterId).iterator();
    while (iterator.hasNext()) {
        CorbaAcceptor acceptor = (CorbaAcceptor) iterator.next();
        acceptor.addToIORTemplate(iorTemplate, policies, codebase);
    }
}
 
Example 20
Source Project: hottub   Source File: ServerRequestInfoImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
synchronized public String[] adapter_name()
{
    checkAccess( MID_ADAPTER_NAME ) ;

    if (adapterName == null) {
        checkForNullTemplate() ;

        ObjectAdapterId oaid = oktemp.getObjectAdapterId() ;
        adapterName = oaid.getAdapterName() ;
    }

    return adapterName ;
}
 
Example 21
public ObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid,
    String orbid, ObjectAdapterId oaid )
{
    this.orb = orb ;
    this.wrapper = IORSystemException.get( orb,
        CORBALogDomains.OA_IOR ) ;
    this.magic = magic ;
    this.scid = scid ;
    this.serverid = serverid ;
    this.orbid = orbid ;
    this.oaid = oaid ;

    adapterId = computeAdapterId() ;
}
 
Example 22
Source Project: openjdk-8   Source File: TOAFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ObjectAdapter find ( ObjectAdapterId oaid )
{
    if (oaid.equals( ObjectKeyTemplateBase.JIDL_OAID )  )
        // Return the dispatch-only TOA, which can dispatch
        // request for objects created by any TOA.
        return getTOA() ;
    else
        throw wrapper.badToaOaid() ;
}
 
Example 23
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 24
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 25
public void addToIORTemplate(IORTemplate iorTemplate,
                             Policies policies,
                             String codebase,
                             String objectAdapterManagerId,
                             ObjectAdapterId objectAdapterId)
{
    Iterator iterator =
        getAcceptors(objectAdapterManagerId, objectAdapterId).iterator();
    while (iterator.hasNext()) {
        CorbaAcceptor acceptor = (CorbaAcceptor) iterator.next();
        acceptor.addToIORTemplate(iorTemplate, policies, codebase);
    }
}
 
Example 26
public NewObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid,
    String orbid, ObjectAdapterId oaid )
{
    super( orb, magic, scid, serverid, orbid, oaid ) ;
    // subclass must set the version, since we don't have the object key here.

    if (magic != ObjectKeyFactoryImpl.JAVAMAGIC_NEWER)
        throw wrapper.badMagic( new Integer( magic ) ) ;
}
 
Example 27
Source Project: openjdk-8-source   Source File: TOAFactory.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ObjectAdapter find ( ObjectAdapterId oaid )
{
    if (oaid.equals( ObjectKeyTemplateBase.JIDL_OAID )  )
        // Return the dispatch-only TOA, which can dispatch
        // request for objects created by any TOA.
        return getTOA() ;
    else
        throw wrapper.badToaOaid() ;
}
 
Example 28
public OldObjectKeyTemplateBase( ORB orb, int magic, int scid, int serverid,
    String orbid, ObjectAdapterId oaid )
{
    super( orb, magic, scid, serverid, orbid, oaid ) ;

    // set version based on magic
    if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_OLD)
        setORBVersion( ORBVersionFactory.getOLD() ) ;
    else if (magic == ObjectKeyFactoryImpl.JAVAMAGIC_NEW)
        setORBVersion( ORBVersionFactory.getNEW() ) ;
    else // any other magic should not be here
        throw wrapper.badMagic( new Integer( magic ) ) ;
}
 
Example 29
public String[] adapter_name()
{
    ObjectAdapterId poaid =
        iorTemplate.getObjectKeyTemplate().getObjectAdapterId() ;

    return poaid.getAdapterName() ;
}
 
Example 30
public String[] adapter_name()
{
    ObjectAdapterId poaid =
        iorTemplate.getObjectKeyTemplate().getObjectAdapterId() ;

    return poaid.getAdapterName() ;
}