View Javadoc

1   package org.apache.maven.eventspy.internal;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.eclipse.aether.AbstractRepositoryListener;
23  import org.eclipse.aether.RepositoryEvent;
24  import org.eclipse.aether.RepositoryListener;
25  
26  /**
27   * Forwards repository events to eventspies.
28   * @since 3.0.2
29   */
30  class EventSpyRepositoryListener
31      extends AbstractRepositoryListener
32  {
33      private final EventSpyDispatcher dispatcher;
34  
35      private final RepositoryListener delegate;
36  
37      public EventSpyRepositoryListener( EventSpyDispatcher dispatcher, RepositoryListener delegate )
38      {
39          this.dispatcher = dispatcher;
40          this.delegate = delegate;
41      }
42  
43      @Override
44      public void artifactDeployed( RepositoryEvent event )
45      {
46          dispatcher.onEvent( event );
47          delegate.artifactDeployed( event );
48      }
49  
50      @Override
51      public void artifactDeploying( RepositoryEvent event )
52      {
53          dispatcher.onEvent( event );
54          delegate.artifactDeploying( event );
55      }
56  
57      @Override
58      public void artifactDescriptorInvalid( RepositoryEvent event )
59      {
60          dispatcher.onEvent( event );
61          delegate.artifactDescriptorInvalid( event );
62      }
63  
64      @Override
65      public void artifactDescriptorMissing( RepositoryEvent event )
66      {
67          dispatcher.onEvent( event );
68          delegate.artifactDescriptorMissing( event );
69      }
70  
71      @Override
72      public void artifactInstalled( RepositoryEvent event )
73      {
74          dispatcher.onEvent( event );
75          delegate.artifactInstalled( event );
76      }
77  
78      @Override
79      public void artifactInstalling( RepositoryEvent event )
80      {
81          dispatcher.onEvent( event );
82          delegate.artifactInstalling( event );
83      }
84  
85      @Override
86      public void artifactResolved( RepositoryEvent event )
87      {
88          dispatcher.onEvent( event );
89          delegate.artifactResolved( event );
90      }
91  
92      @Override
93      public void artifactResolving( RepositoryEvent event )
94      {
95          dispatcher.onEvent( event );
96          delegate.artifactResolving( event );
97      }
98  
99      @Override
100     public void metadataDeployed( RepositoryEvent event )
101     {
102         dispatcher.onEvent( event );
103         delegate.metadataDeployed( event );
104     }
105 
106     @Override
107     public void metadataDeploying( RepositoryEvent event )
108     {
109         dispatcher.onEvent( event );
110         delegate.metadataDeploying( event );
111     }
112 
113     @Override
114     public void metadataInstalled( RepositoryEvent event )
115     {
116         dispatcher.onEvent( event );
117         delegate.metadataInstalled( event );
118     }
119 
120     @Override
121     public void metadataInstalling( RepositoryEvent event )
122     {
123         dispatcher.onEvent( event );
124         delegate.metadataInstalling( event );
125     }
126 
127     @Override
128     public void metadataInvalid( RepositoryEvent event )
129     {
130         dispatcher.onEvent( event );
131         delegate.metadataInvalid( event );
132     }
133 
134     @Override
135     public void metadataResolved( RepositoryEvent event )
136     {
137         dispatcher.onEvent( event );
138         delegate.metadataResolved( event );
139     }
140 
141     @Override
142     public void metadataResolving( RepositoryEvent event )
143     {
144         dispatcher.onEvent( event );
145         delegate.metadataResolving( event );
146     }
147 
148     @Override
149     public void artifactDownloaded( RepositoryEvent event )
150     {
151         dispatcher.onEvent( event );
152         delegate.artifactDownloaded( event );
153     }
154 
155     @Override
156     public void artifactDownloading( RepositoryEvent event )
157     {
158         dispatcher.onEvent( event );
159         delegate.artifactDownloading( event );
160     }
161 
162     @Override
163     public void metadataDownloaded( RepositoryEvent event )
164     {
165         dispatcher.onEvent( event );
166         delegate.metadataDownloaded( event );
167     }
168 
169     @Override
170     public void metadataDownloading( RepositoryEvent event )
171     {
172         dispatcher.onEvent( event );
173         delegate.metadataDownloading( event );
174     }
175 
176 }