@Test private void testCreateGobblinScopedCustomPusher() throws NotConfiguredException { Map<String, String> configAsMap = new HashMap<>(); configAsMap.put("gobblin.broker.pusher.class", TestPusher.class.getName()); configAsMap.put("gobblin.broker.pusher.id", "sharedId"); configAsMap.put("gobblin.broker.pusher.testPusher.id", "testPusherId"); configAsMap.put("gobblin.broker.pusher.testPusher.name", "testPusherName"); SharedResourcesBroker<GobblinScopeTypes> instanceBroker = SharedResourcesBrokerFactory .createDefaultTopLevelBroker(ConfigFactory.parseMap(configAsMap), GobblinScopeTypes.GLOBAL.defaultScopeInstance()); SharedResourcesBroker<GobblinScopeTypes> jobBroker = instanceBroker.newSubscopedBuilder( new JobScopeInstance("PusherFactoryTest", String.valueOf(System.currentTimeMillis()))).build(); StringNameSharedResourceKey key = new StringNameSharedResourceKey("testPusher"); Pusher<String> pusher = jobBroker.getSharedResource(new GobblinScopePusherFactory<>(), key); Assert.assertEquals(pusher.getClass(), TestPusher.class); TestPusher testPusher = (TestPusher) pusher; Assert.assertTrue(!testPusher.isClosed); Assert.assertEquals(testPusher.id, "testPusherId"); Assert.assertEquals(testPusher.name, "testPusherName"); try { jobBroker.close(); instanceBroker.close(); } catch (IOException e) { e.printStackTrace(); } Assert.assertTrue(testPusher.isClosed); }
@Override public String getName() { return FACTORY_NAME; }
PusherFactory implements SharedResourceFactory<Pusher<T>, StringNameSharedResourceKey, S> { @Override public String getName() { return FACTORY_NAME; } }
PusherFactory implements SharedResourceFactory<Pusher<T>, StringNameSharedResourceKey, S> { @Override public String getName() { return FACTORY_NAME; }  }
PusherFactory implements SharedResourceFactory<Pusher<T>, StringNameSharedResourceKey, S> { @Override public String getName() { return FACTORY_NAME; }  @Override String getName(); @Override SharedResourceFactoryResponse<Pusher<T>> createResource(SharedResourcesBroker<S> broker,
      ScopedConfigView<S, StringNameSharedResourceKey> config); }
PusherFactory implements SharedResourceFactory<Pusher<T>, StringNameSharedResourceKey, S> { @Override public String getName() { return FACTORY_NAME; }  @Override String getName(); @Override SharedResourceFactoryResponse<Pusher<T>> createResource(SharedResourcesBroker<S> broker,
      ScopedConfigView<S, StringNameSharedResourceKey> config);  }