Lightweight Caching Framework in vSphere Java API 2.0
In vSphere Java API 2.0, I wrote a lightweight caching framework. It’s still experimental but has a great potential to greatly simplify your development work. Commercial companies already use it in their products.
The motivation behind this framework is simple – instead of keep polling the changes from the server side, you keep a local cache that is made as fresh as possible. The View in the vSphere Perl toolkit is one way to do. It caches all properties of a managed object despite the fact that you don’t need that many at all.
The caching framework in vSphere Java API takes another approach. You tells it what managed objects and what properties you want to be cached. After that, the caching framework does its best to read the properties and keep them as fresh as possible.
Architecturally the caching framework is totally separated from the core of the API. You can take it away without any impact on the rest of the API. This is quite different from other toolkit.
Have enough introduction? Let’s take a look at sample code:
Recent Comments