/* */
/* */ protected void uninstallActionInternal(KernelControllerContext context)
/* */ {
/* 92 */ KernelController controller = (KernelController)context.getController();
/* 93 */ Kernel kernel = controller.getKernel();
/* 94 */ KernelRegistry registry = kernel.getRegistry();
/* 95 */ KernelConfigurator configurator = kernel.getConfigurator();
/* 96 */ BeanMetaData metaData = context.getBeanMetaData();
/* 97 */ Object name = metaData.getName();
/* */
/* 99 */ List uninstalls = metaData.getUninstalls();
/* 100 */ if (uninstalls != null)
/* */ {
/* 102 */ for (int i = uninstalls.size() - 1; i >= 0; i--)
/* */ {
/* 104 */ InstallMetaData uninstall = (InstallMetaData)uninstalls.get(i);
/* 105 */ ControllerContext target = context;
/* 106 */ if (uninstall.getBean() != null)
/* */ {
/* 108 */ target = controller.getContext(uninstall.getBean(), uninstall.getDependentState());
/* 109 */ if (target == null)
/* */ {
/* 111 */ this.log.warn("Ignoring uninstall action on target in incorrect state " + uninstall.getBean());
/* 112 */ continue;
/* */ }
/* */ }
/* 115 */ if ((target instanceof InvokeDispatchContext))
/* */ {
/* */ try
/* */ {
/* 119 */ InvokeDispatchHelper.invoke(configurator, target.getTarget(), (InvokeDispatchContext)target, uninstall.getMethodName(), uninstall.getParameters());
/* */ }
/* */ catch (Throwable t)
/* */ {
/* 129 */ this.log.warn("Ignoring uninstall action on target " + uninstall, t);
/* */ }
/* */ }
/* */ else
/* */ {
/* 134 */ throw new IllegalArgumentException("Cannot uninstall, context " + target + " does not implement InvokeDispatchContext");
/* */ }
/* */ }
/* */ }
/* */
/* */ try
/* */ {
/* 141 */ controller.removeSupplies(context);
/* 142 */ registry.unregisterEntry(name);
/* */ }
/* */ catch (Throwable t)
/* */ {
/* 146 */ this.log.warn("Ignoring unregistered entry at uninstall " + name);
/* */ }