1 package org.apache.maven.repository.manager.web.job;
\r
4 * Copyright 2005-2006 The Apache Software Foundation.
\r
6 * Licensed under the Apache License, Version 2.0 (the "License");
\r
7 * you may not use this file except in compliance with the License.
\r
8 * You may obtain a copy of the License at
\r
10 * http://www.apache.org/licenses/LICENSE-2.0
\r
12 * Unless required by applicable law or agreed to in writing, software
\r
13 * distributed under the License is distributed on an "AS IS" BASIS,
\r
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
15 * See the License for the specific language governing permissions and
\r
16 * limitations under the License.
\r
19 import org.apache.maven.repository.indexing.RepositoryIndexException;
\r
20 import org.apache.maven.repository.manager.web.execution.DiscovererExecution;
\r
21 import org.codehaus.plexus.scheduler.AbstractJob;
\r
22 import org.quartz.JobDataMap;
\r
23 import org.quartz.JobExecutionContext;
\r
24 import org.quartz.JobExecutionException;
\r
26 import java.net.MalformedURLException;
\r
29 * This class is the discoverer job that is executed by the scheduler.
\r
31 * @plexus.component role="org.apache.maven.repository.manager.web.job.DiscovererJob"
\r
33 public class DiscovererJob
\r
36 public static final String ROLE = DiscovererJob.class.getName();
\r
38 public static final String MAP_DISCOVERER_EXECUTION = "EXECUTION";
\r
41 * Execute the discoverer and the indexer.
\r
44 * @throws org.quartz.JobExecutionException
\r
47 public void execute( JobExecutionContext context )
\r
48 throws JobExecutionException
\r
50 JobDataMap dataMap = context.getJobDetail().getJobDataMap();
\r
51 setJobDataMap( dataMap );
\r
52 getLogger().info( "[DiscovererJob] Start execution of DiscovererJob.." );
\r
56 DiscovererExecution execution = (DiscovererExecution) dataMap.get( MAP_DISCOVERER_EXECUTION );
\r
57 execution.executeDiscoverer();
\r
59 catch ( RepositoryIndexException e )
\r
62 e.printStackTrace();
\r
64 catch ( MalformedURLException me )
\r
67 me.printStackTrace();
\r
70 getLogger().info( "[DiscovererJob] DiscovererJob has finished executing." );
\r