简体   繁体   English

Google Cloud Endpoint初始化

[英]Google Cloud Endpoint initialization

I need to do some initialization in a Google Cloud Endpoint. 我需要在Google Cloud Endpoint中进行一些初始化。 I tried doing this by calling a static method on the endpoint when the app starts - in the ServletContextListener - which sets some static variables in the endpoint. 我尝试通过在应用程序启动时在端点上调用静态方法来实现这一点 - 在ServletContextListener中 - 在端点中设置一些静态变量。 However, these variables are not retained when an endpoint is used. 但是,使用端点时不会保留这些变量。 How does one initialize and endpoint? 如何初始化和端点? Note that I'd like to use this technique (whatever it is) to initialize other endpoints. 请注意,我想使用这种技术(无论它是什么)来初始化其他端点。

What do you want to do exactly ? 你想做什么?

Google Cloud Endpoint are stateless. Google Cloud Endpoint是无国籍的。 A request cannot depend of another. 请求不能依赖于另一个请求。 If you want to share some datas between each request of your endpoints, I think you need to store these datas into the datastore and use memcache to retrieve it. 如果要在端点的每个请求之间共享一些数据,我认为您需要将这些数据存储到数据存储区并使用memcache来检索它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM