本文整理匯總了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;
}
});
}