use of org.eclipse.che.api.factory.server.FactoryParametersResolver in project che-server by eclipse-che.
the class WsMasterModule method configure.
@Override
protected void configure() {
// Can be removed after upgrade to Fabric8 4.10.2 or higher or to Java 11
if (System.getProperty("java.version", "").startsWith("1.8")) {
System.setProperty("http2.disable", "true");
}
// db related components modules
install(new org.eclipse.che.account.api.AccountModule());
install(new org.eclipse.che.api.ssh.server.jpa.SshJpaModule());
install(new org.eclipse.che.api.core.jsonrpc.impl.JsonRpcModule());
install(new org.eclipse.che.api.core.websocket.impl.WebSocketModule());
// db configuration
bind(SchemaInitializer.class).to(org.eclipse.che.core.db.schema.impl.flyway.FlywaySchemaInitializer.class);
bind(org.eclipse.che.core.db.DBInitializer.class).asEagerSingleton();
bind(PlaceholderReplacer.class).toProvider(org.eclipse.che.core.db.schema.impl.flyway.PlaceholderReplacerProvider.class);
// factory
bind(FactoryAcceptValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryAcceptValidatorImpl.class);
bind(FactoryCreateValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryCreateValidatorImpl.class);
bind(FactoryEditValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryEditValidatorImpl.class);
bind(org.eclipse.che.api.factory.server.FactoryService.class);
bind(ScmService.class);
install(new org.eclipse.che.api.factory.server.jpa.FactoryJpaModule());
// Service-specific factory resolvers.
Multibinder<FactoryParametersResolver> factoryParametersResolverMultibinder = Multibinder.newSetBinder(binder(), FactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(GithubFactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(BitbucketServerAuthorizingFactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(GitlabFactoryParametersResolver.class);
Multibinder<ScmFileResolver> scmFileResolverResolverMultibinder = Multibinder.newSetBinder(binder(), ScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(GithubScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(GitlabScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(BitbucketServerScmFileResolver.class);
install(new org.eclipse.che.api.factory.server.scm.KubernetesScmModule());
install(new org.eclipse.che.api.factory.server.bitbucket.BitbucketServerModule());
install(new org.eclipse.che.api.factory.server.gitlab.GitlabModule());
install(new org.eclipse.che.api.factory.server.github.GithubModule());
bind(org.eclipse.che.api.core.rest.ApiInfoService.class);
bind(org.eclipse.che.api.ssh.server.SshService.class);
bind(org.eclipse.che.api.user.server.UserService.class);
bind(org.eclipse.che.api.user.server.ProfileService.class);
bind(org.eclipse.che.api.user.server.PreferencesService.class);
bind(org.eclipse.che.security.oauth.OAuthAuthenticationService.class);
bind(org.eclipse.che.security.oauth1.OAuthAuthenticationService.class);
install(new DevfileModule());
bind(WorkspaceEntityProvider.class);
bind(org.eclipse.che.api.workspace.server.TemporaryWorkspaceRemover.class);
bind(org.eclipse.che.api.workspace.server.WorkspaceService.class);
bind(org.eclipse.che.api.devfile.server.DevfileService.class);
bind(org.eclipse.che.api.devfile.server.UserDevfileEntityProvider.class);
install(new FactoryModuleBuilder().build(ServersCheckerFactory.class));
Multibinder<InternalEnvironmentProvisioner> internalEnvironmentProvisioners = Multibinder.newSetBinder(binder(), InternalEnvironmentProvisioner.class);
internalEnvironmentProvisioners.addBinding().to(EnvVarEnvironmentProvisioner.class);
internalEnvironmentProvisioners.addBinding().to(MachineNameProvisioner.class);
Multibinder<EnvVarProvider> envVarProviders = Multibinder.newSetBinder(binder(), EnvVarProvider.class);
envVarProviders.addBinding().to(CheApiEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiInternalEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiExternalEnvVarProvider.class);
envVarProviders.addBinding().to(MachineTokenEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceIdEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceNamespaceNameEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceNameEnvVarProvider.class);
envVarProviders.addBinding().to(ProjectsRootEnvVariableProvider.class);
Multibinder<LegacyEnvVarProvider> legacyEnvVarProviderMultibinders = Multibinder.newSetBinder(binder(), LegacyEnvVarProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(JavaOptsEnvVariableProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(MavenOptsEnvVariableProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(AgentAuthEnableEnvVarProvider.class);
bind(org.eclipse.che.api.workspace.server.event.WorkspaceJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.everrest.EverrestDownloadFileResponseFilter.class);
bind(org.eclipse.che.everrest.ETagResponseFilter.class);
// temporary solution
bind(org.eclipse.che.api.workspace.server.event.RuntimeStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.MachineStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.ServerStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.RuntimeLogJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.security.oauth.OAuthAuthenticatorProvider.class).to(org.eclipse.che.security.oauth.OAuthAuthenticatorProviderImpl.class);
install(new org.eclipse.che.api.core.rest.CoreRestModule());
install(new org.eclipse.che.api.core.util.FileCleaner.FileCleanerModule());
install(new org.eclipse.che.swagger.deploy.DocsModule());
install(new org.eclipse.che.commons.schedule.executor.ScheduleModule());
install(new org.eclipse.che.api.logger.deploy.LoggerModule());
final Multibinder<MessageBodyAdapter> adaptersMultibinder = Multibinder.newSetBinder(binder(), MessageBodyAdapter.class);
final MessageBodyAdapterInterceptor interceptor = new MessageBodyAdapterInterceptor();
requestInjection(interceptor);
bindInterceptor(subclassesOf(CheJsonProvider.class), names("readFrom"), interceptor);
// system components
install(new SystemModule());
Multibinder<ServiceTermination> terminationMultiBinder = Multibinder.newSetBinder(binder(), ServiceTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.workspace.server.WorkspaceServiceTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.system.server.CronThreadPullTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.workspace.server.hc.probe.ProbeSchedulerTermination.class);
bind(DBTermination.class);
final Map<String, String> persistenceProperties = new HashMap<>();
persistenceProperties.put(PersistenceUnitProperties.TARGET_SERVER, "None");
persistenceProperties.put(PersistenceUnitProperties.LOGGING_LOGGER, "DefaultLogger");
persistenceProperties.put(PersistenceUnitProperties.LOGGING_LEVEL, "SEVERE");
persistenceProperties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, "java:/comp/env/jdbc/che");
bindConstant().annotatedWith(Names.named("jndi.datasource.name")).to("java:/comp/env/jdbc/che");
String infrastructure = System.getenv("CHE_INFRASTRUCTURE_ACTIVE");
install(new FactoryModuleBuilder().build(JwtProxyConfigBuilderFactory.class));
install(new FactoryModuleBuilder().build(PassThroughProxyProvisionerFactory.class));
installDefaultSecureServerExposer(infrastructure);
install(new org.eclipse.che.security.oauth1.BitbucketModule());
install(new GitLabModule());
configureMultiUserMode(persistenceProperties, infrastructure);
install(new com.google.inject.persist.jpa.JpaPersistModule("main").properties(persistenceProperties));
if (OpenShiftInfrastructure.NAME.equals(infrastructure)) {
install(new OpenShiftInfraModule());
} else if (KubernetesInfrastructure.NAME.equals(infrastructure)) {
install(new KubernetesInfraModule());
}
install(new CheJsonRpcWebSocketConfigurationModule());
bind(org.eclipse.che.api.user.server.AppStatesPreferenceCleaner.class);
MapBinder.newMapBinder(binder(), String.class, ChePluginsApplier.class);
if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) {
install(new org.eclipse.che.core.tracing.TracingModule());
} else {
install(new org.eclipse.che.core.tracing.NopTracingModule());
}
if (Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) {
install(new org.eclipse.che.core.metrics.MetricsModule());
install(new WsMasterMetricsModule());
install(new InfrastructureMetricsModule());
} else {
install(new org.eclipse.che.core.metrics.NoopMetricsModule());
}
if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED")) && Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) {
install(new TracingMetricsModule());
}
install(new ExecutorWrapperModule());
install(new OpenShiftOAuthModule());
}
use of org.eclipse.che.api.factory.server.FactoryParametersResolver in project devspaces-images by redhat-developer.
the class WsMasterModule method configure.
@Override
protected void configure() {
// Can be removed after upgrade to Fabric8 4.10.2 or higher or to Java 11
if (System.getProperty("java.version", "").startsWith("1.8")) {
System.setProperty("http2.disable", "true");
}
// db related components modules
install(new org.eclipse.che.account.api.AccountModule());
install(new org.eclipse.che.api.ssh.server.jpa.SshJpaModule());
install(new org.eclipse.che.api.core.jsonrpc.impl.JsonRpcModule());
install(new org.eclipse.che.api.core.websocket.impl.WebSocketModule());
// db configuration
bind(SchemaInitializer.class).to(org.eclipse.che.core.db.schema.impl.flyway.FlywaySchemaInitializer.class);
bind(org.eclipse.che.core.db.DBInitializer.class).asEagerSingleton();
bind(PlaceholderReplacer.class).toProvider(org.eclipse.che.core.db.schema.impl.flyway.PlaceholderReplacerProvider.class);
// factory
bind(FactoryAcceptValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryAcceptValidatorImpl.class);
bind(FactoryCreateValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryCreateValidatorImpl.class);
bind(FactoryEditValidator.class).to(org.eclipse.che.api.factory.server.impl.FactoryEditValidatorImpl.class);
bind(org.eclipse.che.api.factory.server.FactoryService.class);
bind(ScmService.class);
install(new org.eclipse.che.api.factory.server.jpa.FactoryJpaModule());
// Service-specific factory resolvers.
Multibinder<FactoryParametersResolver> factoryParametersResolverMultibinder = Multibinder.newSetBinder(binder(), FactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(GithubFactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(BitbucketServerAuthorizingFactoryParametersResolver.class);
factoryParametersResolverMultibinder.addBinding().to(GitlabFactoryParametersResolver.class);
Multibinder<ScmFileResolver> scmFileResolverResolverMultibinder = Multibinder.newSetBinder(binder(), ScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(GithubScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(GitlabScmFileResolver.class);
scmFileResolverResolverMultibinder.addBinding().to(BitbucketServerScmFileResolver.class);
install(new org.eclipse.che.api.factory.server.scm.KubernetesScmModule());
install(new org.eclipse.che.api.factory.server.bitbucket.BitbucketServerModule());
install(new org.eclipse.che.api.factory.server.gitlab.GitlabModule());
install(new org.eclipse.che.api.factory.server.github.GithubModule());
bind(org.eclipse.che.api.core.rest.ApiInfoService.class);
bind(org.eclipse.che.api.ssh.server.SshService.class);
bind(org.eclipse.che.api.user.server.UserService.class);
bind(org.eclipse.che.api.user.server.ProfileService.class);
bind(org.eclipse.che.api.user.server.PreferencesService.class);
bind(org.eclipse.che.security.oauth.OAuthAuthenticationService.class);
bind(org.eclipse.che.security.oauth1.OAuthAuthenticationService.class);
install(new DevfileModule());
bind(WorkspaceEntityProvider.class);
bind(org.eclipse.che.api.workspace.server.TemporaryWorkspaceRemover.class);
bind(org.eclipse.che.api.workspace.server.WorkspaceService.class);
bind(org.eclipse.che.api.devfile.server.DevfileService.class);
bind(org.eclipse.che.api.devfile.server.UserDevfileEntityProvider.class);
install(new FactoryModuleBuilder().build(ServersCheckerFactory.class));
Multibinder<InternalEnvironmentProvisioner> internalEnvironmentProvisioners = Multibinder.newSetBinder(binder(), InternalEnvironmentProvisioner.class);
internalEnvironmentProvisioners.addBinding().to(EnvVarEnvironmentProvisioner.class);
internalEnvironmentProvisioners.addBinding().to(MachineNameProvisioner.class);
Multibinder<EnvVarProvider> envVarProviders = Multibinder.newSetBinder(binder(), EnvVarProvider.class);
envVarProviders.addBinding().to(CheApiEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiInternalEnvVarProvider.class);
envVarProviders.addBinding().to(CheApiExternalEnvVarProvider.class);
envVarProviders.addBinding().to(MachineTokenEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceIdEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceNamespaceNameEnvVarProvider.class);
envVarProviders.addBinding().to(WorkspaceNameEnvVarProvider.class);
envVarProviders.addBinding().to(ProjectsRootEnvVariableProvider.class);
Multibinder<LegacyEnvVarProvider> legacyEnvVarProviderMultibinders = Multibinder.newSetBinder(binder(), LegacyEnvVarProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(JavaOptsEnvVariableProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(MavenOptsEnvVariableProvider.class);
legacyEnvVarProviderMultibinders.addBinding().to(AgentAuthEnableEnvVarProvider.class);
bind(org.eclipse.che.api.workspace.server.event.WorkspaceJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.everrest.EverrestDownloadFileResponseFilter.class);
bind(org.eclipse.che.everrest.ETagResponseFilter.class);
// temporary solution
bind(org.eclipse.che.api.workspace.server.event.RuntimeStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.MachineStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.ServerStatusJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.api.workspace.server.event.RuntimeLogJsonRpcMessenger.class).asEagerSingleton();
bind(org.eclipse.che.security.oauth.OAuthAuthenticatorProvider.class).to(org.eclipse.che.security.oauth.OAuthAuthenticatorProviderImpl.class);
install(new org.eclipse.che.api.core.rest.CoreRestModule());
install(new org.eclipse.che.api.core.util.FileCleaner.FileCleanerModule());
install(new org.eclipse.che.swagger.deploy.DocsModule());
install(new org.eclipse.che.commons.schedule.executor.ScheduleModule());
install(new org.eclipse.che.api.logger.deploy.LoggerModule());
final Multibinder<MessageBodyAdapter> adaptersMultibinder = Multibinder.newSetBinder(binder(), MessageBodyAdapter.class);
final MessageBodyAdapterInterceptor interceptor = new MessageBodyAdapterInterceptor();
requestInjection(interceptor);
bindInterceptor(subclassesOf(CheJsonProvider.class), names("readFrom"), interceptor);
// system components
install(new SystemModule());
Multibinder<ServiceTermination> terminationMultiBinder = Multibinder.newSetBinder(binder(), ServiceTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.workspace.server.WorkspaceServiceTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.system.server.CronThreadPullTermination.class);
terminationMultiBinder.addBinding().to(org.eclipse.che.api.workspace.server.hc.probe.ProbeSchedulerTermination.class);
bind(DBTermination.class);
final Map<String, String> persistenceProperties = new HashMap<>();
persistenceProperties.put(PersistenceUnitProperties.TARGET_SERVER, "None");
persistenceProperties.put(PersistenceUnitProperties.LOGGING_LOGGER, "DefaultLogger");
persistenceProperties.put(PersistenceUnitProperties.LOGGING_LEVEL, "SEVERE");
persistenceProperties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, "java:/comp/env/jdbc/che");
bindConstant().annotatedWith(Names.named("jndi.datasource.name")).to("java:/comp/env/jdbc/che");
String infrastructure = System.getenv("CHE_INFRASTRUCTURE_ACTIVE");
install(new FactoryModuleBuilder().build(JwtProxyConfigBuilderFactory.class));
install(new FactoryModuleBuilder().build(PassThroughProxyProvisionerFactory.class));
installDefaultSecureServerExposer(infrastructure);
install(new org.eclipse.che.security.oauth1.BitbucketModule());
install(new GitLabModule());
configureMultiUserMode(persistenceProperties, infrastructure);
install(new com.google.inject.persist.jpa.JpaPersistModule("main").properties(persistenceProperties));
if (OpenShiftInfrastructure.NAME.equals(infrastructure)) {
install(new OpenShiftInfraModule());
} else if (KubernetesInfrastructure.NAME.equals(infrastructure)) {
install(new KubernetesInfraModule());
}
install(new CheJsonRpcWebSocketConfigurationModule());
bind(org.eclipse.che.api.user.server.AppStatesPreferenceCleaner.class);
MapBinder.newMapBinder(binder(), String.class, ChePluginsApplier.class);
if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED"))) {
install(new org.eclipse.che.core.tracing.TracingModule());
} else {
install(new org.eclipse.che.core.tracing.NopTracingModule());
}
if (Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) {
install(new org.eclipse.che.core.metrics.MetricsModule());
install(new WsMasterMetricsModule());
install(new InfrastructureMetricsModule());
} else {
install(new org.eclipse.che.core.metrics.NoopMetricsModule());
}
if (Boolean.valueOf(System.getenv("CHE_TRACING_ENABLED")) && Boolean.valueOf(System.getenv("CHE_METRICS_ENABLED"))) {
install(new TracingMetricsModule());
}
install(new ExecutorWrapperModule());
install(new OpenShiftOAuthModule());
}
Aggregations