Re: [jax-rs-spec users] RxInvokerProvider


Santiago Pericas-Geertsen
 

Hi Jim,

 We’ll have to wait until the e-mail migration is completed to look at the original thread.

On May 16, 2017, at 12:06 AM, Jim Ma <mail2jimma@...> wrote:

Hi Santiago, 
Before java.net is closed and all the archive emails are lost, I didn't finish going through all the traffic and find the archive email about this jave generic issue?  Can you please explain it again ?  
Does user creates provider and
instantiate invoker like following still have this generic issue ?
 
   public class CompletionStageRxInvokerProvider implements RxInvokerProvider<AnotherCompletionStageRxInvokerImpl> {
      public AnotherCompletionStageRxInvokerImpl getRxInvoker(SyncInvoker syncInvoker, ExecutorService executorService) {
          return new AnotherCompletionStageRxInvokerImpl(syncInvoker, executorService);
      }
   }

AnotherCompletionStageRxInvokerImpl invoker = builder.rx(new CompletionStageRxInvokerProvider())

 I can’t recall if this particular pattern was explored. Generally, however, a provider in JAX-RS is a type that is registered and not instantiated by application code. In fact, the default scope for providers is application scope. So the general idea is to instantiate it once and then use it many times to obtain whatever it provides (RxInvoker instances in this case). 

— Santiago


On Tue, May 9, 2017 at 9:19 PM, Santiago Pericas-Geertsen <santiago.pericasgeertsen@...> wrote:
Hi Jim,

 Once we introduced the notion of a provider to instantiate invokers, we run into a Java generics issue that we could not resolve (you can check the archives here [1]). The current solution was a bit of a compromise between requirements and type system capabilities.

— Santiago


On May 8, 2017, at 11:59 PM, Jim Ma <mail2jimma@...> wrote:

Hi, 
The new added RxInvokerProvider must be registered to the client using Client.register(Class) before create another reactive implementation invoker. Why do we need register to client first? Is it good that we simply change the Invocation.Builde#rx to 
   public <T extends RxInvoker> T rx(RxInvokerProvider<T> provider)
   {
      return provider.getRxInvoker(this, executorService);
   }
without register ? 

Thanks,
Jim



Join jaxrs-spec@javaee.groups.io to automatically receive all group messages.