public class MavenDiscoveryService extends java.lang.Object implements IMavenDiscoveryUI, IMavenDiscovery, org.osgi.framework.ServiceFactory
Modifier and Type | Class and Description |
---|---|
static class |
MavenDiscoveryService.CatalogItemCacheEntry |
Modifier and Type | Field and Description |
---|---|
private java.util.List<MavenDiscoveryService.CatalogItemCacheEntry> |
items |
private java.lang.Object |
itemsLock
Lock guarding lazy instantiation of item instance
|
private static org.slf4j.Logger |
log |
Constructor and Description |
---|
MavenDiscoveryService() |
MavenDiscoveryService(boolean factory) |
Modifier and Type | Method and Description |
---|---|
void |
addCatalogItem(org.eclipse.equinox.internal.p2.discovery.model.CatalogItem item,
LifecycleMappingMetadataSource metadataSource,
java.util.List<java.lang.String> projectConfigurators,
java.util.List<java.lang.String> mappingStrategies) |
java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> |
discover(java.util.Collection<ILifecycleMappingRequirement> requirements,
java.util.List<IMavenDiscoveryProposal> preselected,
org.eclipse.core.runtime.IProgressMonitor monitor)
Calculates discovery proposals for a given collection of
ILifecycleMappingRequirement s. |
java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> |
discover(org.apache.maven.project.MavenProject mavenProject,
java.util.List<org.apache.maven.plugin.MojoExecution> mojoExecutions,
java.util.List<IMavenDiscoveryProposal> preselected,
org.eclipse.core.runtime.IProgressMonitor monitor)
Calculates possibly empty list of discovery proposals.
|
(package private) java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> |
discover0(org.apache.maven.project.MavenProject mavenProject,
java.util.List<org.apache.maven.plugin.MojoExecution> mojoExecutions,
java.util.List<IMavenDiscoveryProposal> preselected,
org.eclipse.core.runtime.IProgressMonitor monitor) |
private IMavenDiscoveryProposal |
getProposal(LifecycleMappingMetadataSource src) |
java.lang.Object |
getService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration) |
private static boolean |
hasPackaging(LifecycleMappingMetadataSource lifecycleMappingMetadataSource,
java.lang.String packagingType) |
boolean |
implement(java.util.List<IMavenDiscoveryProposal> proposals,
org.eclipse.jface.operation.IRunnableWithProgress postInstallHook,
org.eclipse.jface.operation.IRunnableContext context,
java.util.Collection<java.lang.String> projectsToConfigure)
Returns true if postInstallHook has been scheduled for execution and false otherwise
|
private void |
initializeCatalog(org.eclipse.core.runtime.IProgressMonitor monitor) |
boolean |
itemInstalled(org.eclipse.equinox.p2.engine.IProfile profile,
org.eclipse.equinox.internal.p2.discovery.model.CatalogItem item,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns true if all IUs specified in the catalog item are installed in the profile
|
private static boolean |
matchesFilter(LifecycleMappingMetadataSource src,
MojoExecutionKey mojoExecution,
java.lang.String type) |
private void |
put(java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> allproposals,
ILifecycleMappingRequirement requirement,
IMavenDiscoveryProposal proposal) |
private java.util.Collection<org.eclipse.equinox.internal.p2.discovery.model.CatalogItem> |
toCatalogItems(java.util.List<IMavenDiscoveryProposal> proposals) |
private java.util.List<LifecycleMappingMetadataSource> |
toMetadataSources(java.util.List<IMavenDiscoveryProposal> proposals) |
void |
ungetService(org.osgi.framework.Bundle bundle,
org.osgi.framework.ServiceRegistration registration,
java.lang.Object service) |
private static final org.slf4j.Logger log
private java.util.List<MavenDiscoveryService.CatalogItemCacheEntry> items
private final java.lang.Object itemsLock
public MavenDiscoveryService()
public MavenDiscoveryService(boolean factory)
public java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> discover(org.apache.maven.project.MavenProject mavenProject, java.util.List<org.apache.maven.plugin.MojoExecution> mojoExecutions, java.util.List<IMavenDiscoveryProposal> preselected, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IMavenDiscovery
Calculates possibly empty list of discovery proposals. Multiple proposals per mapping configuration element represent alternative possible changes.
To support incremental collection of user choices in the GUI, optional preselected
requirements/proposals map is used to eliminate new proposals that conflict with already selected choices. Result
is expected to include preselected proposals as-is. Implementation is expected to eliminate proposals that conflict
with already installed Eclipse bundles and preselected proposals.
discover
in interface IMavenDiscovery
org.eclipse.core.runtime.CoreException
private void initializeCatalog(org.eclipse.core.runtime.IProgressMonitor monitor)
java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> discover0(org.apache.maven.project.MavenProject mavenProject, java.util.List<org.apache.maven.plugin.MojoExecution> mojoExecutions, java.util.List<IMavenDiscoveryProposal> preselected, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public boolean itemInstalled(org.eclipse.equinox.p2.engine.IProfile profile, org.eclipse.equinox.internal.p2.discovery.model.CatalogItem item, org.eclipse.core.runtime.IProgressMonitor monitor)
public void addCatalogItem(org.eclipse.equinox.internal.p2.discovery.model.CatalogItem item, LifecycleMappingMetadataSource metadataSource, java.util.List<java.lang.String> projectConfigurators, java.util.List<java.lang.String> mappingStrategies)
private IMavenDiscoveryProposal getProposal(LifecycleMappingMetadataSource src)
private java.util.List<LifecycleMappingMetadataSource> toMetadataSources(java.util.List<IMavenDiscoveryProposal> proposals)
private void put(java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> allproposals, ILifecycleMappingRequirement requirement, IMavenDiscoveryProposal proposal)
public boolean implement(java.util.List<IMavenDiscoveryProposal> proposals, org.eclipse.jface.operation.IRunnableWithProgress postInstallHook, org.eclipse.jface.operation.IRunnableContext context, java.util.Collection<java.lang.String> projectsToConfigure)
IMavenDiscoveryUI
implement
in interface IMavenDiscoveryUI
private java.util.Collection<org.eclipse.equinox.internal.p2.discovery.model.CatalogItem> toCatalogItems(java.util.List<IMavenDiscoveryProposal> proposals)
public java.lang.Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
getService
in interface org.osgi.framework.ServiceFactory
public void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, java.lang.Object service)
ungetService
in interface org.osgi.framework.ServiceFactory
public java.util.Map<ILifecycleMappingRequirement,java.util.List<IMavenDiscoveryProposal>> discover(java.util.Collection<ILifecycleMappingRequirement> requirements, java.util.List<IMavenDiscoveryProposal> preselected, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
IMavenDiscovery
Calculates discovery proposals for a given collection of ILifecycleMappingRequirement
s. Multiple proposals
per requirement element can be found.
To support incremental collection of user choices in the GUI, optional preselected
requirements/proposals map is used to eliminate new proposals that conflict with already selected choices. Result
is expected to include preselected proposals as-is. Implementation is expected to eliminate proposals that conflict
with already installed Eclipse bundles and preselected proposals.
discover
in interface IMavenDiscovery
org.eclipse.core.runtime.CoreException
private static boolean matchesFilter(LifecycleMappingMetadataSource src, MojoExecutionKey mojoExecution, java.lang.String type)
private static boolean hasPackaging(LifecycleMappingMetadataSource lifecycleMappingMetadataSource, java.lang.String packagingType)