2 * Copyright (c) 2013 Cisco Systems, Inc. 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.controller.cluster.raft.utils;
11 import akka.actor.UntypedActor;
13 import java.util.ArrayList;
14 import java.util.List;
17 public class MessageCollectorActor extends UntypedActor {
18 private List<Object> messages = new ArrayList<>();
20 @Override public void onReceive(Object message) throws Exception {
21 if(message instanceof String){
22 if("get-all-messages".equals(message)){
23 getSender().tell(messages, getSelf());
26 messages.add(message);