Package org.jacorb.orb.iiop

Examples of org.jacorb.orb.iiop.IIOPProfile


        try
        {
            address = new IIOPAddress (host, port);
            address.configure(configuration);

            IIOPProfile iiopProfile = new IIOPProfile(address, object_key, ((org.jacorb.orb.ORB)orb).getGIOPMinorVersion());
            iiopProfile.configure(configuration);

            connection = cm.getConnection(iiopProfile);
        }
        catch(ConfigurationException e)
        {
View Full Code Here


            IIOPAddress addr = new IIOPAddress (_poa.host,(short)_poa.port);
            org.omg.IOP.IOR _ior = null;
            try
            {
                addr.configure(configuration);
                IIOPProfile p = new IIOPProfile (addr,object_key,giop_minor);
                p.configure(configuration);
                _ior = ParsedIOR.createObjectIOR ((ORB)orb, p);
            }
            catch(ConfigurationException e)
            {
                logger.error("Error while configuring address/profile", e);
View Full Code Here

       if( nrOfProf != 1 )
       {
          throw new RuntimeException ("unexpected number of IOP Profiles: " + nrOfProf);
       }

       IIOPProfile primaryProf =
           (IIOPProfile) infoExt.get_profile(TAG_INTERNET_IOP.value, 0);
       try
       {
          // now add alternate addresses to primary profile
           for (Iterator<IIOPAddress> i = alternateAddresses.iterator(); i.hasNext();) {

             IIOPAddress addr = i.next();
             primaryProf.addComponent( TAG_ALTERNATE_IIOP_ADDRESS.value, addr.toCDR() );
          }

           // now add a secondary and third profile like used e.g. by
           // Visibroker 4.5
          for (Iterator<IIOPAddress> i = alternateAddresses.iterator(); i.hasNext();)
          {
              IIOPAddress addr = i.next();

              IIOPProfile additionalProfile =
                  (IIOPProfile) primaryProf.clone();

              additionalProfile.patchPrimaryAddress(addr);

              infoExt.add_profile(additionalProfile);
          }
       }
       catch ( CloneNotSupportedException ex )
       {
          throw new RuntimeException ("Exception during cloning of profile: "
                                      + ex);
       }

       nrOfProf = infoExt.get_number_of_profiles(TAG_INTERNET_IOP.value);
       if( nrOfProf != 1 + alternateAddresses.size())
       {
          throw new RuntimeException ("unexpected number of IOP Profiles after addition: "
                                      + nrOfProf
                                      + ", where number of alternates was: "
                                      + alternateAddresses.size());
       }

       // check access functions
       primaryProf =
           (IIOPProfile) infoExt.get_profile(TAG_INTERNET_IOP.value, 0);
       IIOPProfile primaryProf2 =
           (IIOPProfile) infoExt.get_profile(TAG_INTERNET_IOP.value);
       // they should be equal to primary
       if ( ! primaryProf.equals(primaryProf2) )
       {
          throw new RuntimeException ("difference between "
View Full Code Here

    @Test
    public void testSSLIOPCorbalocRequiresGIOP12_1() throws Exception
    {
        try
        {
            IIOPProfile profile = new IIOPProfile("corbaloc:ssliop:localhost:" + sslPort + objectKey);
            profile.configure(((org.jacorb.orb.ORB)setup.getClientOrb()).getConfiguration());
            fail();
        }
        catch(IllegalArgumentException e)
        {
        }
View Full Code Here


    @Before
    public void setUp() throws Exception
    {
        iiopProfile = new IIOPProfile( new IIOPAddress( "localhost", 4000 ),
                                       null,
                                       getORB().getGIOPMinorVersion());
    }
View Full Code Here

            }

            if (profile instanceof IIOPProfile)
            {
                // Special case check for IIOP profile supporting SSL
                IIOPProfile iiopProfile = (IIOPProfile) profile;
                if (tagToMatch == ORBConstants.JAC_SSL_PROFILE_ID &&
                    iiopProfile.getSSL () != null)
                {
                    return true;
                }

                // Special case check for IIOP profile not supporting SSL
                if (tagToMatch == ORBConstants.JAC_NOSSL_PROFILE_ID &&
                    (iiopProfile.getSSL () == null ||
                     // SSL port contains a valid value but further check is required
                     // see if protection is enabled.
                     (((iiopProfile.getSSL()).target_requires &
                       org.omg.Security.NoProtection.value) != 0)))
                {
                    return true;
                }
            }
View Full Code Here

       {
           if (profiles[i].tag == TAG_INTERNET_IOP.value)
           {
               if( cnt == 0 )
              {
                  IIOPProfile prof = new IIOPProfile(profiles[i].profile_data);
                  assertEquals(((IIOPAddress)prof.getAddress()).getIP(), host);
                  assertEquals(((IIOPAddress)prof.getAddress()).getPort(), port);
                  found = true;
                  break;
              }
               cnt--;
               continue;
View Full Code Here

            }
        }

        // 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;
View Full Code Here

            {
                List<Profile> plist = imr.getImRProfiles();
                int cnt = 0;
                for (Iterator<Profile> iter = plist.iterator(); iter.hasNext();)
                {
                    IIOPProfile p = (IIOPProfile) iter.next();
                    // add all IMR endpoints (except the first primary one)
                    // to the alternate endpoint list as well
                    if (cnt++ != 0)
                    {
                        try
                        {
                            IIOPAddress address =
                                new IIOPAddress(
                                    ((IIOPAddress) p.getAddress()).getOriginalHost(),
                                    ((IIOPAddress) p.getAddress()).getPort()
                                               );
                            address.configure(configuration);
                            list.addComponent (TAG_ALTERNATE_IIOP_ADDRESS.value,
                                               address.toCDR());
                        }
                        catch (org.jacorb.config.ConfigurationException e)
                        {
                            logger.warn(
                                "patchTagAlternateIIOPAddresses: got an exception, "
                                + e.getMessage());
                        }
                    }

                    List<IIOPAddress> addrList = p.getAlternateAddresses();
                    if (addrList == null)
                    {
                        continue;
                    }
View Full Code Here

TOP

Related Classes of org.jacorb.orb.iiop.IIOPProfile

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.