o Accounted for API refactoring

This commit is contained in:
Benjamin Bentmann 2011-12-31 21:46:14 +01:00
parent 18b81002cd
commit a7613aad86
5 changed files with 23 additions and 19 deletions

View File

@ -51,6 +51,7 @@ import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.eclipse.aether.RepositoryException;
import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.RequestTrace;
import org.eclipse.aether.artifact.Artifact;
@ -82,7 +83,6 @@ import org.eclipse.aether.spi.log.NullLoggerFactory;
import org.eclipse.aether.transfer.ArtifactNotFoundException;
import org.eclipse.aether.util.artifact.DefaultArtifact;
import org.eclipse.aether.util.artifact.DefaultArtifactType;
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
/**
* @author Benjamin Bentmann
@ -469,23 +469,23 @@ public class DefaultArtifactDescriptorReader
private void missingDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact,
Exception exception )
{
DefaultRepositoryEvent event =
new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_MISSING, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DESCRIPTOR_MISSING );
event.setTrace( trace );
event.setArtifact( artifact );
event.setException( exception );
repositoryEventDispatcher.dispatch( event );
repositoryEventDispatcher.dispatch( event.build() );
}
private void invalidDescriptor( RepositorySystemSession session, RequestTrace trace, Artifact artifact,
Exception exception )
{
DefaultRepositoryEvent event =
new DefaultRepositoryEvent( EventType.ARTIFACT_DESCRIPTOR_INVALID, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.ARTIFACT_DESCRIPTOR_INVALID );
event.setTrace( trace );
event.setArtifact( artifact );
event.setException( exception );
repositoryEventDispatcher.dispatch( event );
repositoryEventDispatcher.dispatch( event.build() );
}
}

View File

@ -35,6 +35,7 @@ import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.util.IOUtil;
import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.RequestTrace;
import org.eclipse.aether.SyncContext;
@ -56,7 +57,6 @@ import org.eclipse.aether.spi.locator.ServiceLocator;
import org.eclipse.aether.spi.log.Logger;
import org.eclipse.aether.spi.log.LoggerFactory;
import org.eclipse.aether.spi.log.NullLoggerFactory;
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
import org.eclipse.aether.util.metadata.DefaultMetadata;
import org.eclipse.aether.util.version.GenericVersionScheme;
import org.eclipse.aether.version.InvalidVersionSpecificationException;
@ -310,12 +310,13 @@ public class DefaultVersionRangeResolver
private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
ArtifactRepository repository, Exception exception )
{
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID );
event.setTrace( trace );
event.setMetadata( metadata );
event.setException( exception );
event.setRepository( repository );
repositoryEventDispatcher.dispatch( event );
repositoryEventDispatcher.dispatch( event.build() );
}
}

View File

@ -41,6 +41,7 @@ import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.aether.RepositoryCache;
import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.RequestTrace;
import org.eclipse.aether.SyncContext;
@ -67,7 +68,6 @@ import org.eclipse.aether.spi.log.Logger;
import org.eclipse.aether.spi.log.LoggerFactory;
import org.eclipse.aether.spi.log.NullLoggerFactory;
import org.eclipse.aether.util.ConfigUtils;
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
import org.eclipse.aether.util.metadata.DefaultMetadata;
/**
@ -400,12 +400,13 @@ public class DefaultVersionResolver
private void invalidMetadata( RepositorySystemSession session, RequestTrace trace, Metadata metadata,
ArtifactRepository repository, Exception exception )
{
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID );
event.setTrace( trace );
event.setMetadata( metadata );
event.setException( exception );
event.setRepository( repository );
repositoryEventDispatcher.dispatch( event );
repositoryEventDispatcher.dispatch( event.build() );
}
private void merge( Artifact artifact, Map<String, VersionInfo> infos, Versioning versioning,

View File

@ -39,6 +39,7 @@ import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositoryListener;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
@ -49,7 +50,6 @@ import org.eclipse.aether.repository.RepositoryPolicy;
import org.eclipse.aether.resolution.MetadataRequest;
import org.eclipse.aether.resolution.MetadataResult;
import org.eclipse.aether.util.DefaultRepositorySystemSession;
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
import org.eclipse.aether.util.metadata.DefaultMetadata;
/**
@ -282,11 +282,12 @@ public class DefaultPluginPrefixResolver
RepositoryListener listener = session.getRepositoryListener();
if ( listener != null )
{
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID );
event.setTrace( trace );
event.setMetadata( metadata );
event.setException( exception );
event.setRepository( repository );
listener.metadataInvalid( event );
listener.metadataInvalid( event.build() );
}
}

View File

@ -44,6 +44,7 @@ import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.StringUtils;
import org.eclipse.aether.RepositoryEvent.EventType;
import org.eclipse.aether.RepositoryEvent;
import org.eclipse.aether.RepositoryListener;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
@ -52,7 +53,6 @@ import org.eclipse.aether.repository.ArtifactRepository;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.MetadataRequest;
import org.eclipse.aether.resolution.MetadataResult;
import org.eclipse.aether.util.listener.DefaultRepositoryEvent;
import org.eclipse.aether.util.metadata.DefaultMetadata;
import org.eclipse.aether.util.version.GenericVersionScheme;
import org.eclipse.aether.version.InvalidVersionSpecificationException;
@ -305,11 +305,12 @@ public class DefaultPluginVersionResolver
RepositoryListener listener = session.getRepositoryListener();
if ( listener != null )
{
DefaultRepositoryEvent event = new DefaultRepositoryEvent( EventType.METADATA_INVALID, session, trace );
RepositoryEvent.Builder event = new RepositoryEvent.Builder( session, EventType.METADATA_INVALID );
event.setTrace( trace );
event.setMetadata( metadata );
event.setException( exception );
event.setRepository( repository );
listener.metadataInvalid( event );
listener.metadataInvalid( event.build() );
}
}