Cayenne User Documentation
Remote Object Persistence Lifecycle Callbacks

(since 3.0)

The easiest way to add server-side functionality to the web service is by registering persistent object lifecycle callbacks. Note that enabling server-side callbacks for ROP is done differently from the general advice above. You'll need to subclass HesianService, overriding 'createChannel':

public class MyService extends HessianService {

    protected DataChannel createChannel() {
        ClientServerChannel channel = new ClientServerChannel(domain);
        channel.setLifecycleCallbacksEnabled(true);
        return channel;
    }
}

Note that at some point server-side callbacks will be the default, so this code may no longer be necessary.

.