Ahh ok. then you want something like MutableHandlerRegistry registry = new MutableHandlerRegistry(); ServerBuilder.... fallbackHandlerRegistry(registry) .build();
Some time later... ServiceImplOne serviceInstance = new ServiceImplOne(...); registry.addService(serviceInstance.bindService()); ... and to remove .... registry.removeService(serviceInstance.bindService()); Note that this is using APIs marked as @Experimental and therefore not subject to our API stability guarantees On Mon, Oct 3, 2016 at 5:42 PM, Jeffrey Andrews <[email protected]> wrote: > Louis, > > Thanks for the quick response. I get what you did, but that’s more > static, I meant at runtime. > > In other words, after my Server is built and running, I want to be able to > add or remove services on the fly. > > Jeff > > On Oct 3, 2016, at 8:39 PM, Louis Ryan <[email protected]> wrote: > > ServerBuilder... > .addService(new ServiceImplOne()) > .addService(new ServiceImplTwo()) > .build()l > > where ServiceImplOne is a concrete subclass of a generated stubs > XXXImplBase class (look for an abstract class in the generated code which > implements BindableService) > > On Mon, Oct 3, 2016 at 5:33 PM, quackerjeff <[email protected]> wrote: > >> I read a previous posting that it's possible to register multiple >> services in one server dynamically. I'm using a MutableHandlerRegistry but >> it's addService takes a serviceName or a ServerServiceDefinition. The >> ServiceBuilder.addService takes a BindableService. What do I need to do? >> I'm at a complete and utter loss. I was hoping to have one server >> listening on one port >> to handle my services. Are there any examples? How does the serviceName >> relate to my service implementation,etc? >> >> Thank you! >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "grpc.io" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at https://groups.google.com/group/grpc-io. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/grpc-io/54c47570-ed79-4edf-b368-b34e94f21d0a%40googlegroups.com >> <https://groups.google.com/d/msgid/grpc-io/54c47570-ed79-4edf-b368-b34e94f21d0a%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > -- > You received this message because you are subscribed to the Google Groups " > grpc.io" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/grpc-io. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/grpc-io/24F7FFC9-7EB6-49A0-9A1B-BDD9651EAA7B%40gmail.com > <https://groups.google.com/d/msgid/grpc-io/24F7FFC9-7EB6-49A0-9A1B-BDD9651EAA7B%40gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CADQ0XY1oB0uqt5p4vhAgAwp-vGc%2B%2BaCjbsztnvifTjUtC%3DCBbg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
