Search in sources :

Example 26 with RefreshEndpointEvent

use of org.apache.servicecomb.http.client.event.RefreshEndpointEvent in project incubator-servicecomb-java-chassis by apache.

the class ClassificationAddress method refreshEndPoints.

private void refreshEndPoints(MicroserviceCache microserviceCache, String name) {
    Map<String, List<String>> zoneAndRegion = refreshEndPoint(microserviceCache);
    EventManager.post(new RefreshEndpointEvent(zoneAndRegion, name));
}
Also used : RefreshEndpointEvent(org.apache.servicecomb.http.client.event.RefreshEndpointEvent) ArrayList(java.util.ArrayList) List(java.util.List)

Example 27 with RefreshEndpointEvent

use of org.apache.servicecomb.http.client.event.RefreshEndpointEvent in project incubator-servicecomb-java-chassis by apache.

the class ClassificationAddress method initEndPoint.

public void initEndPoint(String typeName) {
    Map<String, List<String>> zoneAndRegion = generateZoneAndRegionAddress(typeName);
    if (zoneAndRegion == null) {
        return;
    }
    EventManager.post(new RefreshEndpointEvent(zoneAndRegion, typeName));
}
Also used : RefreshEndpointEvent(org.apache.servicecomb.http.client.event.RefreshEndpointEvent) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)27 List (java.util.List)27 RefreshEndpointEvent (org.apache.servicecomb.http.client.event.RefreshEndpointEvent)27 HashMap (java.util.HashMap)23 Test (org.junit.jupiter.api.Test)23 EventBus (com.google.common.eventbus.EventBus)10 Expectations (mockit.Expectations)2 AddressManager (org.apache.servicecomb.config.center.client.AddressManager)2 IpPort (org.apache.servicecomb.foundation.common.net.IpPort)1