Examples of BrokerOptions


Examples of org.apache.qpid.server.BrokerOptions

    private DurableConfigurationStore _store;
    private boolean _saved;

    public TestBrokerConfiguration(String storeType, String initialStoreLocation, final TaskExecutor taskExecutor)
    {
        BrokerOptions brokerOptions = new BrokerOptions();
        _taskExecutor = taskExecutor;
        _storeType = storeType;
        brokerOptions.setInitialConfigurationLocation(initialStoreLocation);
        final AbstractSystemConfig parentObject = new JsonSystemConfigImpl(taskExecutor,
                                                               mock(EventLogger.class),
                                                               mock(LogRecorder.class),
                                                               brokerOptions);
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        return setObjectAttributes(entry, attributes);
    }

    public boolean save(File configFile)
    {
        BrokerOptions brokerOptions = new BrokerOptions();
        brokerOptions.setConfigurationStoreLocation(configFile.getAbsolutePath());

        SystemConfigFactory configFactory =
                (new PluggableFactoryLoader<>(SystemConfigFactory.class)).get(_storeType);

        final SystemConfig parentObject = configFactory.newInstance(_taskExecutor,
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        String testConfig = saveTestConfiguration(port, testConfiguration);

        if (_brokerType.equals(BrokerType.INTERNAL) && !existingInternalBroker())
        {
            setSystemProperty(BrokerProperties.PROPERTY_USE_CUSTOM_RMI_SOCKET_FACTORY, "false");
            BrokerOptions options = new BrokerOptions();

            options.setConfigurationStoreType(_brokerStoreType);
            options.setConfigurationStoreLocation(testConfig);
            options.setManagementMode(managementMode);
            if (managementMode)
            {
                options.setManagementModePassword(MANAGEMENT_MODE_PASSWORD);
            }

            //Set the log config file, relying on the log4j.configuration system property
            //set on the JVM by the JUnit runner task in module.xml.
            options.setLogConfigFileLocation(_logConfigFile.getAbsolutePath());

            Broker broker = new Broker();
            _logger.info("Starting internal broker (same JVM)");
            broker.startup(options);
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        _store = mock(DurableConfigurationStore.class);
        _taskExecutor = new CurrentThreadTaskExecutor();
        _taskExecutor.start();

        _systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class),
                                               mock(LogRecorder.class), new BrokerOptions());


        ConfiguredObjectRecord systemContextRecord = _systemConfig.asObjectRecord();



        _root = new ConfiguredObjectRecordImpl(_rootId, Broker.class.getSimpleName(), Collections.<String,Object>emptyMap(), Collections.singletonMap(SystemConfig.class.getSimpleName(), systemContextRecord.getId()));

        _portEntry = mock(ConfiguredObjectRecord.class);
        when(_portEntry.getId()).thenReturn(_portEntryId);
        when(_portEntry.getParents()).thenReturn(Collections.singletonMap(Broker.class.getSimpleName(), _root.getId()));
        when(_portEntry.getType()).thenReturn(Port.class.getSimpleName());

        final ArgumentCaptor<ConfiguredObjectRecordHandler> recovererArgumentCaptor = ArgumentCaptor.forClass(ConfiguredObjectRecordHandler.class);
        doAnswer(
                new Answer()
                {
                    @Override
                    public Object answer(final InvocationOnMock invocation) throws Throwable
                    {
                        ConfiguredObjectRecordHandler recoverer = recovererArgumentCaptor.getValue();
                        if(recoverer.handle(_root))
                        {
                            recoverer.handle(_portEntry);
                        }
                        return null;
                    }
                }
                ).when(_store).visitConfiguredObjectRecords(recovererArgumentCaptor.capture());
        _options = new BrokerOptions();
        _handler = new ManagementModeStoreHandler(_store, _options);

        _handler.openConfigurationStore(_systemConfig, false);
    }
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        _taskExecutor = new CurrentThreadTaskExecutor();
        _taskExecutor.start();
        _systemConfig = new JsonSystemConfigImpl(_taskExecutor,
                                               mock(EventLogger.class),
                                               mock(LogRecorder.class),
                                               new BrokerOptions());
    }
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        super.setUp();

        _taskExecutor = new CurrentThreadTaskExecutor();
        _taskExecutor.start();
        _systemConfig = new JsonSystemConfigImpl(_taskExecutor,
                                               mock(EventLogger.class), mock(LogRecorder.class), new BrokerOptions());

        when(_brokerEntry.getId()).thenReturn(_brokerId);
        when(_brokerEntry.getType()).thenReturn(Broker.class.getSimpleName());
        Map<String, Object> attributesMap = new HashMap<String, Object>();
        attributesMap.put(Broker.MODEL_VERSION, BrokerModel.MODEL_VERSION);
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        if (_brokerType.equals(BrokerType.INTERNAL) && !existingInternalBroker())
        {
            setConfigurationProperty(ServerConfiguration.MGMT_CUSTOM_REGISTRY_SOCKET, String.valueOf(false));
            saveTestConfiguration();

            BrokerOptions options = new BrokerOptions();
            options.setConfigFile(_configFile.getAbsolutePath());
            options.addPort(port);

            addExcludedPorts(port, DEFAULT_SSL_PORT, options);

            options.setJmxPortRegistryServer(getManagementPort(port));

            //Set the log config file, relying on the log4j.configuration system property
            //set on the JVM by the JUnit runner task in module.xml.
            options.setLogConfigFile(new URL(System.getProperty("log4j.configuration")).getFile());

            Broker broker = new Broker();
            _logger.info("starting internal broker (same JVM)");
            broker.startup(options);
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

    @Setup @SuppressWarnings("unused")
    private void setUp(PortAllocator portAllocator) throws Exception {
        this.portAllocator = portAllocator;
        port = portAllocator.allocatePort();
        broker = new Broker();
        BrokerOptions options = new BrokerOptions();
        options.setConfigFile("src/test/conf/qpid/config.xml");
        options.setLogConfigFile("src/test/conf/qpid/log4j.xml");
        options.addPort(port);
        broker.startup(options);
        // null means the default virtual host
        virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(null);
        connectionFactory = new AMQConnectionFactory("amqp://guest:guest@clientid/" + virtualHost.getName() + "?brokerlist='tcp://localhost:" + port + "'");
    }
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        _store = mock(DurableConfigurationStore.class);
        _taskExecutor = new CurrentThreadTaskExecutor();
        _taskExecutor.start();

        _systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class),
                                               mock(LogRecorder.class), new BrokerOptions(),
                                               mock(BrokerShutdownProvider.class));


        ConfiguredObjectRecord systemContextRecord = _systemConfig.asObjectRecord();



        _root = new ConfiguredObjectRecordImpl(_rootId, Broker.class.getSimpleName(), Collections.<String,Object>emptyMap(), Collections.singletonMap(SystemConfig.class.getSimpleName(), systemContextRecord.getId()));

        _portEntry = mock(ConfiguredObjectRecord.class);
        when(_portEntry.getId()).thenReturn(_portEntryId);
        when(_portEntry.getParents()).thenReturn(Collections.singletonMap(Broker.class.getSimpleName(), _root.getId()));
        when(_portEntry.getType()).thenReturn(Port.class.getSimpleName());

        final ArgumentCaptor<ConfiguredObjectRecordHandler> recovererArgumentCaptor = ArgumentCaptor.forClass(ConfiguredObjectRecordHandler.class);
        doAnswer(
                new Answer()
                {
                    @Override
                    public Object answer(final InvocationOnMock invocation) throws Throwable
                    {
                        ConfiguredObjectRecordHandler recoverer = recovererArgumentCaptor.getValue();
                        if(recoverer.handle(_root))
                        {
                            recoverer.handle(_portEntry);
                        }
                        return null;
                    }
                }
                ).when(_store).visitConfiguredObjectRecords(recovererArgumentCaptor.capture());
        _options = new BrokerOptions();
        _handler = new ManagementModeStoreHandler(_store, _options);

        _handler.openConfigurationStore(_systemConfig, false);
    }
View Full Code Here

Examples of org.apache.qpid.server.BrokerOptions

        _taskExecutor = new CurrentThreadTaskExecutor();
        _taskExecutor.start();
        _systemConfig = new JsonSystemConfigImpl(_taskExecutor,
                                               mock(EventLogger.class),
                                               mock(LogRecorder.class),
                                               new BrokerOptions(),
                                               mock(BrokerShutdownProvider.class));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.