class CloudEventServiceManagerImpl implements CloudEventServiceManager {
    Map<String, CloudEventServicePlus> route = new HashMap<>();
    CloudEventInterceptor eventInterceptor;

    public CloudEventServiceManagerImpl() {
        Solon.context().getBeanAsync(CloudEventInterceptor.class, bean -> {
            eventInterceptor = bean;
        });
    }

    /**
     * 获取拦截器
     */
    public CloudEventInterceptor getEventInterceptor() {
        return eventInterceptor;
    }

    /**
     * 注册事件服务
     *
     * @param service 事件服务
     */
    public void register(CloudEventServicePlus service) {
        if (service.getChannel() == null) {
            route.put("", service);
        } else {
            route.put(service.getChannel(), service);
        }
    }

    /**
     * 获取事件服务
     *
     * @param channel 通道
     */
    public CloudEventServicePlus get(String channel) {
        if (channel == null) {
            channel = "";
        }

        return route.get(channel);
    }

    /**
     * 获取事件服务，如果没有则异常
     *
     * @param channel 通道
     */
    public CloudEventServicePlus getOrThrow(String channel) {
        CloudEventServicePlus tmp = get(channel);

        if (tmp == null) {
            if (Utils.isEmpty(channel)) {
                throw new IllegalStateException("CloudEventService does not exist");
            } else {
                throw new IllegalStateException("CloudEventService does not exist channel &" + channel);
            }
        }

        return tmp;
    }

    /**
     * 发布事件
     *
     * @param event 事件
     */
    @Override
    public boolean publish(Event event) throws CloudEventException {<FILL_FUNCTION_BODY>}

    /**
     * 关注事件
     *
     * @param level    级别
     * @param channel  通道
     * @param group    分组
     * @param topic    主题
     * @param observer 观察者
     */
    @Override
    public void attention(EventLevel level, String channel, String group, String topic, String tag, int qos, CloudEventHandler observer) {
        CloudEventServicePlus tmp = getOrThrow(channel);

        if (Utils.isEmpty(group)) {
            group = tmp.getGroup();
        }

        tmp.attention(level, channel, group, topic, tag, qos, observer);
    }
}

        CloudEventServicePlus tmp = getOrThrow(event.channel());

        if (Utils.isEmpty(event.group())) {
            event.group(tmp.getGroup());
        }

        if (Utils.isEmpty(event.key())) {
            event.key(Utils.guid());
        }

        return tmp.publish(event);
    
<no_super_class>