switch (state) {
case Bundle.ACTIVE:
try {
injectBundleContext(activator.getContext(), bundle.getBundleContext());
if (!activator.start(4, TimeUnit.SECONDS)) {
throw new LifecycleInterceptorException(MESSAGES.startContextFailed());
}
} catch (TimeoutException ex) {
throw new LifecycleInterceptorException(ex.getMessage(), ex);
}
break;
case Bundle.RESOLVED:
activator.stop(4, TimeUnit.SECONDS);
uninjectBundleContext(activator.getContext());