本文整理汇总了Java中com.google.inject.Binder.disableCircularProxies方法的典型用法代码示例。如果您正苦于以下问题:Java Binder.disableCircularProxies方法的具体用法?Java Binder.disableCircularProxies怎么用?Java Binder.disableCircularProxies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.Binder
的用法示例。
在下文中一共展示了Binder.disableCircularProxies方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.google.inject.Binder; //导入方法依赖的package包/类
@Override
protected void setup(Binder binder)
{
binder.disableCircularProxies();
binder.bind(AgentMap.class).to(DiscoveryAgentMap.class).in(Scopes.SINGLETON);
binder.bind(RequestDispatcher.class).in(Scopes.SINGLETON);
binder.bind(Client.class).to(JerseyClient.class).in(Scopes.SINGLETON);
binder.bind(ResponseWrapper.class);
jaxrsBinder(binder).bind(ControllerConfigAPI.class);
jaxrsBinder(binder).bind(ControllerConnectorAPI.class);
jaxrsBinder(binder).bind(ControllerLogsAPI.class);
jaxrsBinder(binder).bind(ControllerPackageAPI.class);
jaxrsBinder(binder).bind(ControllerControlAPI.class);
jaxrsBinder(binder).bind(InstantConverterProvider.class);
discoveryBinder(binder).bindSelector("presto-manager");
}
示例2: setup
import com.google.inject.Binder; //导入方法依赖的package包/类
@Override
protected void setup(Binder binder)
{
binder.disableCircularProxies();
// buildConfigObject also calls bindConfig
AgentConfig config = buildConfigObject(AgentConfig.class);
switch (config.getPackageType()) {
case RPM:
configBinder(binder).bindConfig(PrestoRpmConfig.class, "presto");
binder.bind(PrestoConfig.class).to(PrestoRpmConfig.class);
binder.bind(PackageController.class).to(RpmController.class)
.in(Scopes.SINGLETON);
break;
case TARBALL:
configBinder(binder).bindConfig(PrestoTarConfig.class, "presto");
binder.bind(PrestoConfig.class).to(PrestoTarConfig.class);
binder.bind(PackageController.class).to(TarController.class)
.in(Scopes.SINGLETON);
break;
default:
throw new IllegalArgumentException("Unsupported package type");
}
binder.bind(Client.class).to(JerseyClient.class).in(Scopes.SINGLETON);
binder.bind(LogsHandler.class).in(Scopes.SINGLETON);
binder.bind(PrestoInformer.class);
binder.bind(CommandExecutor.class);
binder.bind(PrestoConfigDeployer.class);
jaxrsBinder(binder).bind(ConfigAPI.class);
jaxrsBinder(binder).bind(ConnectorsAPI.class);
jaxrsBinder(binder).bind(ControlAPI.class);
jaxrsBinder(binder).bind(LogsAPI.class);
jaxrsBinder(binder).bind(PackageAPI.class);
jaxrsBinder(binder).bind(InstantConverterProvider.class);
discoveryBinder(binder).bindHttpAnnouncement("presto-manager");
dynamicAnnouncementBinder(binder).forService("presto-manager")
.bindProperty("configured-presto-coordinator")
.toClassFromGetter(PrestoInformer.class,
informer -> {
try {
return Boolean.toString(informer.isConfiguredCoordinator());
}
catch (IOException e) {
return null;
}
});
}