@Override protected Endpoint createEndpoint(Transport transport, CacheEndpoint cacheEndpoint) { return new Endpoint(transport, cacheEndpoint.getEndpoint(), cacheEndpoint.getInstance()); } }
@Override protected Object createEndpoint(String transportName, String endpoint, MicroserviceInstance instance) { Transport transport = CseContext.getInstance().getTransportManager().findTransport(transportName); if (transport == null) { return null; } return new Endpoint(transport, endpoint, instance); } }
/** * 将配置的URI转换为endpoint * addressWithoutSchema 配置的URI,没有schema部分 */ protected void setListenAddressWithoutSchema(String addressWithoutSchema, Map<String, String> pairs) { addressWithoutSchema = genAddressWithoutSchema(addressWithoutSchema, pairs); this.endpoint = new Endpoint(this, NetUtils.getRealListenAddress(getName(), addressWithoutSchema)); if (this.endpoint.getEndpoint() != null) { this.publishEndpoint = new Endpoint(this, RegistryUtils.getPublishAddress(getName(), addressWithoutSchema)); } else { this.publishEndpoint = null; } }
public CseServer(Transport transport, CacheEndpoint cacheEndpoint) { super(null); endpoint = new Endpoint(transport, cacheEndpoint.getEndpoint(), cacheEndpoint.getInstance()); instance = cacheEndpoint.getInstance(); this.setAlive(true); this.setReadyToServe(true); }