2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowjava.protocol.impl.core.connection;
11 import io.netty.util.concurrent.Future;
12 import io.netty.util.concurrent.GenericFutureListener;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
17 * Wraps outgoing message and includes listener attached to this message. This object
18 * is sent to OFEncoder. When OFEncoder fails to serialize the message,
19 * listener is filled with exception. The exception is then delegated to upper ODL layers.
20 * @author michal.polkorab
22 public class MessageListenerWrapper {
25 private GenericFutureListener<Future<Void>> listener;
28 * @param msg outgoing message
29 * @param listener listener attached to channel.write(msg) Future
31 public MessageListenerWrapper(Object msg, GenericFutureListener<Future<Void>> listener) {
32 this.msg = (OfHeader) msg;
33 this.listener = listener;
37 * @return outgoing message (downstream)
39 public OfHeader getMsg() {
45 * @return listener listening on message sending success / failure
47 public GenericFutureListener<Future<Void>> getListener() {