Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* This file is part of PaxmlCore.
*
* PaxmlCore is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PaxmlCore 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with PaxmlCore. If not, see .
*/
package org.paxml.launch;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicLong;
import org.paxml.core.PaxmlResource;
import org.paxml.tag.plan.PlanEntityFactory.Plan;
import org.springframework.core.io.Resource;
/**
* Launch model impl.
*
* @author Xuetao Niu
*
*/
public class LaunchModel {
/**
* Per-jvm/classloader increasing process id generator, starting from 1.
*/
private static final AtomicLong PID = new AtomicLong(1);
private final StaticConfig config = new StaticConfig();
private volatile Resource resource;
private volatile String name;
private final Map groups = Collections.synchronizedMap(new LinkedHashMap());
private final Settings globalSettings = new Settings(null);
private volatile List launchPoints;
private volatile long planProcessId;
private volatile int concurrency;
private Plan planEntity;
public long getPlanProcessId() {
return planProcessId;
}
public void setPlanProcessId(long planProcessId) {
this.planProcessId = planProcessId;
}
public Settings getGlobalSettings() {
return globalSettings;
}
public Map getGroups() {
return groups;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getConcurrency() {
return concurrency;
}
public void setConcurrency(int concurrency) {
this.concurrency = concurrency;
}
/**
* Get the selected groups to run.
*
* @return the selected
*/
private Set getSelectedGroups() {
Set set = new LinkedHashSet();
for (Matcher groupMatcher : globalSettings.getGroupMatchers()) {
for (Map.Entry groupEntry : groups.entrySet()) {
if (groupMatcher.match(groupEntry.getKey())) {
set.add(groupEntry.getValue());
}
}
}
return set;
}
/**
* Get launch points, where each point has a unique process id counting from
* 1. The process id reflects the order of the point to be submitted into
* the execution thread pool.
*
* @param forceRefresh
* false to use cached points if there are, true to always
* reparse the points which is expensive.
* @return the launch points, never null
*/
public synchronized List getLaunchPoints(boolean forceRefresh, long executionId) {
if (forceRefresh || launchPoints == null) {
List