use of org.opennms.core.rpc.utils.RpcTargetHelper 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