01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. The ASF licenses this file to You
04: * under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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. For additional information regarding
15: * copyright in this work, please see the NOTICE file in the top level
16: * directory of this distribution.
17: */
18: /*
19: * QueuedReferrerProcessingJob.java
20: *
21: * Created on December 20, 2005, 3:08 PM
22: */
23:
24: package org.apache.roller.business.referrers;
25:
26: import org.apache.roller.business.RollerFactory;
27:
28: /**
29: * Same as the ReferrerProcessingJob, except that we add a little logic that
30: * tries to lookup incoming referrers from the ReferrerQueueManager.
31: *
32: * @author Allen Gilliland
33: */
34: public class QueuedReferrerProcessingJob extends ReferrerProcessingJob {
35:
36: public QueuedReferrerProcessingJob() {
37: super ();
38: }
39:
40: public void execute() {
41:
42: ReferrerQueueManager refQueue = RollerFactory.getRoller()
43: .getReferrerQueueManager();
44:
45: // check the queue for any incoming referrers
46: referrer = refQueue.dequeue();
47:
48: // work until the queue is empty
49: while (referrer != null) {
50: super .execute();
51:
52: // check if there are more referrers to process
53: referrer = refQueue.dequeue();
54: }
55:
56: }
57:
58: }
|