use of org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule in project opennms by OpenNMS.
the class CollectorTestUtils method createLocationAwareCollectorClient.
static LocationAwareCollectorClient createLocationAwareCollectorClient() {
final DefaultServiceCollectorRegistry serviceCollectorRegistry = new DefaultServiceCollectorRegistry();
final CollectorClientRpcModule collectorClientRpcModule = new CollectorClientRpcModule();
collectorClientRpcModule.setServiceCollectorRegistry(serviceCollectorRegistry);
collectorClientRpcModule.setExecutor(Executors.newSingleThreadExecutor());
final MockRpcClientFactory rpcClientFactory = new MockRpcClientFactory();
final LocationAwareCollectorClientImpl locationAwareCollectorClient = new LocationAwareCollectorClientImpl(rpcClientFactory);
locationAwareCollectorClient.setRpcModule(collectorClientRpcModule);
locationAwareCollectorClient.afterPropertiesSet();
return locationAwareCollectorClient;
}
use of org.opennms.netmgt.collection.client.rpc.CollectorClientRpcModule in project opennms by OpenNMS.
the class CollectorTestUtils method createLocationAwareCollectorClient.
public static LocationAwareCollectorClient createLocationAwareCollectorClient() {
final DefaultServiceCollectorRegistry serviceCollectorRegistry = new DefaultServiceCollectorRegistry();
final CollectorClientRpcModule collectorClientRpcModule = new CollectorClientRpcModule();
collectorClientRpcModule.setServiceCollectorRegistry(serviceCollectorRegistry);
collectorClientRpcModule.setExecutor(Executors.newSingleThreadExecutor());
final MockRpcClientFactory rpcClientFactory = new MockRpcClientFactory();
final LocationAwareCollectorClientImpl locationAwareCollectorClient = new LocationAwareCollectorClientImpl(rpcClientFactory);
locationAwareCollectorClient.setRpcModule(collectorClientRpcModule);
locationAwareCollectorClient.setRpcTargetHelper(new RpcTargetHelper());
locationAwareCollectorClient.afterPropertiesSet();
return locationAwareCollectorClient;
}
Aggregations