Search in sources :

Example 16 with URIEndpointObject

use of org.apache.servicecomb.foundation.common.net.URIEndpointObject in project incubator-servicecomb-java-chassis by apache.

the class VertxRestTransport method canInit.

@Override
public boolean canInit() {
    setListenAddressWithoutSchema(TransportConfig.getAddress());
    URIEndpointObject ep = (URIEndpointObject) getEndpoint().getAddress();
    if (ep == null) {
        return true;
    }
    if (!NetUtils.canTcpListen(ep.getSocketAddress().getAddress(), ep.getPort())) {
        log.info("can not listen {}, skip {}.", ep.getSocketAddress(), this.getClass().getName());
        return false;
    }
    return true;
}
Also used : URIEndpointObject(org.apache.servicecomb.foundation.common.net.URIEndpointObject)

Aggregations

URIEndpointObject (org.apache.servicecomb.foundation.common.net.URIEndpointObject)16 Endpoint (org.apache.servicecomb.core.Endpoint)8 Test (org.junit.Test)8 Expectations (mockit.Expectations)5 ArrayList (java.util.ArrayList)3 Invocation (org.apache.servicecomb.core.Invocation)3 OperationMeta (org.apache.servicecomb.core.definition.OperationMeta)3 AsyncResponse (org.apache.servicecomb.swagger.invocation.AsyncResponse)3 HttpClientRequest (io.vertx.core.http.HttpClientRequest)2 HttpMethod (io.vertx.core.http.HttpMethod)2 RestOperationMeta (org.apache.servicecomb.common.rest.definition.RestOperationMeta)2 VersionedCache (org.apache.servicecomb.foundation.common.cache.VersionedCache)2 MicroserviceInstance (org.apache.servicecomb.serviceregistry.api.registry.MicroserviceInstance)2 DiscoveryContext (org.apache.servicecomb.serviceregistry.discovery.DiscoveryContext)2 Server (com.netflix.loadbalancer.Server)1 Context (io.vertx.core.Context)1 HttpClient (io.vertx.core.http.HttpClient)1 RequestOptions (io.vertx.core.http.RequestOptions)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1