2 * Copyright 2008 jdumay.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 package org.apache.maven.archiva.repository.scanner.functors;
20 import org.apache.commons.collections.Closure;
21 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
22 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
26 public class TriggerScanCompletedClosure implements Closure
28 private Logger log = LoggerFactory.getLogger( TriggerScanCompletedClosure.class );
30 private final ManagedRepositoryConfiguration repository;
32 public TriggerScanCompletedClosure(ManagedRepositoryConfiguration repository)
34 this.repository = repository;
37 public void execute(Object input)
39 if ( input instanceof RepositoryContentConsumer )
41 RepositoryContentConsumer consumer = (RepositoryContentConsumer) input;
42 consumer.completeScan();
43 log.info( "Consumer [" + consumer.getId() + "] completed for repository [" + repository.getId() + "]");