Looks like we forget to respond to this one, sorry :(
Just to clarify what we'd like.
We's liket an ability to install an exception listener, but on the server side.
Currently we can do this on the client side, but not on the server side.
We don't want remoting to clean anything up automatically, we just want it to inform us when it finds the connection is broken so that we can do our own cleanup.
From the server side we currently don't know the connection is broken until we try and send on it.
Imgaine the case where a JMS connection has died, but no messages are being sent on it.
Since no messages are being sent, we get no exceptions so we don't know the connection is dead. Therefore it sits around potentially for ever with all the associated application level resources it has allocated.
I guess this would require some kind of ping to impement.
When discussed some time ago, you suggested implementing a kind of "lease" on the ping so if clients didn't ping within a certain amount of time, remoting would consider it broken and call our exception handler.
Just to clarify, we don't want remoting to do any cleanup automatically, simply to call a server side exception handler so we can do this.
I agree, what to cleanup is an application level issue, and varies from app to app.
Do you need any more information on this, or are you good to go?
Am good for now. Thanks.
The server side connection listeners don't appear to be working.
I am registering a ConnectionListener with the Connector, then later on a Client instance for the connection either disconnects or the client process dies, but my ConnectionListener doesn't get invoked in either case.
I have sent you a test case to demonstrate this.
Perhaps I am doing something wrong?
Ok. So a few thing with the test case. First, must explicitly set the lease period and add a connection listener for leasing to be triggered. So would need:
Second, since the server and client are in same VM, when the connect() is called on the Client class, it ask the client invoker if is already connected. Since is local, will always say that it is connected. This causes the initial request by the client to setup the lease to be by-passed. Therefore, the lease won't even be started on the server side until the first invocation from the client to the server is made. Even worse, after this first invocation is made and the server sets up its lease for the client, the client will NOT be sending a lease renewal because it was never started up (since the connect() call by-passed this).
So I have created a jira issue for this (JBREM-313). Although not working locally, should work if remote.
Is fixed now for local case.
The test was adding a connectionlistener, it just wasn't setting a leasePeriod.
I (wrongly) assumed this was defaulted and setLeasePeriod was only used to set it to some other value than the default.
After setting the leasePeriod it seems to work.