001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.camel.component.netty;
018    
019    import org.apache.camel.AsyncCallback;
020    import org.apache.camel.Exchange;
021    import org.jboss.netty.channel.ChannelPipeline;
022    import org.jboss.netty.channel.ChannelPipelineFactory;
023    import org.jboss.netty.channel.Channels;
024    
025    public abstract class ClientPipelineFactory implements ChannelPipelineFactory {
026        protected NettyProducer producer;
027        protected Exchange exchange;
028        protected AsyncCallback callback;
029    
030        public ClientPipelineFactory() {
031        }
032        
033        public ClientPipelineFactory(NettyProducer producer, Exchange exchange, AsyncCallback callback) {
034            this.producer = producer;
035            this.exchange = exchange;
036            this.callback = callback;
037        }
038        
039        public ChannelPipeline getPipeline() throws Exception {
040            ChannelPipeline channelPipeline = Channels.pipeline();
041            return channelPipeline;
042        }
043    
044        public NettyProducer getProducer() {
045            return producer;
046        }
047    
048        public void setProducer(NettyProducer producer) {
049            this.producer = producer;
050        }
051    
052        public Exchange getExchange() {
053            return exchange;
054        }
055    
056        public void setExchange(Exchange exchange) {
057            this.exchange = exchange;
058        }
059    
060        public AsyncCallback getCallback() {
061            return callback;
062        }
063    
064        public void setCallback(AsyncCallback callback) {
065            this.callback = callback;
066        }
067    
068    }