I have a bean which extends other Java file. When I create a Spring bean all public methods (from my and from extended files) are exposed. How can I hide not needed methods in bean XML config, so they are not exposed?
Added explanation:
I expose my beans via RDS for Flex application. So, my beans are available over network. With unneeded methods I have two problems:
- Security – anybody can call my setDataSource inherited from JdbcDaoSupport or anything else.. I think it is just crazy 🙂
- Since I use RDS for Flex Builder, which automatically creates remote objects for my Flex app. All methods like setDataSource are available in my Flex app. Which is not good. Of course I can cut them off, but point one still in place.
If the inherited methods should not be accessed, perhaps you should use aggregation instead of inheritance?
As any code can invoke public inherited methods on that object, this is not specific to spring.
Edit: As you found out yourself, the remoting framework can be configured to not expose all methods. If that hadn’t been possible, you could have used:
Test code: