Class StandardJavaGrpcStubFactory

java.lang.Object
net.devh.boot.grpc.client.stubfactory.StandardJavaGrpcStubFactory
All Implemented Interfaces:
StubFactory
Direct Known Subclasses:
AsyncStubFactory, BlockingStubFactory, FutureStubFactory

public abstract class StandardJavaGrpcStubFactory extends Object implements StubFactory
A factory for creating stubs provided by standard grpc Java library. This is an abstract super-type that can be extended to support the different provided types.
  • Constructor Details

    • StandardJavaGrpcStubFactory

      public StandardJavaGrpcStubFactory()
  • Method Details

    • createStub

      public AbstractStub<?> createStub(Class<? extends AbstractStub<?>> stubType, Channel channel)
      Description copied from interface: StubFactory
      Creates a stub of the given type.
      Specified by:
      createStub in interface StubFactory
      Parameters:
      stubType - The type of the stub to create.
      channel - The channel used to create the stub.
      Returns:
      The newly created stub.
    • getFactoryMethodName

      protected abstract String getFactoryMethodName()
      Derives the name of the factory method from the given stub type.
      Returns:
      The name of the factory method.