Creating connection with a dedicated server-side context peer and no authentication:
HessianConnection also supports HTTP basic authentication:
Finally a "shared" or "chat" session can be created when multiple client contexts share the same server-side context:
Once a ClientConnection is created, an ObjectContext instance can be obtained like this:
Note that the channel can be reused by multiple peer CayenneContexts.
Cayenne ORM Tier and CWS Client Tier can be deployed together in the same virtual machine. This may be needed to speed up development, but also to achieve consistency and reuse of CWS client objects between thin clients and web applications. The solution is to use ClientServerChannel on top of a regular Cayenne stack:
To fully emulate CWS behavior, we can add serialization to the picture: