Add plugins at the time of static initialization
diff --git a/include/grpc++/impl/server_builder_plugin.h b/include/grpc++/impl/server_builder_plugin.h
index 7cf369e..f792c4b 100644
--- a/include/grpc++/impl/server_builder_plugin.h
+++ b/include/grpc++/impl/server_builder_plugin.h
@@ -64,16 +64,6 @@
} // namespace grpc
-#define GRPC_DECLARE_PLUGIN(plugin_name) \
- namespace sBP##plugin_name { \
- extern std::unique_ptr<ServerBuilderPlugin> Create##plugin_name(); \
- }
-#define GRPC_INIT_PLUGIN(map, plugin_name) \
- { \
- std::unique_ptr<ServerBuilderPlugin> plugin = \
- sBP##plugin_name::Create##plugin_name(); \
- map[plugin->name()] = std::move(plugin); \
- }
#endif // GRPCXX_IMPL_SERVER_BUILDER_PLUGIN_H
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index a47b5c7..52064b1 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -113,6 +113,9 @@
/// Return a running server which is ready for processing calls.
std::unique_ptr<Server> BuildAndStart();
+ static void InternalAddPluginFactory(
+ std::unique_ptr<ServerBuilderPlugin> (*CreatePlugin)());
+
private:
friend class ::grpc::testing::ServerBuilderPluginTest;