You should check servlet lifecycle callbacks (e.g. read the spec ) and create/destroy the remote cache manager and get a reference to the remote cache in those callbacks.
We're doing something similar in our app, starting Infinspan in a ServletContextListener and then exporting the cache mgr to the servlet context where other app components can make use of it.
Make sure the class is properly annotated, or declared in as ServletContextListener in web.xml
This is the source code: