package com.wecloud.netty.dispatch.registry;

import com.wecloud.netty.dispatch.extend.ActionBox;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lixiaozhong
 */
public class ActionBoxRegistry {

	List<ActionBox> list = new ArrayList<>();

	public void add(ActionBox actionBox) {
		list.add(actionBox);
	}

	public Object getAction(Class<?> type) {
		Object o = null;
		for (ActionBox ab : list) {
			o = ab.getAction(type);
			if (null != o) {
				return o;
			}
		}
		return null;
	}
}
