[Building Sakai] wiring up potentially null services

John Bush john.bush at rsmart.com
Wed Nov 4 10:01:08 PST 2009


I'm working on a project where we have an optional service, similiar  
to say the ContentReviewService.  You can't directly inject in spring  
because the bean might not exist.  I've typically solved this by  
making a call directly to the component manager in the code that  
requires the service, and then testing for null everywhere.  I've been  
told there might be something in EntityBroker or somewhere else that  
can handle this more elegantly.   Ring a bell for anyone ?

John Bush
Development Manager
rSmart






More information about the sakai-dev mailing list