Search in sources :

Example 1 with NetworkConnectionScheduler

use of org.apache.qpid.server.transport.NetworkConnectionScheduler in project qpid-broker-j by apache.

the class AbstractVirtualHost method onActivate.

@StateTransition(currentState = { State.UNINITIALIZED, State.ERRORED }, desiredState = State.ACTIVE)
private ListenableFuture<Void> onActivate() {
    long threadPoolKeepAliveTimeout = getContextValue(Long.class, CONNECTION_THREAD_POOL_KEEP_ALIVE_TIMEOUT);
    final SuppressingInheritedAccessControlContextThreadFactory connectionThreadFactory = new SuppressingInheritedAccessControlContextThreadFactory("virtualhost-" + getName() + "-iopool", getSystemTaskSubject("IO Pool", getPrincipal()));
    _networkConnectionScheduler = new NetworkConnectionScheduler("virtualhost-" + getName() + "-iopool", getNumberOfSelectors(), getConnectionThreadPoolSize(), threadPoolKeepAliveTimeout, connectionThreadFactory);
    _networkConnectionScheduler.start();
    updateAccessControl();
    initialiseStatisticsReporting();
    MessageStore messageStore = getMessageStore();
    messageStore.openMessageStore(this);
    startFileSystemSpaceChecking();
    if (!(_virtualHostNode.getConfigurationStore() instanceof MessageStoreProvider)) {
        getEventLogger().message(getMessageStoreLogSubject(), MessageStoreMessages.CREATED());
        getEventLogger().message(getMessageStoreLogSubject(), MessageStoreMessages.STORE_LOCATION(messageStore.getStoreLocation()));
    }
    messageStore.upgradeStoreStructure();
    if (_linkRegistry != null) {
        _linkRegistry.open();
    }
    getBroker().assignTargetSizes();
    final PreferenceStoreUpdater updater = new PreferenceStoreUpdaterImpl();
    Collection<PreferenceRecord> records = _preferenceStore.openAndLoad(updater);
    _preferenceTaskExecutor = new TaskExecutorImpl("virtualhost-" + getName() + "-preferences", null);
    _preferenceTaskExecutor.start();
    PreferencesRecoverer preferencesRecoverer = new PreferencesRecoverer(_preferenceTaskExecutor);
    preferencesRecoverer.recoverPreferences(this, records, _preferenceStore);
    if (_createDefaultExchanges) {
        return doAfter(createDefaultExchanges(), new Runnable() {

            @Override
            public void run() {
                _createDefaultExchanges = false;
                postCreateDefaultExchangeTasks();
            }
        });
    } else {
        postCreateDefaultExchangeTasks();
        return Futures.immediateFuture(null);
    }
}
Also used : MessageStore(org.apache.qpid.server.store.MessageStore) PreferenceStoreUpdater(org.apache.qpid.server.store.preferences.PreferenceStoreUpdater) TaskExecutorImpl(org.apache.qpid.server.configuration.updater.TaskExecutorImpl) PreferenceRecord(org.apache.qpid.server.store.preferences.PreferenceRecord) SuppressingInheritedAccessControlContextThreadFactory(org.apache.qpid.server.pool.SuppressingInheritedAccessControlContextThreadFactory) MessageStoreProvider(org.apache.qpid.server.store.MessageStoreProvider) PreferenceStoreUpdaterImpl(org.apache.qpid.server.store.preferences.PreferenceStoreUpdaterImpl) PreferencesRecoverer(org.apache.qpid.server.store.preferences.PreferencesRecoverer) NetworkConnectionScheduler(org.apache.qpid.server.transport.NetworkConnectionScheduler)

Aggregations

TaskExecutorImpl (org.apache.qpid.server.configuration.updater.TaskExecutorImpl)1 SuppressingInheritedAccessControlContextThreadFactory (org.apache.qpid.server.pool.SuppressingInheritedAccessControlContextThreadFactory)1 MessageStore (org.apache.qpid.server.store.MessageStore)1 MessageStoreProvider (org.apache.qpid.server.store.MessageStoreProvider)1 PreferenceRecord (org.apache.qpid.server.store.preferences.PreferenceRecord)1 PreferenceStoreUpdater (org.apache.qpid.server.store.preferences.PreferenceStoreUpdater)1 PreferenceStoreUpdaterImpl (org.apache.qpid.server.store.preferences.PreferenceStoreUpdaterImpl)1 PreferencesRecoverer (org.apache.qpid.server.store.preferences.PreferencesRecoverer)1 NetworkConnectionScheduler (org.apache.qpid.server.transport.NetworkConnectionScheduler)1