Example 8.35 Client Code for Using the Service Locator public class ServiceLocatorTester { public static void main( String[] args ) { ServiceLocator serviceLocator = ServiceLocator.getInstance(); try { ProjectHome projectHome = (ProjectHome) serviceLocator.getHome( ServiceLocator.Services.PROJECT ); } catch( ServiceException ex ) { // client handles exception System.out.println( ex.getMessage( )); } } }