[jbosscache-dev] API changes in Habanero

Manik Surtani manik at jboss.org
Thu Jan 4 09:47:09 EST 2007


Guys,

Here are a few major refactorings I've done on HEAD (checked in  
already).  Some of these are on the API level and do affect the way  
interceptors and other subsystems interact with the node structure,  
hence the email.

* Got rid of the horrible BypassInterceptorChain malarky when  
interacting with nodes and you don't want calls up the interceptor chain
	* Used by interceptors themselves, as well as other internal  
subsystems including state transfer and the cache itself.
	* BypassInterceptorChain will still exist as an Option, as there are  
some valid use cases for this.
		* This option is now SOLELY handled by the  
InvocationContextInterceptor, which directs the call to the last  
interceptor in the chain if the option is present
		* Not handled internally in Node implementation methods anymore
	* Replaced with a bunch of XXXDirect() methods on NodeSPI for direct  
interaction/bypassing interceptor chains
		* E.g., Node.getChild(Fqn f) goes up the interceptor chain,  
NodeSPI.getChildDirect(Fqn f) operates directly on the node.
		* Benefits: much easier to read, understand and maintain, more  
performant.
	
* Got rid of Node.getNodeSPI()
	* NodeSPI interface can now be easily obtained since all methods on  
NodeSPI which would otherwise return Node now return NodeSPI
	* Methods on Cache (such as getRoot()) which would return Node are  
overridden in CacheSPI to return NodeSPI.
	* Gives interceptors and the like access to NodeSPI without letting  
this interface escape to the user API.
	* There are still a very small handful of cases where direct casts  
are necessary, but this is very internalised (within UnversionedNode  
and WorkspaceNode, for example) and a bunch of unit tests (for closer  
inspection)
	* In general, NodeSPI is now much tighter and can only officially be  
obtained from another NodeSPI or a CacheSPI.

* Got rid of NodeSPI.getRawData() - superfluous now that we have  
NodeSPI.getDataDirect()

This stuff should give us a much more robust data model and user/SPI  
interface for the nodes and caches.

Please let me know what you think or if you have any issues/further  
suggestions.

Cheers,
--
Manik Surtani

Lead, JBoss Cache
JBoss, a division of Red Hat

Email: manik at jboss.org
Telephone: +44 7786 702 706
MSN: manik at surtani.org
Yahoo/AIM/Skype: maniksurtani







More information about the jbosscache-dev mailing list