diff options
Diffstat (limited to 'framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy')
5 files changed, 0 insertions, 619 deletions
diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java deleted file mode 100644 index 09132275..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.apache.maven.eventspy; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * A skeleton eventspy that does nothing other than helping implementors. - * @since 3.0.2 - */ -public abstract class AbstractEventSpy - implements EventSpy -{ - - public void init( Context context ) - throws Exception - { - } - - public void onEvent( Object event ) - throws Exception - { - } - - public void close() - throws Exception - { - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java deleted file mode 100644 index 4284fce9..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/EventSpy.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.apache.maven.eventspy; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.Map; - -/** - * A core extension to monitor Maven's execution. Typically, such an extension gets loaded into Maven by specifying the - * system property {@code maven.ext.class.path} on the command line. As soon as dependency injection is setup, Maven - * looks up all implementators of this interface and calls their {@link #init(Context)} method. <em>Note:</em> - * Implementors are strongly advised to inherit from {@link AbstractEventSpy} instead of directly implementing this - * interface. - * @since 3.0.2 - */ -public interface EventSpy -{ - - interface Context - { - - /** - * Gets key-value pairs providing information about the Maven runtime. - * - * @return The key-value pairs, never {@code null}. - */ - Map<String, Object> getData(); - - } - - /** - * Initializes the spy. - * - * @param context The event spy context, never {@code null}. - */ - void init( Context context ) - throws Exception; - - /** - * Notifies the spy of some build event/operation. - * - * @param event The event, never {@code null}. - * @see org.apache.maven.settings.building.SettingsBuildingRequest - * @see org.apache.maven.settings.building.SettingsBuildingResult - * @see org.apache.maven.execution.MavenExecutionRequest - * @see org.apache.maven.execution.MavenExecutionResult - * @see org.apache.maven.project.DependencyResolutionRequest - * @see org.apache.maven.project.DependencyResolutionResult - * @see org.apache.maven.execution.ExecutionEvent - * @see org.eclipse.aether.RepositoryEvent - */ - void onEvent( Object event ) - throws Exception; - - /** - * Notifies the spy of Maven's termination, allowing it to free any resources allocated by it. - */ - void close() - throws Exception; - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java deleted file mode 100644 index d44642d1..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyDispatcher.java +++ /dev/null @@ -1,158 +0,0 @@ -package org.apache.maven.eventspy.internal; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import java.util.ArrayList; -import java.util.List; - -import org.apache.maven.eventspy.EventSpy; -import org.apache.maven.execution.ExecutionListener; -import org.codehaus.plexus.component.annotations.Component; -import org.codehaus.plexus.component.annotations.Requirement; -import org.codehaus.plexus.logging.Logger; -import org.eclipse.aether.RepositoryListener; - -/** - * Dispatches callbacks to all registered eventspies. - * @since 3.0.2 - */ -@Component( role = EventSpyDispatcher.class ) -public class EventSpyDispatcher -{ - - @Requirement - private Logger logger; - - @Requirement( role = EventSpy.class ) - private List<EventSpy> eventSpies; - - public void setEventSpies( List<EventSpy> eventSpies ) - { - // make copy to get rid of needless overhead for dynamic lookups - this.eventSpies = new ArrayList<EventSpy>( eventSpies ); - } - - public List<EventSpy> getEventSpies() - { - return eventSpies; - } - - public ExecutionListener chainListener( ExecutionListener listener ) - { - if ( eventSpies.isEmpty() ) - { - return listener; - } - return new EventSpyExecutionListener( this, listener ); - } - - public RepositoryListener chainListener( RepositoryListener listener ) - { - if ( eventSpies.isEmpty() ) - { - return listener; - } - return new EventSpyRepositoryListener( this, listener ); - } - - public void init( EventSpy.Context context ) - { - if ( eventSpies.isEmpty() ) - { - return; - } - for ( EventSpy eventSpy : eventSpies ) - { - try - { - eventSpy.init( context ); - } - catch ( Exception e ) - { - logError( "initialize", e, eventSpy ); - } - catch ( LinkageError e ) - { - logError( "initialize", e, eventSpy ); - } - } - } - - public void onEvent( Object event ) - { - if ( eventSpies.isEmpty() ) - { - return; - } - for ( EventSpy eventSpy : eventSpies ) - { - try - { - eventSpy.onEvent( event ); - } - catch ( Exception e ) - { - logError( "notify", e, eventSpy ); - } - catch ( LinkageError e ) - { - logError( "notify", e, eventSpy ); - } - } - } - - public void close() - { - if ( eventSpies.isEmpty() ) - { - return; - } - for ( EventSpy eventSpy : eventSpies ) - { - try - { - eventSpy.close(); - } - catch ( Exception e ) - { - logError( "close", e, eventSpy ); - } - catch ( LinkageError e ) - { - logError( "close", e, eventSpy ); - } - } - } - - private void logError( String action, Throwable e, EventSpy spy ) - { - String msg = "Failed to " + action + " spy " + spy.getClass().getName() + ": " + e.getMessage(); - - if ( logger.isDebugEnabled() ) - { - logger.warn( msg, e ); - } - else - { - logger.warn( msg ); - } - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java deleted file mode 100644 index 6b25da58..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.apache.maven.eventspy.internal; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.execution.AbstractExecutionListener; -import org.apache.maven.execution.ExecutionEvent; -import org.apache.maven.execution.ExecutionListener; - -/** - * Forwards execution events to eventspies. - * @since 3.0.2 - */ -class EventSpyExecutionListener - extends AbstractExecutionListener -{ - - private final EventSpyDispatcher dispatcher; - - private final ExecutionListener delegate; - - public EventSpyExecutionListener( EventSpyDispatcher dispatcher, ExecutionListener delegate ) - { - this.dispatcher = dispatcher; - this.delegate = delegate; - } - - @Override - public void projectDiscoveryStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.projectDiscoveryStarted( event ); - } - - @Override - public void sessionStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.sessionStarted( event ); - } - - @Override - public void sessionEnded( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.sessionEnded( event ); - } - - @Override - public void projectSkipped( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.projectSkipped( event ); - } - - @Override - public void projectStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.projectStarted( event ); - } - - @Override - public void projectSucceeded( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.projectSucceeded( event ); - } - - @Override - public void projectFailed( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.projectFailed( event ); - } - - @Override - public void forkStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkStarted( event ); - } - - @Override - public void forkSucceeded( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkSucceeded( event ); - } - - @Override - public void forkFailed( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkFailed( event ); - } - - @Override - public void mojoSkipped( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.mojoSkipped( event ); - } - - @Override - public void mojoStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.mojoStarted( event ); - } - - @Override - public void mojoSucceeded( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.mojoSucceeded( event ); - } - - @Override - public void mojoFailed( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.mojoFailed( event ); - } - - @Override - public void forkedProjectStarted( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkedProjectStarted( event ); - } - - @Override - public void forkedProjectSucceeded( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkedProjectSucceeded( event ); - } - - @Override - public void forkedProjectFailed( ExecutionEvent event ) - { - dispatcher.onEvent( event ); - delegate.forkedProjectFailed( event ); - } - -} diff --git a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java b/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java deleted file mode 100644 index 60d4cd1c..00000000 --- a/framework/src/maven/apache-maven-3.3.3/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyRepositoryListener.java +++ /dev/null @@ -1,176 +0,0 @@ -package org.apache.maven.eventspy.internal; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.eclipse.aether.AbstractRepositoryListener; -import org.eclipse.aether.RepositoryEvent; -import org.eclipse.aether.RepositoryListener; - -/** - * Forwards repository events to eventspies. - * @since 3.0.2 - */ -class EventSpyRepositoryListener - extends AbstractRepositoryListener -{ - private final EventSpyDispatcher dispatcher; - - private final RepositoryListener delegate; - - public EventSpyRepositoryListener( EventSpyDispatcher dispatcher, RepositoryListener delegate ) - { - this.dispatcher = dispatcher; - this.delegate = delegate; - } - - @Override - public void artifactDeployed( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDeployed( event ); - } - - @Override - public void artifactDeploying( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDeploying( event ); - } - - @Override - public void artifactDescriptorInvalid( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDescriptorInvalid( event ); - } - - @Override - public void artifactDescriptorMissing( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDescriptorMissing( event ); - } - - @Override - public void artifactInstalled( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactInstalled( event ); - } - - @Override - public void artifactInstalling( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactInstalling( event ); - } - - @Override - public void artifactResolved( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactResolved( event ); - } - - @Override - public void artifactResolving( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactResolving( event ); - } - - @Override - public void metadataDeployed( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataDeployed( event ); - } - - @Override - public void metadataDeploying( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataDeploying( event ); - } - - @Override - public void metadataInstalled( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataInstalled( event ); - } - - @Override - public void metadataInstalling( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataInstalling( event ); - } - - @Override - public void metadataInvalid( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataInvalid( event ); - } - - @Override - public void metadataResolved( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataResolved( event ); - } - - @Override - public void metadataResolving( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataResolving( event ); - } - - @Override - public void artifactDownloaded( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDownloaded( event ); - } - - @Override - public void artifactDownloading( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.artifactDownloading( event ); - } - - @Override - public void metadataDownloaded( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataDownloaded( event ); - } - - @Override - public void metadataDownloading( RepositoryEvent event ) - { - dispatcher.onEvent( event ); - delegate.metadataDownloading( event ); - } - -} |