Is it possible to create few service proxies with the same method names?

32 Views Asked by At

1st service proxy:

package com.test.resource.handler;

@ProxyGen public interface ResourceContract {

static ResourceContract create(Vertx vertx, Logger logger) {
    return new ResourceHandler(vertx, logger);
}

static ResourceContract createProxy(Vertx vertx, String address) {
    return new ResourceContractVertxEBProxy(vertx, address);
}

void create();

void read();

void update();

void delete();

}

and 2nd service proxy:

package com.test.agent.handler;

@ProxyGen public interface AgentContract {

static AgentContract create(Vertx vertx, Logger logger) {
    return new AgentHandler(vertx, logger);
}

static AgentContract createProxy(Vertx vertx, String address) {
    return new AgentContractVertxEBProxy(vertx, address);
}

void create();

void read();

void update();

void delete();

}

During building receive error: Overloaded methods are not allowed in ProxyGen interfaces

1

There are 1 best solutions below

2
Tomislav Jakopanec On

No, it's not possible as far as I know, because the method names are turned into event bus addresses: create, read, update, delete. But haven't worked with services for quite a while.

EDIT: Just read the docs. Methods are mapped to actions and services have an address. Maybe the static create methods are causing the issue here.