Question

I have an interface as given below, what I need to do is that I need to load the implementation class dynamically. That is I need to load different classes for the same interface in different situations.

@Path("/service")
@WebService
public interface Authentication {

    @Path("/t/login")
    @POST
    @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
    @WebMethod
    public LoginRsp loginUser(@WebParam(name = "login") LoginRq login);
}

My current implementation class is as given below, I need to load another implementation class for the same request dynamically overriding my default class. Is it possible to do so?

@WebService(endpointInterface = "service.ws.Authentication")
public class AuthenticationImpl implements Authentication {
-
-
}

And also, is it possible to set endpointInterface through an xml file?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top