当前位置: 首页>>代码示例>>Java>>正文


Java RepositoryEvent类代码示例

本文整理汇总了Java中org.eclipse.aether.RepositoryEvent的典型用法代码示例。如果您正苦于以下问题:Java RepositoryEvent类的具体用法?Java RepositoryEvent怎么用?Java RepositoryEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RepositoryEvent类属于org.eclipse.aether包,在下文中一共展示了RepositoryEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEvent

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
@Override
public void onEvent( Object event )
    throws Exception
{
    try
    {
        if ( event instanceof ExecutionEvent )
        {
            executionEventHandler( (ExecutionEvent) event );
        }
        else if ( event instanceof org.eclipse.aether.RepositoryEvent )
        {
            repositoryEventHandler( (RepositoryEvent) event );
        }
        else
        {
            // TODO: What kind of event we haven't considered?
            LOGGER.debug( "{}: Event {}", DPRE, event.getClass().getCanonicalName() );
        }
    }
    catch ( Exception e )
    {
        LOGGER.error( DPRE + ": Exception", e );
    }
}
 
开发者ID:khmarbaise,项目名称:deployment-recorder-extension,代码行数:26,代码来源:DeploymentRecorderExtension.java

示例2: onEvent

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
@Override
public void onEvent(Object event) throws Exception {
    super.onEvent(event);
    if (configuration.isProfiling()) {
        if (event instanceof DefaultMavenExecutionRequest) {
            DefaultMavenExecutionRequest mavenEvent = (DefaultMavenExecutionRequest) event;
            statistics.setGoals(new LinkedHashSet<String>(mavenEvent.getGoals()));
            statistics.setProperties(mavenEvent.getUserProperties());
        } else if (event instanceof ExecutionEvent) {
            storeExecutionEvent((ExecutionEvent) event);
            trySaveTopProject((ExecutionEvent) event);
            storeStartTime((ExecutionEvent) event);
        } else if (event instanceof RepositoryEvent) {
            storeDownloadingArtifacts((RepositoryEvent) event);
        }
    }
}
 
开发者ID:jcgay,项目名称:maven-profiler,代码行数:18,代码来源:ProfilerEventSpy.java

示例3: repositoryEventHandler

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
private void repositoryEventHandler( org.eclipse.aether.RepositoryEvent repositoryEvent )
{
    EventType type = repositoryEvent.getType();
    switch ( type )
    {
        case ARTIFACT_DEPLOYED:
            recordedDeploys.add( repositoryEvent.getArtifact() );
            break;

        case ARTIFACT_DOWNLOADING:
        case ARTIFACT_DOWNLOADED:
        case ARTIFACT_DEPLOYING:
        case ARTIFACT_INSTALLING:
        case ARTIFACT_INSTALLED:
        case METADATA_DEPLOYING:
        case METADATA_DEPLOYED:
        case METADATA_DOWNLOADING:
        case METADATA_DOWNLOADED:
        case METADATA_INSTALLING:
        case METADATA_INSTALLED:
        case ARTIFACT_RESOLVING:
        case ARTIFACT_RESOLVED:
        case ARTIFACT_DESCRIPTOR_INVALID:
        case ARTIFACT_DESCRIPTOR_MISSING:
        case METADATA_RESOLVED:
        case METADATA_RESOLVING:
        case METADATA_INVALID:
            // Those events are not recorded.
            break;

        default:
            LOGGER.error( "{}: repositoryEventHandler {}", DPRE, type );
            break;
    }
}
 
开发者ID:khmarbaise,项目名称:deployment-recorder-extension,代码行数:36,代码来源:DeploymentRecorderExtension.java

示例4: start

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void start( RepositoryEvent event )
{
    String metadataId = getArtifactId( event.getMetadata() );
    TimePlusSize systemTime = new TimePlusSize();
    systemTime.start();
    getTimerEvents().put( metadataId, systemTime );
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:8,代码来源:AbstractMetadataTimer.java

示例5: stop

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void stop( RepositoryEvent event )
{
    String metadataId = getArtifactId( event.getMetadata() );
    if ( !getTimerEvents().containsKey( metadataId ) )
    {
        throw new IllegalArgumentException( "Unknown metadataId (" + metadataId + ")" );
    }
    getTimerEvents().get( metadataId ).stop();
    if ( event.getMetadata().getFile() != null )
    {
        getTimerEvents().get( metadataId ).setSize( event.getMetadata().getFile().length() );
    }
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:14,代码来源:AbstractMetadataTimer.java

示例6: start

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void start( RepositoryEvent event )
{
    String artifactId = getArtifactId( event.getArtifact() );
    TimePlusSize systemTime = new TimePlusSize();
    systemTime.start();
    getTimerEvents().put( artifactId, systemTime );
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:8,代码来源:AbstractArtifactTimer.java

示例7: stop

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void stop( RepositoryEvent event )
{
    String artifactId = getArtifactId( event.getArtifact() );
    if ( !getTimerEvents().containsKey( artifactId ) )
    {
        throw new IllegalArgumentException( "Unknown artifactId (" + artifactId + ")" );
    }
    getTimerEvents().get( artifactId ).stop();
    getTimerEvents().get( artifactId ).setSize( event.getArtifact().getFile().length() );
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:11,代码来源:AbstractArtifactTimer.java

示例8: artifactDownloading

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
@Override
public void artifactDownloading(RepositoryEvent event) {
  super.artifactDownloading(event);
  Artifact artifact = event.getArtifact();
  String key = artifactAsString(artifact);
  startTimes.put(key, System.nanoTime());
}
 
开发者ID:igor-suhorukov,项目名称:mvn-classloader,代码行数:8,代码来源:LoggingRepositoryListener.java

示例9: artifactDownloaded

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
@Override
public void artifactDownloaded(RepositoryEvent event) {
  super.artifactDownloaded(event);
  Artifact artifact = event.getArtifact();
  String key = artifactAsString(artifact);
  long downloadTimeNanos = System.nanoTime() - startTimes.remove(key);
  double downloadTimeMs = TimeUnit.NANOSECONDS.toMillis(downloadTimeNanos);
  double downloadTimeSec = TimeUnit.NANOSECONDS.toSeconds(downloadTimeNanos);
  long size = artifact.getFile().length();
  double sizeK = (1 / 1024D) * size;
  double downloadRateKBytesPerSecond = sizeK / downloadTimeSec;
  info("Downloaded %s (%d bytes) in %gms (%g kbytes/sec).", key, size, downloadTimeMs, downloadRateKBytesPerSecond);
}
 
开发者ID:igor-suhorukov,项目名称:mvn-classloader,代码行数:14,代码来源:LoggingRepositoryListener.java

示例10: storeDownloadingArtifacts

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
private void storeDownloadingArtifacts(RepositoryEvent event) {
    logger.debug(String.format("Received event (%s): %s", event.getClass(), event));
    if (event.getType() == ARTIFACT_DOWNLOADING) {
        statistics.startDownload(event.getArtifact());

    } else if (event.getType() == ARTIFACT_DOWNLOADED) {
        if (hasNoException(event)) {
            statistics.stopDownload(event.getArtifact());
        }
    }
}
 
开发者ID:jcgay,项目名称:maven-profiler,代码行数:12,代码来源:ProfilerEventSpy.java

示例11: onEvent

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
@Override
public void onEvent( Object event )
    throws Exception
{
    try
    {
        if ( event instanceof ExecutionEvent )
        {
            executionEventHandler( (ExecutionEvent) event );
        }
        else if ( event instanceof org.eclipse.aether.RepositoryEvent )
        {
            repositoryEventHandler( (RepositoryEvent) event );
        }
        else if ( event instanceof MavenExecutionRequest )
        {
            executionRequestEventHandler( (MavenExecutionRequest) event );
        }
        else if ( event instanceof MavenExecutionResult )
        {
            executionResultEventHandler( (MavenExecutionResult) event );
        }
        else if ( event instanceof DependencyResolutionRequest )
        {
            dependencyResolutionRequest( (DependencyResolutionRequest) event );
        }
        else if ( event instanceof DependencyResolutionResult )
        {
            dependencyResolutionResult( (DependencyResolutionResult) event );
        }
        // The following event type is available since Maven 3.3.1+
        // else if ( event instanceof DefaultSettingsBuildingRequest) {
        // DefaultSettingsBuildingRequest r = null;
        // r.getGlobalSettingsFile();
        // r.getGlobalSettingsSource();
        // r.getSystemProperties();
        // r.getUserSettingsFile();
        // r.getUserSettingsSource();
        //
        // r.setGlobalSettingsFile( globalSettingsFile );
        // r.setGlobalSettingsSource( globalSettingsSource );
        // r.setSystemProperties( systemProperties );
        // r.setUserProperties( userProperties );
        // r.setUserSettingsFile( userSettingsFile );
        // r.setUserSettingsSource( userSettingsSource );
        // }
        // The following event type is available since Maven 3.3.1+
        // else if (event instanceof DefaultSettingsBuildingRequest) {
        //
        // DefaultSettingsBuildingRequest r = null;
        // r.getGlobalSettingsSource().getLocation()
        // }
        // The following event type is available since Maven 3.3.1+
        // else if (event instanceof DefaultToolchainsBuildingRequest) {
        // DefaultToolchainsBuildingRequest r = null;
        // r.getGlobalToolchainsSource().
        // }
        // The following event type is available since Maven 3.3.1+
        // else if (event instanceof DefaultToolchainsBuildingResult) {
        // DefaultToolchainsBuildingResult r = null;
        // r.getEffectiveToolchains();
        // r.getProblems();
        // }
        else
        {
            // TODO: What kind of event we haven't considered?
            LOGGER.debug( "MBTP: Event {}", event.getClass().getCanonicalName() );
        }
    }
    catch ( Exception e )
    {
        LOGGER.error( "MBTP: Exception", e );
    }
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:75,代码来源:BuildTimeProfiler.java

示例12: repositoryEventHandler

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
private void repositoryEventHandler( org.eclipse.aether.RepositoryEvent repositoryEvent )
{
    EventType type = repositoryEvent.getType();
    switch ( type )
    {
        case ARTIFACT_DOWNLOADING:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            downloadTimer.start( repositoryEvent );
            break;
        case ARTIFACT_DOWNLOADED:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            downloadTimer.stop( repositoryEvent );
            break;

        case ARTIFACT_DEPLOYING:
            deployTimer.start( repositoryEvent );
            break;
        case ARTIFACT_DEPLOYED:
            deployTimer.stop( repositoryEvent );
            break;

        case ARTIFACT_INSTALLING:
            installTimer.start( repositoryEvent );
            break;
        case ARTIFACT_INSTALLED:
            installTimer.stop( repositoryEvent );
            break;

        case METADATA_DEPLOYING:
            metadataDeploymentTimer.start( repositoryEvent );
            break;
        case METADATA_DEPLOYED:
            metadataDeploymentTimer.stop( repositoryEvent );
            break;

        case METADATA_DOWNLOADING:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            metadataDownloadTimer.start( repositoryEvent );
            break;
        case METADATA_DOWNLOADED:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            metadataDownloadTimer.stop( repositoryEvent );
            break;

        case METADATA_INSTALLING:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            metadataInstallTimer.start( repositoryEvent );
            break;
        case METADATA_INSTALLED:
            LOGGER.debug( "MBTP: repositoryEventHandler {}", type );
            metadataInstallTimer.stop( repositoryEvent );
            break;

        case ARTIFACT_RESOLVING:
        case ARTIFACT_RESOLVED:
        case ARTIFACT_DESCRIPTOR_INVALID:
        case ARTIFACT_DESCRIPTOR_MISSING:
        case METADATA_RESOLVED:
        case METADATA_RESOLVING:
        case METADATA_INVALID:
            // Those events are not recorded.
            break;

        default:
            LOGGER.error( "MBTP: repositoryEventHandler {}", type );
            break;
    }
}
 
开发者ID:khmarbaise,项目名称:maven-buildtime-profiler,代码行数:69,代码来源:BuildTimeProfiler.java

示例13: artifactDeployed

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void artifactDeployed( RepositoryEvent event ){
	out.println(getDate()+" Deployed " + event.getArtifact() + " to " + event.getRepository() );
}
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:4,代码来源:RepositoryListener.java

示例14: artifactDeploying

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void artifactDeploying( RepositoryEvent event ){
	out.println(getDate()+" Deploying " + event.getArtifact() + " to " + event.getRepository() );
}
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:4,代码来源:RepositoryListener.java

示例15: artifactDescriptorInvalid

import org.eclipse.aether.RepositoryEvent; //导入依赖的package包/类
public void artifactDescriptorInvalid( RepositoryEvent event ){
	out.println(getDate()+" Invalid artifact descriptor for " + event.getArtifact() + ": "+ event.getException().getMessage() );
}
 
开发者ID:microsofia,项目名称:microsofia-boot,代码行数:4,代码来源:RepositoryListener.java


注:本文中的org.eclipse.aether.RepositoryEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。