|
| 1 | +/* |
| 2 | + * Copyright 2011 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> |
| 3 | + * |
| 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 |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 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. |
| 15 | + */ |
| 16 | +package com.ocpsoft.rewrite; |
| 17 | + |
| 18 | +import java.util.List; |
| 19 | + |
| 20 | +import com.ocpsoft.rewrite.spi.RequestCycleWrapper; |
| 21 | +import com.ocpsoft.rewrite.spi.RewriteEventProducer; |
| 22 | +import com.ocpsoft.rewrite.spi.RewriteLifecycleListener; |
| 23 | +import com.ocpsoft.rewrite.spi.RewriteProvider; |
| 24 | + |
| 25 | +/** |
| 26 | + * @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> |
| 27 | + * |
| 28 | + */ |
| 29 | +public class RewriteContextImpl implements RewriteContext |
| 30 | +{ |
| 31 | + |
| 32 | + private final List<RewriteProvider<?, ?, ?, ?>> providers; |
| 33 | + private final List<RewriteLifecycleListener<?>> listeners; |
| 34 | + private final List<RequestCycleWrapper<?, ?>> wrappers; |
| 35 | + private final List<RewriteEventProducer> producers; |
| 36 | + |
| 37 | + public RewriteContextImpl(final List<RewriteEventProducer> producers, |
| 38 | + final List<RewriteLifecycleListener<?>> listeners, |
| 39 | + final List<RequestCycleWrapper<?, ?>> wrappers, |
| 40 | + final List<RewriteProvider<?, ?, ?, ?>> providers) |
| 41 | + { |
| 42 | + this.producers = producers; |
| 43 | + this.listeners = listeners; |
| 44 | + this.wrappers = wrappers; |
| 45 | + this.providers = providers; |
| 46 | + } |
| 47 | + |
| 48 | + @Override |
| 49 | + public List<RewriteLifecycleListener<?>> getRewriteLifecycleListeners() |
| 50 | + { |
| 51 | + return listeners; |
| 52 | + } |
| 53 | + |
| 54 | + @Override |
| 55 | + public List<RequestCycleWrapper<?, ?>> getRequestCycleWrappers() |
| 56 | + { |
| 57 | + return wrappers; |
| 58 | + } |
| 59 | + |
| 60 | + @Override |
| 61 | + public List<RewriteProvider<?, ?, ?, ?>> getRewriteProviders() |
| 62 | + { |
| 63 | + return providers; |
| 64 | + } |
| 65 | + |
| 66 | + @Override |
| 67 | + public List<RewriteEventProducer> getRewriteEventProducers() |
| 68 | + { |
| 69 | + return producers; |
| 70 | + } |
| 71 | + |
| 72 | +} |
0 commit comments