Package org.apache.qpid.server.model

Examples of org.apache.qpid.server.model.ConfiguredObject


            throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
        }
        Collection<ConfigurationEntry> entries = childEntries.get(type);
        for (ConfigurationEntry childEntry : entries)
        {
            ConfiguredObject object = recoverer.create(recovererProvider, childEntry, authenticationProvider);
            if (object == null)
            {
                throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
            }
            if (object instanceof PreferencesProvider)
            {
                authenticationProvider.setPreferencesProvider((PreferencesProvider)object);
            }
            else
            {
                throw new IllegalConfigurationException("Cannot associate  " + object + " with authentication provider " + authenticationProvider);
            }
            object.addChangeListener(storeChangeListener);
        }
    }
View Full Code Here


            throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
        }
        Collection<ConfigurationEntry> entries = childEntries.get(type);
        for (ConfigurationEntry childEntry : entries)
        {
            ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
            if (object == null)
            {
                throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
            }
            broker.recoverChild(object);
            object.addChangeListener(storeChangeListener);
        }
    }
View Full Code Here

            throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
        }
        Collection<ConfigurationEntry> entries = childEntries.get(type);
        for (ConfigurationEntry childEntry : entries)
        {
            ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
            if (object == null)
            {
                throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
            }
            broker.recoverChild(object);
            object.addChangeListener(storeChangeListener);
        }
    }
View Full Code Here

     * configured object itself
     */
    public void testConfiguredObjectWithSingleConfiguredObjectAttribute() throws Exception
    {
        final String attributeName = "attribute";
        final ConfiguredObject attributeValue = mock(ConfiguredObject.class);
        when(attributeValue.getName()).thenReturn("attributeConfiguredObjectName");

        configureMockToReturnOneAttribute(_configuredObject, attributeName, attributeValue);

        Map<String, Object> resultMap = _converter.convertObjectToMap(_configuredObject, ConfiguredObject.class, 0);
        assertEquals("Unexpected number of attributes", 1, resultMap.size());
View Full Code Here

    public void testStateChanged()
    {
        notifyBrokerStarted();
        UUID id = UUID.randomUUID();
        ConfiguredObject object = mock(VirtualHost.class);
        when(object.getId()).thenReturn(id);
        _listener.stateChanged(object, State.ACTIVE, State.DELETED);
        verify(_store).remove(id);
    }
View Full Code Here

    public void testStateChanged()
    {
        notifyBrokerStarted();
        UUID id = UUID.randomUUID();
        ConfiguredObject object = mock(VirtualHost.class);
        when(object.getId()).thenReturn(id);
        _listener.stateChanged(object, State.ACTIVE, State.DELETED);
        verify(_store).remove(id);
    }
View Full Code Here

        Plugin pluginFromFactory = mock(Plugin.class);
        when(pluginFromFactory.getId()).thenReturn(_id);
        when(_factory.createInstance(_id, _attributes, _broker)).thenReturn(pluginFromFactory);

        PluginRecoverer pluginRecoverer = new PluginRecoverer(_pluginFactoryServiceLoader);
        ConfiguredObject pluginFromRecoverer = pluginRecoverer.create(null, _configurationEntry, _broker);
        assertNotNull("Null group provider", pluginFromRecoverer);
        assertSame("Unexpected plugin", pluginFromFactory, pluginFromRecoverer);
        assertEquals("Unexpected ID", _id, pluginFromRecoverer.getId());
    }
View Full Code Here

     * configured object itself
     */
    public void testConfiguredObjectWithSingleConfiguredObjectAttribute() throws Exception
    {
        final String attributeName = "attribute";
        final ConfiguredObject attributeValue = mock(ConfiguredObject.class);
        when(attributeValue.getName()).thenReturn("attributeConfiguredObjectName");

        configureMockToReturnOneAttribute(_configuredObject, attributeName, attributeValue);

        Map<String, Object> resultMap = _converter.convertObjectToMap(_configuredObject, ConfiguredObject.class, 0);
        assertEquals("Unexpected number of attributes", 1, resultMap.size());
View Full Code Here

            throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
        }
        Collection<ConfigurationEntry> entries = childEntries.get(type);
        for (ConfigurationEntry childEntry : entries)
        {
            ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
            if (object == null)
            {
                throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
            }
            broker.recoverChild(object);
            object.addChangeListener(storeChangeListener);
        }
    }
View Full Code Here

        Map<String, Object> attributes = configurationEntry.getAttributes();
        Iterable<PluginFactory> factories = _serviceLoader.instancesOf(PluginFactory.class);
        for (PluginFactory pluginFactory : factories)
        {
            UUID configurationId = configurationEntry.getId();
            ConfiguredObject pluginObject = pluginFactory.createInstance(configurationId, attributes, broker);
            if (pluginObject != null)
            {
                UUID pluginId = pluginObject.getId();
                if (!configurationId.equals(pluginId))
                {
                    throw new IllegalStateException("Plugin object id '" + pluginId + "' does not equal expected id " + configurationId);
                }
                return pluginObject;
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.model.ConfiguredObject

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.