System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() message received: " + aString);
boolean exceptionProduced = false;
RequestContext requestContext = null;
ServiceReference serviceRef = null;
// Context is not working properly so we can't trust that this is
// working.....
try {
requestContext = context.getRequestContext();
serviceRef = (ServiceReference)requestContext.getServiceReference();
} catch (Exception ex) {
System.out.println("CallBackBasicServiceImpl.setCallbackIllegally() " + ex.toString());
ex.printStackTrace();
return;
}
// Ok, call setCallback with my own service reference.
try {
serviceRef.setCallback(serviceRef);
} catch (NullPointerException npe) {
// This is not an appropriate exception.
System.out.println("Test10 NPE exception during setCallback to own service reference");
npe.printStackTrace();
return;