context.getServiceReference(NotificationService.class.getName());
if(notificationServiceRef == null)
throw new IllegalStateException("Notification service not found " +
"in service registry.");
NotificationService notificationService =
(NotificationService) context.getService(notificationServiceRef);
if(notificationService == null)
throw new IllegalStateException("Notification service not found " +
"in service registry.");