fineract-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iamrupok <...@git.apache.org>
Subject [GitHub] fineract pull request #369: Adhoc query API
Date Thu, 15 Jun 2017 07:16:04 GMT
Github user iamrupok commented on a diff in the pull request:

    https://github.com/apache/fineract/pull/369#discussion_r122134075
  
    --- Diff: fineract-provider/src/main/java/org/apache/fineract/adhocquery/service/AdHocScheduledJobRunnerServiceImpl.java
---
    @@ -0,0 +1,80 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements. See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership. The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License. You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied. See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.fineract.adhocquery.service;
    +
    +import java.util.Collection;
    +
    +import org.apache.fineract.adhocquery.data.AdHocData;
    +import org.apache.fineract.adhocquery.service.AdHocReadPlatformService;
    +import org.apache.fineract.infrastructure.core.service.RoutingDataSourceServiceFactory;
    +import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil;
    +import org.apache.fineract.infrastructure.jobs.annotation.CronTarget;
    +import org.apache.fineract.infrastructure.jobs.service.JobName;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import org.springframework.beans.factory.annotation.Autowired;
    +import org.springframework.jdbc.core.JdbcTemplate;
    +import org.springframework.stereotype.Service;
    +import org.springframework.transaction.annotation.Transactional;
    +
    +@Service(value = "adHocScheduledJobRunnerService")
    +public class AdHocScheduledJobRunnerServiceImpl implements AdHocScheduledJobRunnerService
{
    +
    +    private final static Logger logger = LoggerFactory.getLogger(AdHocScheduledJobRunnerServiceImpl.class);
    +    private final RoutingDataSourceServiceFactory dataSourceServiceFactory;
    +    private final AdHocReadPlatformService adHocReadPlatformService;
    +    
    +    @Autowired
    +    public AdHocScheduledJobRunnerServiceImpl(final RoutingDataSourceServiceFactory dataSourceServiceFactory,
    +    		final AdHocReadPlatformService adHocReadPlatformService
    +            ) {
    +        this.dataSourceServiceFactory = dataSourceServiceFactory;
    +        this.adHocReadPlatformService = adHocReadPlatformService;
    +       
    +    }
    +
    +    @Transactional
    +    @Override
    +    @CronTarget(jobName = JobName.GENERATE_ADHOCCLIENT_SCEHDULE)
    +    public void generateClientSchedule() {
    +    	final JdbcTemplate jdbcTemplate = new JdbcTemplate(this.dataSourceServiceFactory.determineDataSourceService().retrieveDataSource());
    --- End diff --
    
      @Autowired
        public AdHocScheduledJobRunnerServiceImpl(final RoutingDataSource dataSource,
        		final AdHocReadPlatformService adHocReadPlatformService
                ) {
        	this.jdbcTemplate = new JdbcTemplate(dataSource);
            this.adHocReadPlatformService = adHocReadPlatformService;
           
        }
    
    like this


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message