Package org.jacorb.orb.iiop

Examples of org.jacorb.orb.iiop.IIOPAddress


 
    public void establish_components(IORInfo info)
    {
    for (Iterator i = alternateAddresses.iterator(); i.hasNext();)
    {
      IIOPAddress addr = (IIOPAddress)i.next();
      info.add_ior_component_to_profile
      (
        new TaggedComponent
        (
          TAG_ALTERNATE_IIOP_ADDRESS.value,
          addr.toCDR()
        ),
        TAG_INTERNET_IOP.value
      );
    }
    }
View Full Code Here


        {
            if (addressString == null)
            {
                if (host != null || port != -1)
                {
                    address = new IIOPAddress ();
                    address.configure(configuration);
                    if (host != null)
                    {
                        ((IIOPAddress)address).setHostname(host);
                    }
View Full Code Here

        {
            TaggedComponentList components =
                (TaggedComponentList)componentMap.get(ObjectUtil.newInteger(TAG_INTERNET_IOP.value));
            if(this.isSSLRequiredInComponentList(components))
            {
                iiopProfile.patchPrimaryAddress(new IIOPAddress(null, 0));
            }
        }

        // add GIOP 1.0 profile if necessary
        if ( (iiopProfile != null)
View Full Code Here

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

          // now add alternate addresses to primary profile
           for (Iterator i = alternateAddresses.iterator(); i.hasNext();) {

             IIOPAddress addr = (IIOPAddress)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 i = alternateAddresses.iterator(); i.hasNext();)
          {
              IIOPAddress addr = (IIOPAddress)i.next();

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

              additionalProfile.patchPrimaryAddress(addr);
View Full Code Here

        {
            if (addressString == null)
            {
                if (host != null || port != -1)
                {
                    address = new IIOPAddress ();
                    address.configure(configuration);
                    if (host != null)
                    {
                        ((IIOPAddress)address).setHostname(host);
                    }
View Full Code Here

        {
            TaggedComponentList components =
                (TaggedComponentList)componentMap.get(ObjectUtil.newInteger(TAG_INTERNET_IOP.value));
            if(this.isSSLRequiredInComponentList(components))
            {
                iiopProfile.patchPrimaryAddress(new IIOPAddress(null, 0));
            }
        }

        // add GIOP 1.0 profile if necessary
        if ( (iiopProfile != null)
View Full Code Here

        for( int i = 0; i < bidir_ctx.listen_points.length; i++ )
        {
            ListenPoint listenPoint = bidir_ctx.listen_points[i];

            IIOPAddress addr = new IIOPAddress (listenPoint.host, listenPoint.port);
            try
            {
               addr.configure (orb.getConfiguration ());
            }
            catch( ConfigurationException ce)
            {
                logger.warn("ConfigurationException", ce );
            }
View Full Code Here

        }
    }

    private ProtocolAddressBase createProtocolAddress(String address_str)
    {
        final IIOPAddress address = new IIOPAddress();

        int proto_delim = address_str.indexOf (':');
        Protocol proto;
        try
        {
            proto = Protocol.valueOf(address_str.substring (0,proto_delim).toUpperCase(Locale.ENGLISH));
        }
        catch (IllegalArgumentException e)
        {
            throw new BAD_PARAM("Invalid protocol " + address_str);
        }
        address.setProtocol(proto);
        final int addresss_start_ofs = proto_delim + 3;

        if (!address.fromString(address_str.substring(addresss_start_ofs)))
        {
            throw new org.omg.CORBA.INTERNAL("Invalid protocol address string: " + address_str);
        }

        // set protocol string
View Full Code Here

     * Pick default OAAdress/OASSLAddress pair from property file
     * and add them to the list of endpoint address list.
     */
    private void updateDefaultEndpointAddresses() throws ConfigurationException
    {
        IIOPAddress address = null;
        IIOPAddress ssl_address = null;


        // If we already have an endpoint list defined there is no point creating a default.
        if (listenEndpointList != null && listenEndpointList.size() > 0)
        {
            return;
        }

        ListenEndpoint defaultEndpoint = new ListenEndpoint();

        String address_str = configuration.getAttribute("OAAddress",null);
        if (address_str != null)
        {
            // build an iiop/ssliop protocol address.
            // create_protocol_address will allow iiop and ssliop only
            ProtocolAddressBase addr = createProtocolAddress(address_str);
            address = (IIOPAddress)addr;
            address.configure(configuration);
        }
        else
        {
            int oaPort = configuration.getAttributeAsInteger("OAPort",0);
            String oaHost = configuration.getAttribute("OAIAddr","");
            address = new IIOPAddress(oaHost,oaPort);
            address.configure(configuration);
        }

        String ssl_address_str = configuration.getAttribute("OASSLAddress",null);
        if (ssl_address_str != null)
        {
            // build a protocol address
            ProtocolAddressBase ssl_addr = createProtocolAddress(ssl_address_str);
            ssl_address = (IIOPAddress)ssl_addr;
            ssl_address.configure(configuration);

        }
        else
        {
            int ssl_oaPort = configuration.getAttributeAsInteger("OASSLPort",0);
            String ssl_oaHost = configuration.getAttribute("OAIAddr","");
            ssl_address = new IIOPAddress(ssl_oaHost,ssl_oaPort);
            ssl_address.configure(configuration);
        }

        if (address.getProtocol() == null)
        {
            address.setProtocol(Protocol.IIOP);
        }
        if (ssl_address.getProtocol() == null || ssl_address.getProtocol() == Protocol.SSLIOP)
        {
            ssl_address.setProtocol(Protocol.IIOP);
        }
        defaultEndpoint.setAddress(address);
        defaultEndpoint.setSSLAddress(ssl_address);
        defaultEndpoint.setProtocol(address.getProtocol());

View Full Code Here

                        if(address_str != null)
                        {
                            String address_trim = address_str.trim();
                            // build an iiop/ssliop protocol address.
                            // create_protocol_address will allow iiop and ssliop only
                            IIOPAddress address = null;
                            IIOPAddress ssl_address = null;
                            if (protocol == Protocol.IIOP)
                            {
                                ProtocolAddressBase addr1 = createProtocolAddress(address_trim);
                                if (addr1 instanceof IIOPAddress)
                                {
                                    address = (IIOPAddress)addr1;
                                    address.configure(configuration);
                                }

                                if (ssl_port != null)
                                {
                                    int colon_delim = address_trim.indexOf(":");
                                    int port_delim = address_trim.indexOf(":", colon_delim+2);
                                    if (port_delim > 0)
                                    {
                                        host_str = address_trim.substring(colon_delim+3, port_delim);
                                    }
                                    else
                                    {
                                        host_str = "";
                                    }

                                    ssl_address = new IIOPAddress(host_str,Integer.parseInt(ssl_port));
                                    ssl_address.configure(configuration);
                                }

                            }
                            else if(protocol == Protocol.SSLIOP)
                            {
                                ProtocolAddressBase addr2 = createProtocolAddress(address_trim);
                                if (addr2 instanceof IIOPAddress)
                                {
                                    ssl_address = (IIOPAddress)addr2;
                                    ssl_address.configure(configuration);
                                }

                                //  Set the protocol to IIOP for using IIOP Protocol Factory
                                protocol = Protocol.IIOP;
                            }
View Full Code Here

TOP

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

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.