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.irc;
018
019 import org.apache.camel.CamelContext;
020 import org.apache.camel.impl.DefaultExchange;
021
022 public class IrcExchange extends DefaultExchange {
023 private IrcBinding binding;
024
025 public IrcExchange(CamelContext context, IrcBinding binding) {
026 super(context);
027 this.binding = binding;
028 }
029
030 public IrcExchange(CamelContext context, IrcBinding binding, IrcMessage inMessage) {
031 this(context, binding);
032 setIn(inMessage);
033 }
034
035 public IrcBinding getBinding() {
036 return binding;
037 }
038
039 public void setBinding(IrcBinding binding) {
040 this.binding = binding;
041 }
042
043 @Override
044 public IrcMessage getIn() {
045 return (IrcMessage) super.getIn();
046 }
047
048 @Override
049 public IrcMessage getOut() {
050 return (IrcMessage) super.getOut();
051 }
052
053 @Override
054 public IrcMessage getOut(boolean lazyCreate) {
055 return (IrcMessage) super.getOut(lazyCreate);
056 }
057
058 @Override
059 public IrcMessage getFault() {
060 return (IrcMessage) super.getFault();
061 }
062
063 @Override
064 public IrcExchange newInstance() {
065 return new IrcExchange(getContext(), getBinding());
066 }
067
068 @Override
069 protected IrcMessage createInMessage() {
070 return new IrcMessage();
071 }
072
073 @Override
074 protected IrcMessage createOutMessage() {
075 return new IrcMessage();
076 }
077 }