Search in sources :

Example 1 with AdminWebServerFactory

use of org.apache.gobblin.runtime.api.AdminWebServerFactory in project incubator-gobblin by apache.

the class ServiceBasedAppLauncher method createAdminServer.

public static Service createAdminServer(Properties properties, URI executionInfoServerURI) {
    String factoryClassName = properties.getProperty(ConfigurationKeys.ADMIN_SERVER_FACTORY_CLASS_KEY, ConfigurationKeys.DEFAULT_ADMIN_SERVER_FACTORY_CLASS);
    ClassAliasResolver<AdminWebServerFactory> classResolver = new ClassAliasResolver<>(AdminWebServerFactory.class);
    try {
        AdminWebServerFactory factoryInstance = classResolver.resolveClass(factoryClassName).newInstance();
        return factoryInstance.createInstance(properties, executionInfoServerURI);
    } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
        throw new RuntimeException("Unable to instantiate the AdminWebServer factory. " + "Have you included the module in the gobblin distribution? :" + e, e);
    }
}
Also used : AdminWebServerFactory(org.apache.gobblin.runtime.api.AdminWebServerFactory) ClassAliasResolver(org.apache.gobblin.util.ClassAliasResolver)

Aggregations

AdminWebServerFactory (org.apache.gobblin.runtime.api.AdminWebServerFactory)1 ClassAliasResolver (org.apache.gobblin.util.ClassAliasResolver)1