laforge49/JActor — Issue #3: API Problems
Author: laforge49
Created: 2012-01-25 01:58:58+00:00
State: open

I am very concerned that when creating an anonymous subclass of Binding, it is too easy to do unsafe things like call send from within acceptRequest. I find myself doing this, so I know it will happen. And the code seems to work, making it especially dangerous.

My solution is to pass internals in the processRequest method of Binding and to restrict the protected API of JBActor and Component. Methods that are unsafe to call in acceptRequest will then only be accessible via the internals parameter on processRequest.

It is a bit ugly, as now you will need to do a internals.send instead of just send. But it will eliminate a bunch of thread safety issues, so I think is is worth it.