#  google.protobuf.service_reflection  ¶

Contains metaclasses used to create protocol service and service stub classes
from ServiceDescriptor objects at runtime.

The GeneratedServiceType and GeneratedServiceStubType metaclasses are used to
inject all useful functionality into the classes output by the protocol
compiler at compile-time.

_class_ ` google.protobuf.service_reflection. ` ` GeneratedServiceStubType ` (
_name_ , _bases_ , _dictionary_ )  ¶

    

Metaclass for service stubs created at runtime from ServiceDescriptors.

This class has similar responsibilities as GeneratedServiceType, except that
it creates the service stub classes.

` mro ` (  )  ¶

    

Return a type’s method resolution order.

_class_ ` google.protobuf.service_reflection. ` ` GeneratedServiceType ` (
_name_ , _bases_ , _dictionary_ )  ¶

    

Metaclass for service classes created at runtime from ServiceDescriptors.

Implementations for all methods described in the Service class are added here
by this class. We also create properties to allow getting/setting all fields
in the protocol message.

The protocol compiler currently uses this metaclass to create protocol service
classes at runtime. Clients can also manually create their own classes at
runtime, as in this example:

    
    
    mydescriptor = ServiceDescriptor(.....)
    class MyProtoService(service.Service):
      __metaclass__ = GeneratedServiceType
      DESCRIPTOR = mydescriptor
    myservice_instance = MyProtoService()
    # ...
    

` mro ` (  )  ¶

    

Return a type’s method resolution order.

###  [ Table of Contents ](../../index.html)

  * [ google.protobuf ](../protobuf.html)
  * [ google.protobuf.any_pb2 ](any_pb2.html)
  * [ google.protobuf.descriptor ](descriptor.html)
  * [ google.protobuf.descriptor_database ](descriptor_database.html)
  * [ google.protobuf.descriptor_pb2 ](descriptor_pb2.html)
  * [ google.protobuf.descriptor_pool ](descriptor_pool.html)
  * [ google.protobuf.duration_pb2 ](duration_pb2.html)
  * [ google.protobuf.empty_pb2 ](empty_pb2.html)
  * [ google.protobuf.field_mask_pb2 ](field_mask_pb2.html)
  * [ google.protobuf.internal.containers ](internal/containers.html)
  * [ google.protobuf.json_format ](json_format.html)
  * [ google.protobuf.message ](message.html)
  * [ google.protobuf.message_factory ](message_factory.html)
  * [ google.protobuf.proto_builder ](proto_builder.html)
  * [ google.protobuf.reflection ](reflection.html)
  * [ google.protobuf.service ](service.html)
  * google.protobuf.service_reflection 
  * [ google.protobuf.struct_pb2 ](struct_pb2.html)
  * [ google.protobuf.symbol_database ](symbol_database.html)
  * [ google.protobuf.text_encoding ](text_encoding.html)
  * [ google.protobuf.text_format ](text_format.html)
  * [ google.protobuf.timestamp_pb2 ](timestamp_pb2.html)
  * [ google.protobuf.type_pb2 ](type_pb2.html)
  * [ google.protobuf.unknown_fields ](unknown_fields.html)
  * [ google.protobuf.wrappers_pb2 ](wrappers_pb2.html)

###  Related Topics

  * [ Documentation overview ](../../index.html)
    * Previous: [ google.protobuf.service ](service.html "previous chapter")
    * Next: [ google.protobuf.struct_pb2 ](struct_pb2.html "next chapter")

###  This Page

  * [ Show Source ](../../_sources/google/protobuf/service_reflection.rst.txt)

©2008, Google LLC. | Powered by [ Sphinx 2.3.1 ](http://sphinx-doc.org/) & [ Alabaster 0.7.12 ](https://github.com/bitprophet/alabaster) | [ Page source ](../../_sources/google/protobuf/service_reflection.rst.txt)