All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.boot.dubbo.discovery.DubboApplicationEventPublisher Maven / Gradle / Ivy

There is a newer version: 1.5.33
Show newest version
package com.alibaba.boot.dubbo.discovery;

import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.registry.NotifyListener;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.cloud.client.discovery.event.InstanceRegisteredEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;

import java.util.List;

/**
 * Created by wuyu on 2017/4/23.
 */
public class DubboApplicationEventPublisher implements ApplicationEventPublisherAware, NotifyListener {

    private ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
        this.applicationEventPublisher = applicationEventPublisher;
    }

    @Override
    public void notify(List urls) {
        applicationEventPublisher.publishEvent(new InstanceRegisteredEvent<>(DubboDiscoveryClient.class, urls));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy