Search in sources :

Example 1 with ConnectorServiceFactory

use of org.apache.activemq.artemis.core.server.ConnectorServiceFactory in project activemq-artemis by apache.

the class ActiveMQServerControlImpl method createConnectorService.

@Override
public void createConnectorService(final String name, final String factoryClass, final Map<String, Object> parameters) throws Exception {
    checkStarted();
    clearIO();
    try {
        final ConnectorServiceConfiguration config = new ConnectorServiceConfiguration().setName(name).setFactoryClassName(factoryClass).setParams(parameters);
        ConnectorServiceFactory factory = server.getServiceRegistry().getConnectorService(config);
        server.getConnectorsService().createService(config, factory);
    } finally {
        blockOnIO();
    }
}
Also used : ConnectorServiceFactory(org.apache.activemq.artemis.core.server.ConnectorServiceFactory) ConnectorServiceConfiguration(org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration)

Example 2 with ConnectorServiceFactory

use of org.apache.activemq.artemis.core.server.ConnectorServiceFactory in project activemq-artemis by apache.

the class ServiceRegistryImpl method getConnectorServices.

@Override
public Collection<Pair<ConnectorServiceFactory, ConnectorServiceConfiguration>> getConnectorServices(List<ConnectorServiceConfiguration> configs) {
    if (configs != null) {
        for (final ConnectorServiceConfiguration config : configs) {
            if (connectorServices.get(config.getConnectorName()) == null) {
                ConnectorServiceFactory factory = loadClass(config.getFactoryClassName());
                addConnectorService(factory, config);
            }
        }
    }
    return connectorServices.values();
}
Also used : ConnectorServiceFactory(org.apache.activemq.artemis.core.server.ConnectorServiceFactory) ConnectorServiceConfiguration(org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration)

Aggregations

ConnectorServiceConfiguration (org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration)2 ConnectorServiceFactory (org.apache.activemq.artemis.core.server.ConnectorServiceFactory)2