Package org.jacorb.config

Examples of org.jacorb.config.Configuration


    {
        final String hostname = "does.not.exist";
        IIOPAddress address = new IIOPAddress(hostname, 2710);

        MockControl configControl = MockControl.createControl(Configuration.class);
        Configuration configMock = (Configuration) configControl.getMock();

        configControl.expectAndReturn(configMock.getLogger("org.jacorb.iiop.address"), TestUtils.getLogger());
        configControl.expectAndReturn(configMock.getAttributeAsBoolean("jacorb.dns.enable", false), true);
        configControl.expectAndReturn(configMock.getAttributeAsBoolean("jacorb.dns.force_lookup", true), true);
        configControl.expectAndReturn(configMock.getAttributeAsBoolean("jacorb.ipv6.hide_zoneid", true), true);
        configControl.expectAndReturn(configMock.getAttributeAsBoolean("jacorb.dns.eager_resolve", true), true);

        configControl.replay();

        address.configure(configMock);
View Full Code Here


        try
        {
            Admin admin =
                AdminHelper.narrow( orb.resolve_initial_references("ImplementationRepository"));

            Configuration config = ((org.jacorb.orb.ORB)orb).getConfiguration();
            Logger logger = config.getLogger("org.jacorb.imr.manager");

            ServerInfo info = null;

            try
            {
View Full Code Here

     * @param info the info object.
     */
    public void post_init(ORBInitInfo info)
    {
        final ORB orb = ((org.jacorb.orb.portableInterceptor.ORBInitInfoImpl) info).getORB();
        final Configuration config = orb.getConfiguration();
        final Logger logger = config.getLogger("org.jacorb.interceptors.ior_init");

        try
        {
            int giop_minor =
                config.getAttributeAsInteger("jacorb.giop_minor_version", 2);

            if( giop_minor > 0 )
            {
                info.add_ior_interceptor(new CodeSetInfoInterceptor(orb));
            }
View Full Code Here

            log("init ORB (using corbaloc " + useCorbaloc() + " and using imr " + useIMR());

            try
            {
                Configuration config = ((org.jacorb.orb.ORB)orb).getConfiguration();
                logger = config.getLogger("TestServer");
            }
            catch (ClassCastException e)
            {
                // ignore. not a JacORB ORB
            }
View Full Code Here

            props.putAll( argProps );

            /* intialize the ORB and Root POA */
            orb = org.omg.CORBA.ORB.init(args, props);

            Configuration config =
                ((org.jacorb.orb.ORB)orb).getConfiguration();

            /* configure the name service using the ORB configuration */
            configure(config);

View Full Code Here

            Properties props = new Properties();
            props.put ("jacorb.config.log.verbosity", "4");
            props.put ("jacorb.connection.client.connect_timeout", "33323");
            props.put ("ORBid", "myapplet");
            props.put ("custom.props", "applet-special.properties");
            Configuration config = JacORBConfiguration.getConfiguration(props, orb, true);
            int timeout = config.getAttributeAsInteger(
                            "jacorb.connection.client.connect_timeout", 0);
            assertEquals(33323, timeout);
            orb.destroy();
        }
        finally
View Full Code Here

        return FilterFactoryHelper.narrow(orb.string_to_object(_filterFactoryConf));
    }

    private String getFilterFactoryLocation(PicoContainer container)
    {
        Configuration config = (Configuration) container.getComponentInstance(Configuration.class);

        String _location = config.getAttribute(Attributes.FILTER_FACTORY, Default.DEFAULT_FILTER_FACTORY);

        return _location;
    }
View Full Code Here

        if (logger.isInfoEnabled())
        {
            logger.info("Initialising ORB with ID: " + orb_id);
        }

        Configuration orbsingletonConfig = ((ORBSingleton)org.omg.CORBA.ORBSingleton.init ()).configuration;
        if (props != null)
        {
            orbsingletonConfig.setAttributes (props);
        }

        if ( args != null )
        {
            for ( int i = 0; i < args.length; i++ )
            {
                if (args[i] == null)
                {
                    continue;
                }

                String arg = args[i].trim();

                if (!arg.startsWith("-ORB"))
                {
                    continue;
                }

                // skip over -ORBID argument since it is not applied here
                if (arg.equalsIgnoreCase("-ORBID"))
                {
                    i++;
                    continue;
                }

                // skip over -ORBSetListenEndpoint argument since it is not applied here
                if (arg.equalsIgnoreCase("-ORBListenEndpoints"))
                {
                    i++;
                    continue;
                }

                // Strip the leading '-'.
                arg = arg.substring( 1 );

                if (arg.equals("ORBDefaultInitRef"))
                {
                    defaultInitRef = args[++i].trim();

                    continue;
                }

                // Look for an '=' in the argument
                int equals_pos = arg.indexOf('=');

                final String propertyName;
                final String propertyValue;

                if (equals_pos == -1)
                {
                    //This is the compliant form like: -ORBInitRef <name>=<val>

                    if (arg.indexOf('.') >= 0)
                    {
                        // ORBInitRef.<name> value
                        throw new BAD_PARAM("-ORBInitRef.xxx yyy is not a valid format. Use -ORBInitRef name=value");
                    }

                    //Is there a next arg?
                    if ( (i + 1) >= (args.length) )
                    {
                        throw new BAD_PARAM("Invalid ORBInitRef format: -ORB<option> argument without value" );
                    }

                    String prop = args[ ++i ].trim();

                    //find the equals char that separates prop name from
                    //prop value
                    equals_pos = prop.indexOf('=');
                    if (equals_pos < 0)
                    {
                        if (arg.equals("ORBInitRef"))
                        {
                            throw new BAD_PARAM("Invalid ORBInitRef format -ORBInitRef " + prop + ". it should be -ORBInitRef name=value.");
                        }
                        // Form is -ORBWhatever value
                        propertyName = arg;
                        propertyValue = prop;
                    }
                    else
                    {
                        // Form is -ORBWhatever name=value
                        // add the property to environment

                        propertyName = arg + "." + prop.substring( 0, equals_pos );
                        propertyValue = prop.substring( equals_pos + 1);

                        if (propertyValue.length() == 0)
                        {
                            throw new BAD_PARAM("Invalid ORBInitRef format: -ORBInitRef name=value. value may not be omitted.");
                        }
                    }
                }
                else
                {
                    //This is the wrong jacorb form -ORBInitRef.<name>=<val>
                    //get rid of the leading =
                    //add the property to environment

                    propertyName = arg.substring( 0, equals_pos );
                    propertyValue = arg.substring( equals_pos + 1);

                    if (propertyValue.length() == 0)
                    {
                        throw new BAD_PARAM("Invalid ORBInitRef format: -ORBInitRef name=value. value may not be omitted.");
                    }
                }

                if (logger.isDebugEnabled())
                {
                    logger.debug("adding attribute " + propertyName + "=" + propertyValue);
                }
                configuration.setAttribute(propertyName, propertyValue);

                // Upload this ORB argument to the Singleton.
                orbsingletonConfig.setAttribute (propertyName, propertyValue);
            }
        }

        internalInit();
    }
View Full Code Here

            // initialize the static naming service variables.
            CorbaNamingContext.init(orb, rootPOA);

            // create and initialize the root context instance according to the configuration.
            CorbaNamingContext ns = new CorbaNamingContext();
            Configuration configuration = ((org.jacorb.orb.ORB) orb).getConfiguration();
            boolean doPurge = configuration.getAttribute("jacorb.naming.purge", "off").equals("on");
            boolean noPing = configuration.getAttribute("jacorb.naming.noping", "off").equals("on");
            ns.init(namingPOA, doPurge, noPing);

            // create and activate the root context.
            byte[] rootContextId = "root".getBytes();
            namingPOA.activate_object_with_id(rootContextId, ns);
View Full Code Here

TOP

Related Classes of org.jacorb.config.Configuration

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.