...
Wiki Markup |
---|
In this case, composition allows the {{CompositeCollectionPrintableIPAddressList}} class to use its own intrinsic lock in a way that is completely independent of the lock of the underlying list class. This does not allowsrequire the underlying collection to be not thread-safe because the {{CompositeCollectionPrintableIPAddressList}} wrapper prevents direct access to its methods by publishing its own synchronized equivalents. This approach provides consistent locking even if the underlying class changes its locking policy in the future \[[Goetz 06|AA. Java References#Goetz 06]\]. |
...