001 /**
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one or more
004 * contributor license agreements. See the NOTICE file distributed with
005 * this work for additional information regarding copyright ownership.
006 * The ASF licenses this file to You under the Apache License, Version 2.0
007 * (the "License"); you may not use this file except in compliance with
008 * the License. You may obtain a copy of the License at
009 *
010 * http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018 package org.apache.camel.component.irc;
019
020 import org.apache.camel.CamelContext;
021 import org.apache.camel.impl.DefaultExchange;
022
023 public class IrcExchange extends DefaultExchange {
024 private IrcBinding binding;
025
026 public IrcExchange(CamelContext context, IrcBinding binding) {
027 super(context);
028 this.binding = binding;
029 }
030
031 public IrcExchange(CamelContext context, IrcBinding binding, IrcMessage inMessage) {
032 this(context, binding);
033 setIn(inMessage);
034 }
035
036 public IrcBinding getBinding() {
037 return binding;
038 }
039
040 public void setBinding(IrcBinding binding) {
041 this.binding = binding;
042 }
043
044 @Override
045 public IrcMessage getIn() {
046 return (IrcMessage) super.getIn();
047 }
048
049 @Override
050 public IrcMessage getOut() {
051 return (IrcMessage) super.getOut();
052 }
053
054 @Override
055 public IrcMessage getOut(boolean lazyCreate) {
056 return (IrcMessage) super.getOut(lazyCreate);
057 }
058
059 @Override
060 public IrcMessage getFault() {
061 return (IrcMessage) super.getFault();
062 }
063
064 @Override
065 public IrcExchange newInstance() {
066 return new IrcExchange(getContext(), getBinding());
067 }
068
069 @Override
070 protected IrcMessage createInMessage() {
071 return new IrcMessage();
072 }
073
074 @Override
075 protected IrcMessage createOutMessage() {
076 return new IrcMessage();
077 }
078 }