org.appops.service.job.JobExecServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appops-br-service-base Show documentation
Show all versions of appops-br-service-base Show documentation
appops black rhino service base
/*
* AppOps is a Java framework to develop, deploy microservices with ease and is available for free
* and common use developed by AinoSoft ( www.ainosoft.com )
*
* AppOps and AinoSoft are registered trademarks of Aino Softwares private limited, India.
*
* Copyright (C) <2016>
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version along with applicable additional terms as
* provisioned by GPL 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License and applicable additional terms
* along with this program.
*
* If not, see and
*/
package org.appops.service.job;
import com.google.inject.Inject;
import com.google.inject.Injector;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Parameter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.appops.core.ClassPathAnalyser;
import org.appops.core.annotation.JobEntry;
import org.appops.core.job.token.JobToken;
import org.appops.logging.impl.LogManager;
import org.appops.logging.logger.Logger;
import org.appops.logging.meta.Level;
import org.appops.marshaller.DescriptorType;
import org.appops.marshaller.Marshaller;
import org.appops.service.crypto.ContentCrypto;
import org.appops.service.exception.InvocationException;
import org.appops.service.job.pool.JobPool;
/**
* Processor class which processes a single job token to execute job. This class is to be used in
* JobExecutorService entry point.
*
* @author deba
* @version $Id: $Id
*/
public class JobExecServiceImpl implements JobExecService {
@Inject
private Injector injector;
private JobPool pool;
private Logger logger;
/**
*
* Constructor for JobExecServiceImpl.
*
*/
protected JobExecServiceImpl() {
}
@Inject
/**
*
* Constructor for JobExecServiceImpl.
*
*
* @param logManager a {@link org.appops.logging.impl.LogManager} object.
*/
protected JobExecServiceImpl(LogManager logManager) {
logger = logManager.getRootLogger();
}
/**
* {@inheritDoc}
*
* Decrypt job token and executes job by using job token provided.
*/
@Override
public void executeJob(String token) {
try {
JobToken jobToken = decryptToken(token);
if (jobToken != null) {
Class> jobClazz = Class.forName(jobToken.getJobClassName());
Object jobClassObject = injector.getInstance(jobClazz);
Method method = getMethod(jobClazz);
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy