Search in sources :

Example 1 with ServiceInstanceCustomizer

use of org.apache.dubbo.registry.client.ServiceInstanceCustomizer in project dubbo by alibaba.

the class DubboBootstrap method createServiceInstance.

private ServiceInstance createServiceInstance(String serviceName, String host, int port) {
    this.serviceInstance = new DefaultServiceInstance(serviceName, host, port);
    setMetadataStorageType(serviceInstance, getMetadataType());
    ExtensionLoader<ServiceInstanceCustomizer> loader = ExtensionLoader.getExtensionLoader(ServiceInstanceCustomizer.class);
    // FIXME, sort customizer before apply
    loader.getSupportedExtensionInstances().forEach(customizer -> {
        // customizes
        customizer.customize(this.serviceInstance);
    });
    return this.serviceInstance;
}
Also used : DefaultServiceInstance(org.apache.dubbo.registry.client.DefaultServiceInstance) ServiceInstanceCustomizer(org.apache.dubbo.registry.client.ServiceInstanceCustomizer)

Aggregations

DefaultServiceInstance (org.apache.dubbo.registry.client.DefaultServiceInstance)1 ServiceInstanceCustomizer (org.apache.dubbo.registry.client.ServiceInstanceCustomizer)1