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.sonatype.aether.AbstractRepositoryListener;
23  import org.sonatype.aether.RepositoryEvent;
24  import org.sonatype.aether.RepositoryListener;
25  
26  /**
27   * Forwards repository events to eventspies.
28   */
29  class EventSpyRepositoryListener
30      extends AbstractRepositoryListener
31  {
32      private final EventSpyDispatcher dispatcher;
33  
34      private final RepositoryListener delegate;
35  
36      public EventSpyRepositoryListener( EventSpyDispatcher dispatcher, RepositoryListener delegate )
37      {
38          this.dispatcher = dispatcher;
39          this.delegate = delegate;
40      }
41  
42      @Override
43      public void artifactDeployed( RepositoryEvent event )
44      {
45          dispatcher.onEvent( event );
46          delegate.artifactDeployed( event );
47      }
48  
49      @Override
50      public void artifactDeploying( RepositoryEvent event )
51      {
52          dispatcher.onEvent( event );
53          delegate.artifactDeploying( event );
54      }
55  
56      @Override
57      public void artifactDescriptorInvalid( RepositoryEvent event )
58      {
59          dispatcher.onEvent( event );
60          delegate.artifactDescriptorInvalid( event );
61      }
62  
63      @Override
64      public void artifactDescriptorMissing( RepositoryEvent event )
65      {
66          dispatcher.onEvent( event );
67          delegate.artifactDescriptorMissing( event );
68      }
69  
70      @Override
71      public void artifactInstalled( RepositoryEvent event )
72      {
73          dispatcher.onEvent( event );
74          delegate.artifactInstalled( event );
75      }
76  
77      @Override
78      public void artifactInstalling( RepositoryEvent event )
79      {
80          dispatcher.onEvent( event );
81          delegate.artifactInstalling( event );
82      }
83  
84      @Override
85      public void artifactResolved( RepositoryEvent event )
86      {
87          dispatcher.onEvent( event );
88          delegate.artifactResolved( event );
89      }
90  
91      @Override
92      public void artifactResolving( RepositoryEvent event )
93      {
94          dispatcher.onEvent( event );
95          delegate.artifactResolving( event );
96      }
97  
98      @Override
99      public void metadataDeployed( RepositoryEvent event )
100     {
101         dispatcher.onEvent( event );
102         delegate.metadataDeployed( event );
103     }
104 
105     @Override
106     public void metadataDeploying( RepositoryEvent event )
107     {
108         dispatcher.onEvent( event );
109         delegate.metadataDeploying( event );
110     }
111 
112     @Override
113     public void metadataInstalled( RepositoryEvent event )
114     {
115         dispatcher.onEvent( event );
116         delegate.metadataInstalled( event );
117     }
118 
119     @Override
120     public void metadataInstalling( RepositoryEvent event )
121     {
122         dispatcher.onEvent( event );
123         delegate.metadataInstalling( event );
124     }
125 
126     @Override
127     public void metadataInvalid( RepositoryEvent event )
128     {
129         dispatcher.onEvent( event );
130         delegate.metadataInvalid( event );
131     }
132 
133     @Override
134     public void metadataResolved( RepositoryEvent event )
135     {
136         dispatcher.onEvent( event );
137         delegate.metadataResolved( event );
138     }
139 
140     @Override
141     public void metadataResolving( RepositoryEvent event )
142     {
143         dispatcher.onEvent( event );
144         delegate.metadataResolving( event );
145     }
146 
147     @Override
148     public void artifactDownloaded( RepositoryEvent event )
149     {
150         dispatcher.onEvent( event );
151         delegate.artifactDownloaded( event );
152     }
153 
154     @Override
155     public void artifactDownloading( RepositoryEvent event )
156     {
157         dispatcher.onEvent( event );
158         delegate.artifactDownloading( event );
159     }
160 
161     @Override
162     public void metadataDownloaded( RepositoryEvent event )
163     {
164         dispatcher.onEvent( event );
165         delegate.metadataDownloaded( event );
166     }
167 
168     @Override
169     public void metadataDownloading( RepositoryEvent event )
170     {
171         dispatcher.onEvent( event );
172         delegate.metadataDownloading( event );
173     }
174 
175 }