Package org.omg.ETF

Examples of org.omg.ETF.Profile


     */
    @Override
    public org.omg.ETF.Profile get_profile(int tag, int position)
    {
       int cnt = position;
       Profile result = null;
       for (int i=0; i < _profiles.size(); i++)
       {
           Profile profile = _profiles.get(i);
           if ( profile.tag() == tag && cnt == 0)
           {
              result = profile;
              break;
           }
           cnt--;
View Full Code Here


     *                   tag exists
     */
    @Override
    public org.omg.ETF.Profile get_profile(int tag)
    {
       Profile result = null;
       for (int i=0; i < _profiles.size(); i++)
       {
           Profile profile = _profiles.get(i);
           if ( profile.tag() == tag )
           {
              result = profile;
              break;
           }
       }
View Full Code Here

{
    public Profile selectProfile (List<Profile> profiles, ClientConnectionManager ccm)
    {
        for (Iterator<Profile> i=profiles.iterator(); i.hasNext();)
        {
            Profile p = i.next();
            if (p instanceof org.jacorb.test.orb.etf.wiop.WIOPProfile)
                return p;
        }
        return null;
    }
View Full Code Here

                        if( logger.isDebugEnabled())
                        {
                            logger.debug ("Delegate.try_rebind: binding to next profile <"
                                          + piorOriginal.getTypeIdName() + ">");
                        }
                        Profile newProfile = piorOriginal.getNextEffectiveProfile();
                        if( logger.isDebugEnabled())
                        {
                            Profile lastProfile = piorOriginal.getLastUsedProfile();
                            logger.debug("Delegate.try_rebind: new = " + newProfile + " last = " + lastProfile);
                        }

                        if (newProfile != null &&
                            !newProfile.equals (piorOriginal.getLastUsedProfile()))
                        {
                            piorLastFailed = null;
                            randomMilliSecDelay();
                        }
                        else
                        {
                            return false;
                        }
                    }
                    // If we've already bound to the original there is nothing we can do.
                    else
                    {
                        return false;
                    }
                }
                else
                {
                    // keep last failed ior to detect forwarding loops
                    piorLastFailed = getParsedIOR();
                }

                //rebind to the original ior
                rebind( piorOriginal );

                //clean up and start fresh
                piorLastFailed = null;

                return true;
            }
            else if (getParsedIOR().useCorbaName())
            {
                if (logger.isDebugEnabled())
                {
                    logger.debug ("Delegate.try_rebind: useNameService, " +
                                  "going back to the NameService <" +
                                  getParsedIOR().getCorbaNameOriginalObjRef() + ">");
                }

                piorOriginal = null;
                piorLastFailed = null;

                _pior = new ParsedIOR (orb,
                                       getParsedIOR().getCorbaNameOriginalObjRef());

                rebind(_pior);

                //clean up and start fresh
                piorOriginal = null;
                piorLastFailed = null;

                return true;
            }
            else if (getParsedIOR().getProfiles().size() > 1)
            {
                if( logger.isDebugEnabled())
                {
                    logger.debug ("Delegate.try_rebind: rebinding to next profile <"
                                  + getParsedIOR().getTypeIdName() + ">");
                }

                Profile curProfile = getParsedIOR().getNextEffectiveProfile();
                if( logger.isDebugEnabled())
                {
                    Profile lastProfile = getParsedIOR().getLastUsedProfile();
                    logger.debug("Delegate.try_rebind(no pior): new = " + curProfile + " last = " + lastProfile);
                }

                if (curProfile != null  &&
                    !curProfile.equals (getParsedIOR().getLastUsedProfile()))
View Full Code Here

        int[] profileTags = new int[basicAdapter.getEndpointProfiles().size()];
        int n = 0;
        for (Iterator<Profile> i = basicAdapter.getEndpointProfiles().iterator();
                i.hasNext();)
        {
            Profile profile = i.next();

            //MIOP
            //if it is a group profile, it can't be added to the object ior
            //so do nothing
            if (profile instanceof org.jacorb.orb.miop.MIOPProfile)
            {
                continue;
            }

            profile.set_object_key (objectKey);
            profiles.add (profile);
            profileTags[n++] = profile.tag();

            TaggedComponentList profileComponents = new TaggedComponentList();
            profileComponents.addComponent(create_ORB_TYPE_ID());
            componentMap.put(Integer.valueOf(profile.tag()), profileComponents);

            if (profile instanceof ProfileBase)
            {
                // use proxy or ImR address if necessary
                patchAddress((ProfileBase)profile, repId, _transient);

                // patch primary address port to 0 if SSL is required
                if (poa.isSSLRequired())
                {
                    ((ProfileBase)profile).patchPrimaryAddress(new IIOPAddress(null, 0));
                }
            }
        }

        TaggedComponentList multipleComponents = new TaggedComponentList();
        componentMap.put(Integer.valueOf(TAG_MULTIPLE_COMPONENTS.value),
                         multipleComponents);

        // invoke IOR interceptors
        if ((interceptor_manager != null) &&
                interceptor_manager.hasIORInterceptors())
        {
            IORInfoImpl info = new IORInfoImpl(this,
                                               poa,
                                               componentMap,
                                               policy_overrides,
                                               profiles);
            try
            {
                interceptor_manager.getIORIterator().iterate( info );
            }
            catch (Exception e)
            {
                if (logger.isErrorEnabled())
                {
                    logger.error(e.getMessage());
                }
            }
        }

        // add GIOP 1.0 profile if necessary

        IIOPProfile iiopProfile = findIIOPProfile(profiles);
        if ( (iiopProfile != null)
                && ( this.giopMinorVersion == 0 || this.giopAdd_1_0_Profiles ))
        {
            Profile profile_1_0 = iiopProfile.to_GIOP_1_0();
            profiles.add(profile_1_0);

            // shuffle all components over into the multiple components profile
            TaggedComponentList iiopComponents =
                componentMap.get(Integer.valueOf(TAG_INTERNET_IOP.value));

            multipleComponents.addAll(iiopProfile.getComponents());
            multipleComponents.addAll(iiopComponents);

            // if we only want GIOP 1.0, remove the other profile
            if (giopMinorVersion == 0)
            {
                profiles.remove(iiopProfile);
            }
        }
        if (iiopProfile != null)
        {
            TaggedComponentList components =
                componentMap.get(Integer.valueOf(TAG_INTERNET_IOP.value));

            // patch primary address port to 0 if SSL is required
            if (isSSLRequiredInComponentList(components))
            {
                iiopProfile.patchPrimaryAddress(new IIOPAddress(null, 0));
            }
        }

        // marshal the profiles into the IOR and return
        TaggedProfile[] tps = null;
        if (multipleComponents.isEmpty())
        {
            tps = new TaggedProfile [profiles.size()];
        }
        else
        {
            tps = new TaggedProfile [profiles.size() + 1];
            tps[tps.length-1] =
                createMultipleComponentsProfile(multipleComponents);
        }

        TaggedComponentSeqHolder  tc = new TaggedComponentSeqHolder();
        final TaggedProfileHolder tp = new TaggedProfileHolder();

        for (int i = 0; i < profiles.size(); i++)
        {
            final Profile p = profiles.get(i);
            TaggedComponentList clist =
                componentMap.get(Integer.valueOf(p.tag()));

            final TaggedComponentList c;
            if (p instanceof ProfileBase)
            {
                // If ImR is used, then get rid of direct alternate addresses
                // and patch in the ImR alternate addresses.

                c = patchTagAlternateIIOPAddresses((ProfileBase) p, clist, repId, _transient);
            }
            else
            {

                c = clist;
            }
            tc.value = c.asArray();
            p.marshal (tp, tc);
            tps[i] = tp.value;
        }

        return new IOR(repId, tps);
    }
View Full Code Here

     */
    private IIOPProfile findIIOPProfile (List profiles)
    {
        for (Iterator i = profiles.iterator(); i.hasNext();)
        {
            Profile p = (Profile)i.next();
            if (p instanceof IIOPProfile)
            {
                return (IIOPProfile)p;
            }
        }
View Full Code Here

            //property not set

            List<Profile> eplist = getBasicAdapter().getEndpointProfiles();
            for (Iterator<Profile> i = eplist.iterator(); i.hasNext(); )
            {
                Profile p = i.next();
                if (p instanceof IIOPProfile)
                {
                    address = ((IIOPProfile)p).getAddress();
                    break;
                }
View Full Code Here

        // locate the last profile in the list
        Iterator<Profile> iterator;
        for (iterator = profileList.iterator(); iterator.hasNext();)
        {
            Profile p = iterator.next();

            if (lastProfile != null)
            {
                if (lastProfile.equals(p))
                {
                    break;
                }
            }
            else if (validate (p))
            {
                currentProfile = p;
                return p;
            }
        }

        // if we exit the loop but lastProfile is null, that means no
        // valid profiles were found.
        if (lastProfile == null)
        {
            currentProfile = null;
            return null;
        }

        // return the next profile, which is next to the last profile.
        while (true)
        {
            if (!iterator.hasNext())
            {
                iterator = profileList.iterator();
            }
            Profile p = iterator.next();
            if (lastProfile.equals (p))
            {
                // came all the way back around
                break;
            }
View Full Code Here

    */
   private MIOPProfile getMIOPProfile (org.omg.CORBA.Object ref) throws NotAGroupObject
   {
      Delegate delegate = (Delegate)((ObjectImpl)ref)._get_delegate ();

      Profile profile = delegate.getParsedIOR ().getEffectiveProfile ();

      if (profile instanceof MIOPProfile)
      {
         return (MIOPProfile)profile;
      }
View Full Code Here

TOP

Related Classes of org.omg.ETF.Profile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.