本文整理了Java中org.apache.geronimo.kernel.repository.Artifact.matches()
方法的一些代码示例,展示了Artifact.matches()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Artifact.matches()
方法的具体详情如下:
包路径:org.apache.geronimo.kernel.repository.Artifact
类名称:Artifact
方法名:matches
[英]see if this artifact matches the other artifact (which is more specific than this one)
[中]查看此工件是否与其他工件匹配(比此工件更具体)
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
private boolean matches(Artifact candidate, Artifact query) {
return query.matches(candidate);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public Artifact[] getLoaded(Artifact query) {
List results = new ArrayList();
for (Iterator it = configurations.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
Artifact test = (Artifact) entry.getKey();
ConfigurationStatus status = (ConfigurationStatus) entry.getValue();
if(query.matches(test) && status.isLoaded()) {
results.add(test);
}
}
return (Artifact[]) results.toArray(new Artifact[results.size()]);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public SortedSet getLoadedArtifacts(Artifact query) {
List values = (List) artifactsByArtifact.get(query.getArtifactId());
SortedSet results = new TreeSet();
if (values != null) {
for (int i = 0; i < values.size(); i++) {
Artifact test = (Artifact) values.get(i);
if(query.matches(test)) {
results.add(test);
}
}
}
return results;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public Artifact[] getStarted(Artifact query) {
List results = new ArrayList();
for (Iterator it = configurations.entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
Artifact test = (Artifact) entry.getKey();
ConfigurationStatus status = (ConfigurationStatus) entry.getValue();
if(query.matches(test) && status.isStarted()) {
results.add(test);
}
}
return (Artifact[]) results.toArray(new Artifact[results.size()]);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
/**
* Was the specified configuration failed the operation and threw an
* exception.
*
* @param configurationId the configuration identifier. May be a partial
* ID, in which case will check whether any
* matching conifguration failed.
*
* @return true if the specified (or any matching) configuration failed
* the operation and threw an exception during the lifecycle
* operation
*/
public boolean wasFailed(Artifact configurationId) {
for (Iterator it = failed.keySet().iterator(); it.hasNext();) {
Artifact failID = (Artifact) it.next();
if(configurationId.matches(failID)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
public boolean matches(AbstractName info, Set targetInterfaceTypes) {
if (!info.getName().entrySet().containsAll(name.entrySet())) {
return false;
}
if (!targetInterfaceTypes.containsAll(interfaceTypes)) {
return false;
}
if (artifact == null) {
return true;
}
Artifact otherArtifact = info.getArtifact();
return artifact.matches(otherArtifact);
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
private boolean hasHardDependency(Artifact configurationId, ConfigurationData configurationData) {
for (Iterator iterator = configurationData.getEnvironment().getDependencies().iterator(); iterator.hasNext();) {
Dependency dependency = (Dependency) iterator.next();
Artifact artifact = dependency.getArtifact();
if (artifact.getVersion() != null && artifact.matches(configurationId)) {
return true;
}
}
for (Iterator iterator = configurationData.getChildConfigurations().values().iterator(); iterator.hasNext();) {
ConfigurationData childConfigurationData = (ConfigurationData) iterator.next();
if (hasHardDependency(configurationId, childConfigurationData)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
/**
* N.B. parameter info is supposed to be more specific than this.
* This is the opposite of the meaning of Artifact.matches.
*
* @param info
* @return if info is a more specific version of this name query.
*/
public boolean matches(AbstractNameQuery info) {
if (!info.getName().entrySet().containsAll(name.entrySet())) {
return false;
}
if (!info.getInterfaceTypes().containsAll(interfaceTypes)) {
return false;
}
if (artifact == null) {
return true;
}
Artifact otherArtifact = info.getArtifact();
return artifact.matches(otherArtifact);
}
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-naming-builder
private boolean matches(Dependency defaultDependency, Dependency actualDependency) {
if (defaultDependency.getArtifact().matches(actualDependency.getArtifact())
|| actualDependency.getArtifact().matches(defaultDependency.getArtifact())) {
return defaultDependency.getImportType() == actualDependency.getImportType()
|| actualDependency.getImportType() == ImportType.ALL;
}
return false;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-kernel
/**
* Find the gbeanDatas matching the patterns in this configuration only, ignoring parents.
*
* @param configuration configuration to look in
* @param patterns patterns to look for
* @return set of gbeandatas matching one of the patterns from this configuration only, not including parents.
*/
public LinkedHashSet<GBeanData> findGBeanDatas(Configuration configuration, Set<AbstractNameQuery> patterns) {
LinkedHashSet<GBeanData> result = new LinkedHashSet<GBeanData>();
Set<Map.Entry<AbstractName, GBeanData>> gbeanNames = configuration.getGBeans().entrySet();
for (AbstractNameQuery abstractNameQuery : patterns) {
Artifact queryArtifact = abstractNameQuery.getArtifact();
// Does this query apply to this configuration
if (queryArtifact == null || queryArtifact.matches(configuration.getId())) {
// Search the GBeans
for (Map.Entry<AbstractName, GBeanData> entry : gbeanNames) {
AbstractName abstractName = entry.getKey();
GBeanData gbeanData = entry.getValue();
if (abstractNameQuery.matches(abstractName, gbeanData.getGBeanInfo().getInterfaces())) {
result.add(gbeanData);
}
}
}
}
return result;
}
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-jsr88
Artifact name = (Artifact) it.next();
updateStatus("Started "+name);
if(configID.matches(name)) {
newStarted = true;
代码示例来源:origin: org.apache.geronimo.modules/geronimo-deploy-jsr88
if(allModules[i].getTarget().getName().equals(target) && artifact.matches(Artifact.create(allModules[i].getModuleID()))) {
list.add(allModules[i]);
if(artifact.matches(Artifact.create(allModules[i].getModuleID()))) {
list.add(allModules[i]);
代码示例来源:origin: org.apache.geronimo.framework/geronimo-plugin
for (ArtifactType obsolete : metadata.getObsoletes()) {
Artifact test = toArtifact(obsolete);
if (test.matches(artifact)) {
upgrade = true;
break;
内容来源于网络,如有侵权,请联系作者删除!