3
votes

I need to do some initialization in a 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. 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.

1
i am wondering on the best practice on how to initialize/setup dependencies on the API classes themselves. +1 - CodeFactory.DEV

1 Answers

0
votes

What do you want to do exactly ?

Google Cloud Endpoint are stateless. 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.