Java Code Examples for org.springframework.context.annotation.Bean

The following are top voted examples for showing how to use org.springframework.context.annotation.Bean. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: spring-boot-starter-rocketmq   File: RocketMQAutoConfiguration.java   View source code 6 votes vote down vote up
@Bean
@ConditionalOnClass(DefaultMQProducer.class)
@ConditionalOnMissingBean(DefaultMQProducer.class)
@ConditionalOnProperty(prefix = "spring.rocketmq", value = {"nameServer", "producer.group"})
public DefaultMQProducer mqProducer(RocketMQProperties rocketMQProperties) {

    RocketMQProperties.Producer producerConfig = rocketMQProperties.getProducer();
    String groupName = producerConfig.getGroup();
    Assert.hasText(groupName, "[spring.rocketmq.producer.group] must not be null");

    DefaultMQProducer producer = new DefaultMQProducer(producerConfig.getGroup());
    producer.setNamesrvAddr(rocketMQProperties.getNameServer());
    producer.setSendMsgTimeout(producerConfig.getSendMsgTimeout());
    producer.setRetryTimesWhenSendFailed(producerConfig.getRetryTimesWhenSendFailed());
    producer.setRetryTimesWhenSendAsyncFailed(producerConfig.getRetryTimesWhenSendAsyncFailed());
    producer.setMaxMessageSize(producerConfig.getMaxMessageSize());
    producer.setCompressMsgBodyOverHowmuch(producerConfig.getCompressMsgBodyOverHowmuch());
    producer.setRetryAnotherBrokerWhenNotStoreOK(producerConfig.isRetryAnotherBrokerWhenNotStoreOk());

    return producer;
}
 
Example 2
Project: camunda-task-dispatcher   File: JmsExternalTaskReceiverConfig.java   View source code 6 votes vote down vote up
@Bean
@Autowired
public DefaultMessageListenerContainer taskMessageListenerContainer(JmsExternalTaskListener externalTaskListener
        , ConnectionFactory receiverConnectionFactory
        , ActiveMQQueue taskQueue) {
    DefaultMessageListenerContainer listenerContainer = new DefaultMessageListenerContainer();
    listenerContainer.setMessageListener(externalTaskListener);
    listenerContainer.setDestination(taskQueue);
    listenerContainer.setConnectionFactory(receiverConnectionFactory);

    listenerContainer.setAcceptMessagesWhileStopping(false);
    listenerContainer.setSessionTransacted(true);
    listenerContainer.setConcurrentConsumers(concurrentConsumers);
    listenerContainer.setMaxMessagesPerTask(maxMessagesPerTask);
    listenerContainer.setReceiveTimeout(receiveTimeout);
    return listenerContainer;
}
 
Example 3
Project: buabook-api-interface   File: BuaBookApiInterfaceConfig.java   View source code 6 votes vote down vote up
@Bean
public TaskScheduler bbTaskScheduler() {
	ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
	taskScheduler.setThreadNamePrefix("API-Schd-ThrP-");
	taskScheduler.setAwaitTerminationSeconds(1);
	taskScheduler.setRejectedExecutionHandler(new ThreadPoolTaskRejectedHandler());
	
	return taskScheduler;
}
 
Example 4
Project: spring-seed   File: SpringSeedRedis.java   View source code 6 votes vote down vote up
/**
 * this was used to generate unique key for each method, the key will be like:
 * className + methodName + args.
 */
@Bean
public KeyGenerator keyGenerator() {
	return new KeyGenerator() {
		@Override
		public Object generate(Object target, Method method, Object... params) {
			StringBuilder sb = new StringBuilder();
			sb.append(target.getClass().getName());
			sb.append(":");
			sb.append(method.getName());
			sb.append(":");
			for (Object obj : params) {
				sb.append(String.valueOf(obj));
				sb.append(":");
			}
			return sb.toString();
		}
	};
}
 
Example 5
Project: TARA-Server   File: CasCoreAuthenticationHandlersConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "jaasAuthenticationHandlers")
@RefreshScope
@Bean
public List<AuthenticationHandler> jaasAuthenticationHandlers() {
    return casProperties.getAuthn().getJaas()
        .stream()
        .filter(jaas -> StringUtils.isNotBlank(jaas.getRealm()))
        .map(jaas -> {
            final JaasAuthenticationHandler h =
                new JaasAuthenticationHandler(jaas.getName(),
                    servicesManager, jaasPrincipalFactory(), null);

            h.setKerberosKdcSystemProperty(jaas.getKerberosKdcSystemProperty());
            h.setKerberosRealmSystemProperty(jaas.getKerberosRealmSystemProperty());
            h.setRealm(jaas.getRealm());
            h.setPasswordEncoder(Beans.newPasswordEncoder(jaas.getPasswordEncoder()));

            if (jaasPasswordPolicyConfiguration != null) {
                h.setPasswordPolicyConfiguration(jaasPasswordPolicyConfiguration);
            }
            h.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(
                jaas.getPrincipalTransformation()));
            h.setCredentialSelectionPredicate(Beans.newCredentialSelectionPredicate(
                jaas.getCredentialCriteria()));
            return h;
        })
        .collect(Collectors.toList());
}
 
Example 6
Project: OperatieBRP   File: BevragingGbaVerzoekVerwerkerProvider.java   View source code 5 votes vote down vote up
/**
 * {@link BevragingVerzoekVerwerker} specifiek voor GBA Ad hoc webservice(Persoons)vraag.
 * @return de GBA Ad hoc webservice (Persoons)vraag verwerker
 */
@Bean
@Named("gbaPersoonsvraagWebserviceVerwerker")
public BevragingVerzoekVerwerker<PersoonsvraagWebserviceVerzoek> persoonsvraagWebserviceVerzoekVerwerker() {
    return new GeneriekeBevragingVerzoekVerwerker<PersoonsvraagWebserviceVerzoek, BevragingResultaat>() {
    };
}
 
Example 7
Project: cryptoexchange   File: DbTestConfiguration.java   View source code 5 votes vote down vote up
@Bean
public DataSource createDataSource() {
	HikariConfig config = new HikariConfig();
	config.setJdbcUrl(this.url);
	config.setUsername(this.username);
	config.setPassword(this.password);
	config.addDataSourceProperty("poolName", this.poolName);
	config.addDataSourceProperty("connectionTimeout", this.connectionTimeout);
	config.addDataSourceProperty("autoCommit", "false");
	return new HikariDataSource(config);
}
 
Example 8
Project: OAuth-2.0-Cookbook   File: GoogleConfiguration.java   View source code 5 votes vote down vote up
@Bean
public OAuth2ProtectedResourceDetails resourceDetails() {
    AuthorizationCodeResourceDetails details = new AuthorizationCodeResourceDetails();
    details.setClientId(properties.getClientId());
    details.setClientSecret(properties.getClientSecret());

    // URLs retrieved from https://accounts.google.com/.well-known/openid-configuration
    details.setUserAuthorizationUri("https://accounts.google.com/o/oauth2/v2/auth");
    details.setAccessTokenUri("https://www.googleapis.com/oauth2/v4/token");
    details.setPreEstablishedRedirectUri("http://localhost:8080/google/callback");
    details.setScope(Arrays.asList("openid", "email", "profile"));
    details.setUseCurrentUri(false);
    return details;
}
 
Example 9
Project: java-api-best-practices   File: SecurityConfiguration.java   View source code 5 votes vote down vote up
@Bean
public FilterRegistrationBean corsFilter() {
  FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();
  filterRegistrationBean.setFilter(new CorsFilter());
  // Highest priority to authorise OPTION requests.
  filterRegistrationBean.setOrder(0);
  return filterRegistrationBean;
}
 
Example 10
Project: Spring-Security-Third-Edition   File: SecurityConfig.java   View source code 5 votes vote down vote up
/**
 * LDAP Server Context
 * @return
 */
@Bean
public DefaultSpringSecurityContextSource contextSource() {
    return new DefaultSpringSecurityContextSource(
            Arrays.asList("ldap://corp.jbcpcalendar.com/"), "dc=corp,dc=jbcpcalendar,dc=com"){{

        setUserDn("CN=Administrator,CN=Users,DC=corp,DC=jbcpcalendar,DC=com");
        setPassword("admin123!");
    }};
}
 
Example 11
Project: sponge   File: SpringConfiguration.java   View source code 5 votes vote down vote up
/**
 * Camel routes for reading RSS feeds. Routes could be also defined in XML, Groovy or scripting knowledge bases.
 *
 * @return route builder.
 */
@Bean
public RouteBuilder rssInputRoute() {
    return new RouteBuilder() {

        // @formatter:off
        @SuppressWarnings("unchecked")
        @Override
        public void configure() throws Exception {
            EngineOperations operations = camelRssEngine().getOperations();
            Map<String, String> rssSources = operations.getVariable(Map.class, CamelRssConstants.VAR_RSS_SOURCES);

            // Read RSS feeds from all configured sources.
            rssSources.forEach((source, url) ->
                    from("rss:" + url + operations.getVariable(CamelRssConstants.VAR_RSS_ENDPOINT_PARAMETERS, "")).routeId(source)
                        .setHeader(HEADER_SOURCE).constant(source)
                        .to("direct:rss"));

            // Gathers RSS from different sources and sends to Sponge engine as a normalized event.
            from("direct:rss").routeId("rss")
                    .marshal().rss()
                    // Deduplicate by title.
                    .idempotentConsumer(xpath("/rss/channel/item/title/text()"),
                            MemoryIdempotentRepository.memoryIdempotentRepository())
                    // Conversion from RSS XML to Sponge event with attributes.
                    .process((exchange) -> exchange.getIn().setBody(operations.event("news")
                            .set("source", exchange.getIn().getHeader(HEADER_SOURCE))
                            .set("channel", CamelUtils.xpath(exchange, "/rss/channel/title/text()"))
                            .set("title", CamelUtils.xpath(exchange, "/rss/channel/item/title/text()"))
                            .set("link", CamelUtils.xpath(exchange, "/rss/channel/item/link/text()"))
                            .set("description", CamelUtils.xpath(exchange, "/rss/channel/item/description/text()"))
                            .make()))
                    //.filter((exchange) -> false)
                    .to("sponge:camelRssEngine");
        }
        // @formatter:on
    };
}
 
Example 12
Project: spring-batch-support   File: SpringBatchDefaultServiceConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(JobExplorer.class)
public JobExplorer getJobExplorer() throws Exception {
	BatchConfigurer batchConfigurer = getBatchConfigurer();
	if (batchConfigurer != null) {
		return batchConfigurer.getJobExplorer();
	}
	JobExplorerFactoryBean jobExplorerFactoryBean = new JobExplorerFactoryBean();
	jobExplorerFactoryBean.setDataSource(dataSource);
	return jobExplorerFactoryBean.getObject();
}
 
Example 13
Project: app-ms   File: TestConfig.java   View source code 5 votes vote down vote up
@Bean
public ClientValidator clientValidator() throws Exception {

    final ClientValidator mock = mock(ClientValidator.class);
    when(mock.isValid(eq(GrantTypes.OPENID), anyString())).thenReturn(true);
    return mock;
}
 
Example 14
Project: spring-cloud-gcp   File: GcpPubSubAutoConfiguration.java   View source code 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public SubscriptionAdminClient subscriptionAdminClient() {
	try {
		return SubscriptionAdminClient.create(
				SubscriptionAdminSettings.newBuilder()
						.setCredentialsProvider(this.finalCredentialsProvider)
						.build());
	}
	catch (IOException ioe) {
		throw new PubSubException("An error occurred while creating SubscriptionAdminClient.",
				ioe);
	}
}
 
Example 15
Project: springboot-seed   File: Swagger2Config.java   View source code 5 votes vote down vote up
@Bean
public Docket createRestApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .apis(RequestHandlerSelectors.basePackage("com.wind.web"))
            .paths(PathSelectors.any())
            .build();
}
 
Example 16
Project: myblog   File: ShiroConfig.java   View source code 5 votes vote down vote up
/**
 * 再加载securityManager
 * @param manager
 * @return
 */
@Bean
public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(@Qualifier("securityManager") SecurityManager manager) {
    AuthorizationAttributeSourceAdvisor advisor=new AuthorizationAttributeSourceAdvisor();
    advisor.setSecurityManager(manager);
    return advisor;
}
 
Example 17
Project: Spring-Security-Third-Edition   File: WebMvcConfig.java   View source code 5 votes vote down vote up
/**
 * We mention this in the book, but this helps to ensure that the intercept-url patterns prevent access to our
 * controllers. For example, once security has been applied for administrators try commenting out the modifications
 * to the super class and requesting <a
 * href="http://localhost:800/calendar/events/.html">http://localhost:800/calendar/events/.html</a>. You will
 * observe that security is bypassed since it did not match the pattern we provided. In later chapters, we discuss
 * how to secure the service tier which helps mitigate bypassing of the URL based security too.
 */
// FIXME: FInd out what this is and why it is here.
@Bean
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
    RequestMappingHandlerMapping result = new RequestMappingHandlerMapping();
    result.setUseSuffixPatternMatch(false);
    result.setUseTrailingSlashMatch(false);
    return result;
}
 
Example 18
Project: yggdrasil-mock   File: YggdrasilMockServer.java   View source code 5 votes vote down vote up
@Bean
public ServerMeta serverMeta(@Value("#{publickeyPem}") String publickeyPem) {
	ServerMeta meta = new ServerMeta();
	meta.setSignaturePublickey(publickeyPem);
	meta.setSkinDomains(skinDomains);
	meta.setMeta(ofEntries(
			entry("serverName", "yggdrasil mock server"),
			entry("implementationName", "yggdrasil-mock-server"),
			entry("implementationVersion", "0.0.1")));
	return meta;
}
 
Example 19
Project: godeye   File: ZipkinConfig.java   View source code 5 votes vote down vote up
@Bean
public SpanCollector spanCollector() {
  HttpSpanCollector.Config config =
      HttpSpanCollector.Config.builder()
          .connectTimeout(properties.getConnectTimeout())
          .readTimeout(properties.getReadTimeout())
          .compressionEnabled(properties.isCompressionEnabled())
          .flushInterval(properties.getFlushInterval())
          .build();
  return HttpSpanCollector.create(
      properties.getUrl(), config, new EmptySpanCollectorMetricsHandler());
}
 
Example 20
Project: cas-5.1.0   File: CasOAuthConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "requiresAuthenticationAccessTokenInterceptor")
@Bean
@RefreshScope
public SecurityInterceptor requiresAuthenticationAccessTokenInterceptor() {
    final String clients = Stream.of(Authenticators.CAS_OAUTH_CLIENT_BASIC_AUTHN,
            Authenticators.CAS_OAUTH_CLIENT_DIRECT_FORM,
            Authenticators.CAS_OAUTH_CLIENT_USER_FORM).collect(Collectors.joining(","));
    return new SecurityInterceptor(oauthSecConfig(), clients);
}
 
Example 21
Project: openaffect-server   File: SwaggerDocumentationConfig.java   View source code 5 votes vote down vote up
@Bean
public Docket customImplementation(){
    return new Docket(DocumentationType.SWAGGER_2)
            .select()
                .apis(RequestHandlerSelectors.basePackage("io.openaffect.api"))
                .build()
            .directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class)
            .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class)
            .apiInfo(apiInfo());
}
 
Example 22
Project: Spring-Security-Third-Edition   File: AclConfig.java   View source code 5 votes vote down vote up
@Bean
public LookupStrategy lookupStrategy(){
    BasicLookupStrategy ls = new BasicLookupStrategy(
                                            dataSource,
                                            aclCache(),
                                            aclAuthorizationStrategy(),
                                            consoleAuditLogger());

    ls.setPermissionFactory(permissionFactory());
    return ls;
}
 
Example 23
Project: Spring-Security-Third-Edition   File: WebMvcConfig.java   View source code 5 votes vote down vote up
@Bean
public ReloadableResourceBundleMessageSource messageSource() {
    ReloadableResourceBundleMessageSource resource = new ReloadableResourceBundleMessageSource();
    resource.setBasenames("/WEB-INF/locales/messages");
    resource.setDefaultEncoding("UTF-8");
    resource.setFallbackToSystemLocale(Boolean.TRUE);
    return resource;
}
 
Example 24
Project: springboot   File: DruidDataSourceConfig.java   View source code 5 votes vote down vote up
@Bean(name="dataSource")
//标志这个 Bean 如果在多个同类 Bean 候选时,该 Bean 优先被考虑。「多数据源配置的时候注意,必须要有一个主数据源,用 @Primary 标志该 Bean
@Primary
public DataSource dataSource(){
	DruidDataSource druidDataSource = new DruidDataSource();
	druidDataSource.setUrl(url);
	druidDataSource.setUsername(user);
	druidDataSource.setPassword(password);
	druidDataSource.setDriverClassName(driverClass);
	return druidDataSource;
	
}
 
Example 25
Project: Spring-5.0-Cookbook   File: ReactiveChatSocketConfig.java   View source code 5 votes vote down vote up
@Bean
public HandlerMapping webSocketMapping() {
	Map<String, WebSocketHandler> map = new HashMap<>();
	map.put("/react", messageWebSocketHandler);

	SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
	mapping.setOrder(10);
	mapping.setUrlMap(map);
	return mapping;
}
 
Example 26
Project: Spring-5.0-Cookbook   File: LoginFuncReactControllers.java   View source code 5 votes vote down vote up
@Bean
public RouterFunction<ServerResponse> userServiceBox() {
    return route(GET("/listFluxUsers"), loginHandler::userDetailsList)
    		   .andRoute(GET("/selectUserById/{id}"), loginHandler::userDetailsById)
    		   .andRoute(POST("/selectFluxUsers"), loginHandler::chooseFluxUserDetails)
    		   .andRoute(POST("/saveUser"), loginHandler::saveUserdetailsMono)
    		   .andRoute(GET("/selectUserByFirstName/{fname}"), loginHandler::chooseUserByFirstName)
    		   .andRoute(GET("/selectUserByLastName/{lname}"), loginHandler::chooseUserByLastName);
}
 
Example 27
Project: martini-core   File: GherkinConfiguration.java   View source code 5 votes vote down vote up
@Bean
Mixology getMixology(
	@Value("${martini.mixology:#{null}}") Class<? extends Mixology> impl
) {
	return null == impl ?
		beanFactory.createBean(DefaultMixology.class) : beanFactory.createBean(impl);
}
 
Example 28
Project: cas-5.1.0   File: CasCoreWebflowConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "requestParameterAuthenticationPolicyWebflowEventResolver")
@Bean
@RefreshScope
public CasWebflowEventResolver requestParameterAuthenticationPolicyWebflowEventResolver() {
    return new RequestParameterMultifactorAuthenticationPolicyEventResolver(authenticationSystemSupport,
            centralAuthenticationService, servicesManager,
            ticketRegistrySupport, warnCookieGenerator,
            authenticationRequestServiceSelectionStrategies, selector, casProperties);
}
 
Example 29
Project: cas-5.1.0   File: ElectronicFenceConfiguration.java   View source code 5 votes vote down vote up
@ConditionalOnMissingBean(name = "authenticationRiskMitigator")
@Bean
@RefreshScope
public AuthenticationRiskMitigator authenticationRiskMitigator() {
    if (casProperties.getAuthn().getAdaptive().getRisk().getResponse().isBlockAttempt()) {
        return new DefaultAuthenticationRiskMitigator(blockAuthenticationContingencyPlan());
    }
    return new DefaultAuthenticationRiskMitigator(multifactorAuthenticationContingencyPlan());
}
 
Example 30
Project: redirector   File: AbstractFacadeBeans.java   View source code 5 votes vote down vote up
@Bean
@Scope(AppScope.APP_SCOPE)
public IAppModelFacade modelFacade(String appName, IDataSourceConnector connector, IDataChangePoller dataChangePoller,
                            IWebServiceClient dataFacadeWebServiceClient, ZKConfig config) {
    return new AppModelRestFacade.Builder()
            .withConnector(connector)
            .forApplication(appName)
            .withDataChangePoller(dataChangePoller)
            .withWebServiceClient(dataFacadeWebServiceClient)
            .withZkConfig(config)
            .build();
}
 
Example 31
Project: jwala   File: AemServiceConfiguration.java   View source code 5 votes vote down vote up
@Bean(name = "webServerService")
public WebServerService getWebServerService(final ResourceService resourceService,
                                            @Qualifier("webServerInMemoryStateManagerService")
                                            final InMemoryStateManagerService<Identifier<WebServer>, WebServerReachableState> inMemoryStateManagerService,
                                            @Value("${paths.resource-templates:../data/templates}") final String templatePath,
                                            @Value("${spring.messaging.topic.serverStates:/topic/server-states}") final String topicServerStates) {
    return new WebServerServiceImpl(
            aemPersistenceServiceConfiguration.getWebServerPersistenceService(),
            resourceService,
            inMemoryStateManagerService,
            templatePath,
            binaryDistributionLockManager);
}
 
Example 32
Project: MailTrigger   File: MailTriggerApplication.java   View source code 5 votes vote down vote up
@Bean
public Executor asyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(2);
    executor.setMaxPoolSize(2);
    executor.setQueueCapacity(500);
    executor.setThreadNamePrefix("MailSender-");
    executor.initialize();

    return executor;
}
 
Example 33
Project: Microservices-with-JHipster-and-Spring-Boot   File: WebConfigurer.java   View source code 5 votes vote down vote up
@Bean
public CorsFilter corsFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
    CorsConfiguration config = jHipsterProperties.getCors();
    if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
        log.debug("Registering CORS filter");
        source.registerCorsConfiguration("/api/**", config);
        source.registerCorsConfiguration("/v2/api-docs", config);
    }
    return new CorsFilter(source);
}
 
Example 34
Project: talchain   File: RopstenSample.java   View source code 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    sLogger.info("Starting EthereumJ!");

    class SampleConfig extends RopstenSampleConfig {
        @Bean
        public RopstenSample sampleBean() {
            return new RopstenSample();
        }
    }

    Ethereum ethereum = EthereumFactory.createEthereum(SampleConfig.class);
}
 
Example 35
Project: cas-5.1.0   File: CasSupportActionsAcceptableUsagePolicyLdapConfiguration.java   View source code 5 votes vote down vote up
@RefreshScope
@Bean
public AcceptableUsagePolicyRepository acceptableUsagePolicyRepository() {
    final AcceptableUsagePolicyProperties.Ldap ldap = casProperties.getAcceptableUsagePolicy().getLdap();
    final ConnectionFactory connectionFactory = Beans.newLdaptivePooledConnectionFactory(ldap);
    final LdapAcceptableUsagePolicyRepository r = new LdapAcceptableUsagePolicyRepository(ticketRegistrySupport, 
            connectionFactory, ldap.getUserFilter(), ldap.getBaseDn());
    r.setAupAttributeName(casProperties.getAcceptableUsagePolicy().getAupAttributeName());
    return r;
}
 
Example 36
Project: EvoMaster   File: DbDirectIntApplication.java   View source code 5 votes vote down vote up
@Bean
public Docket piApi() {
    return new Docket(DocumentationType.SWAGGER_2)
            .apiInfo(apiInfo())
            .select()
            .paths(regex("/api/db/directint.*"))
            .build();
}
 
Example 37
Project: spring-boot-vaadin-rabbitmq-pipeline-demo   File: AppConfig.java   View source code 4 votes vote down vote up
@Bean
DataGrid dataGrid() {
	return new DataGrid();
}
 
Example 38
Project: grpc-java-contrib   File: TimeServer.java   View source code 4 votes vote down vote up
@Bean(initMethod = "start")
public GrpcServerHost grpcServerHost(@Value("${port}") int port) {
    logger.info("Listening for gRPC on port " + port);
    return new GrpcServerHost(port);
}
 
Example 39
Project: EasyTransaction   File: EasyTransTestConfiguration.java   View source code 4 votes vote down vote up
@Bean
public DataSourceTransactionManager accountingTransactionManager(DataSource accounting){
	return new DataSourceTransactionManager(accounting);
}
 
Example 40
Project: xxpay-master   File: MqConfig.java   View source code 4 votes vote down vote up
@Bean
public Queue payNotifyQueue() {
    return new ActiveMQQueue(PAY_NOTIFY_QUEUE_NAME);
}