Hmm.. Looks like I answered the injection question, which is a part of the multi-tenancy puzzle, but not all of it.
In the newest versions of Cayenne multi-tenancy is normally achieved by creating multiple ServerRuntimes - one per tenant. Specifically when you have schema-per-tenant situation. Each ServerRuntime will override the schema mapping as appropriate. I guess then you will have to implement multi-tenant-aware RemoteService that has access to all possible runtimes and can dynamically pick which one to use for each request. Andrus On Jun 27, 2014, at 9:32 AM, Andrus Adamchik <[email protected]> wrote: > Hi Emanuele, > > "extra-modules” servlet parameter should allow you to load your own Cayenne > extensions. From the javadocs of ROPHessianServlet: > > http://cayenne.apache.org/docs/3.1/api/org/apache/cayenne/configuration/rop/server/ROPHessianServlet.html > > "extra-modules (optional) - a comma or space-separated list of class names, > with each class implementing Module interface. These are the custom modules > loaded after the two standard ones that allow users to override any Cayenne > runtime aspects, e.g. RequestHandler. Each custom module must have a no-arg > constructor”. > > HTH > > Andrus > > > On Jun 26, 2014, at 12:13 AM, Emanuele Maiarelli > <[email protected]> wrote: >> I'm wondering if it is possibile to specify the ServerRuntime to >> ROPHessianServlet >> injecting a MapLoader that 'moves' DbEntity on different database schema >> depending by ClientChannel authenticated user. >> >> >> >> Any idea? >> >> Regards >> >> EM > >
