intp.println();
	public void _bundle(CommandInterpreter intp) throws Exception {		String nextArg = intp.nextArgument();		if (nextArg == null) {			intp.println(ConsoleMsg.CONSOLE_NO_BUNDLE_SPECIFIED_ERROR);		}		while (nextArg != null) {			AbstractBundle bundle = getBundleFromToken(intp, nextArg, true);			if (bundle != null) {				long id = bundle.getBundleId();				intp.println(bundle);				intp.print("  "); //$NON-NLS-1$				intp.print(NLS.bind(ConsoleMsg.CONSOLE_ID_MESSAGE, String.valueOf(id)));				intp.print(", "); //$NON-NLS-1$				intp.print(NLS.bind(ConsoleMsg.CONSOLE_STATUS_MESSAGE, getStateName(bundle.getState())));				if (id != 0) {					File dataRoot = osgi.framework.getDataFile(bundle, ""); //$NON-NLS-1$					String root = (dataRoot == null) ? null : dataRoot.getAbsolutePath();					intp.print(NLS.bind(ConsoleMsg.CONSOLE_DATA_ROOT_MESSAGE, root));				} else {					intp.println();				}				ServiceReference[] services = bundle.getRegisteredServices();				if (services != null) {					intp.print("  "); //$NON-NLS-1$					intp.println(ConsoleMsg.CONSOLE_REGISTERED_SERVICES_MESSAGE);					for (int j = 0; j < services.length; j++) {						intp.print("    "); //$NON-NLS-1$						intp.println(services[j]);					}				} else {					intp.print("  "); //$NON-NLS-1$					intp.println(ConsoleMsg.CONSOLE_NO_REGISTERED_SERVICES_MESSAGE);				}				services = bundle.getServicesInUse();				if (services != null) {					intp.print("  "); //$NON-NLS-1$					intp.println(ConsoleMsg.CONSOLE_SERVICES_IN_USE_MESSAGE);					for (int j = 0; j < services.length; j++) {						intp.print("    "); //$NON-NLS-1$						intp.println(services[j]);					}				} else {					intp.print("  "); //$NON-NLS-1$					intp.println(ConsoleMsg.CONSOLE_NO_SERVICES_IN_USE_MESSAGE);				}				org.osgi.framework.ServiceReference packageAdminRef = context.getServiceReference("org.osgi.service.packageadmin.PackageAdmin"); //$NON-NLS-1$				if (packageAdminRef != null) {					org.osgi.service.packageadmin.PackageAdmin packageAdmin = (org.osgi.service.packageadmin.PackageAdmin) context.getService(packageAdminRef);					if (packageAdmin != null) {						try {							org.osgi.service.packageadmin.ExportedPackage exportedpkgs[] = packageAdmin.getExportedPackages((org.osgi.framework.Bundle) null);							if (exportedpkgs == null) {								intp.print("  "); //$NON-NLS-1$								intp.println(ConsoleMsg.CONSOLE_NO_EXPORTED_PACKAGES_MESSAGE);								intp.print("  "); //$NON-NLS-1$								intp.println(ConsoleMsg.CONSOLE_NO_IMPORTED_PACKAGES_MESSAGE);							} else {								boolean title = true;								for (int i = 0; i < exportedpkgs.length; i++) {									org.osgi.service.packageadmin.ExportedPackage exportedpkg = exportedpkgs[i];									if (exportedpkg.getExportingBundle() == bundle) {										if (title) {											intp.print("  "); //$NON-NLS-1$											intp.println(ConsoleMsg.CONSOLE_EXPORTED_PACKAGES_MESSAGE);											title = false;										}										intp.print("    "); //$NON-NLS-1$										intp.print(exportedpkg);										if (exportedpkg.isRemovalPending()) {											intp.println(ConsoleMsg.CONSOLE_EXPORTED_REMOVAL_PENDING_MESSAGE);										} else {											intp.println(ConsoleMsg.CONSOLE_EXPORTED_MESSAGE);										}									}								}								if (title) {									intp.print("  "); //$NON-NLS-1$									intp.println(ConsoleMsg.CONSOLE_NO_EXPORTED_PACKAGES_MESSAGE);								}								title = true;								for (int i = 0; i < exportedpkgs.length; i++) {									org.osgi.service.packageadmin.ExportedPackage exportedpkg = exportedpkgs[i];									org.osgi.framework.Bundle[] importers = exportedpkg.getImportingBundles();									for (int j = 0; j < importers.length; j++) {										if (importers[j] == bundle) {											if (title) {												intp.print("  "); //$NON-NLS-1$												intp.println(ConsoleMsg.CONSOLE_IMPORTED_PACKAGES_MESSAGE);												title = false;											}											intp.print("    "); //$NON-NLS-1$											intp.print(exportedpkg);											org.osgi.framework.Bundle exporter = exportedpkg.getExportingBundle();											if (exporter != null) {												intp.print("<"); //$NON-NLS-1$												intp.print(exporter);												intp.println(">"); //$NON-NLS-1$											} else {												intp.print("<"); //$NON-NLS-1$												intp.print(ConsoleMsg.CONSOLE_STALE_MESSAGE);												intp.println(">"); //$NON-NLS-1$											}											break;										}									}								}								if (title) {									intp.print("  "); //$NON-NLS-1$									intp.println(ConsoleMsg.CONSOLE_NO_IMPORTED_PACKAGES_MESSAGE);								}								intp.print("  "); //$NON-NLS-1$								if ((packageAdmin.getBundleType(bundle) & PackageAdminImpl.BUNDLE_TYPE_FRAGMENT) > 0) {									org.osgi.framework.Bundle[] hosts = packageAdmin.getHosts(bundle);									if (hosts != null) {										intp.println(ConsoleMsg.CONSOLE_HOST_MESSAGE);										for (int i = 0; i < hosts.length; i++) {											intp.print("    "); //$NON-NLS-1$											intp.println(hosts[i]);										}									} else {										intp.println(ConsoleMsg.CONSOLE_NO_HOST_MESSAGE);									}								} else {									org.osgi.framework.Bundle[] fragments = packageAdmin.getFragments(bundle);									if (fragments != null) {										intp.println(ConsoleMsg.CONSOLE_FRAGMENT_MESSAGE);										for (int i = 0; i < fragments.length; i++) {											intp.print("    "); //$NON-NLS-1$											intp.println(fragments[i]);										}									} else {										intp.println(ConsoleMsg.CONSOLE_NO_FRAGMENT_MESSAGE);									}								}								RequiredBundle[] requiredBundles = packageAdmin.getRequiredBundles(null);								RequiredBundle requiredBundle = null;								if (requiredBundles != null) {									for (int i = 0; i < requiredBundles.length; i++) {										if (requiredBundles[i].getBundle() == bundle) {											requiredBundle = requiredBundles[i];											break;										}									}								}								if (requiredBundle == null) {									intp.print("  "); //$NON-NLS-1$									intp.println(ConsoleMsg.CONSOLE_NO_NAMED_CLASS_SPACES_MESSAGE);								} else {									intp.print("  "); //$NON-NLS-1$									intp.println(ConsoleMsg.CONSOLE_NAMED_CLASS_SPACE_MESSAGE);									intp.print("    "); //$NON-NLS-1$									intp.print(requiredBundle);									if (requiredBundle.isRemovalPending()) {										intp.println(ConsoleMsg.CONSOLE_REMOVAL_PENDING_MESSAGE);									} else {										intp.println(ConsoleMsg.CONSOLE_PROVIDED_MESSAGE);									}								}								title = true;								for (int i = 0; i < requiredBundles.length; i++) {									if (requiredBundles[i] == requiredBundle)										continue;									org.osgi.framework.Bundle[] depBundles = requiredBundles[i].getRequiringBundles();									if (depBundles == null)										continue;									for (int j = 0; j < depBundles.length; j++) {										if (depBundles[j] == bundle) {											if (title) {												intp.print("  "); //$NON-NLS-1$												intp.println(ConsoleMsg.CONSOLE_REQUIRED_BUNDLES_MESSAGE);												title = false;											}											intp.print("    "); //$NON-NLS-1$											intp.print(requiredBundles[i]);											org.osgi.framework.Bundle provider = requiredBundles[i].getBundle();											intp.print("<"); //$NON-NLS-1$											intp.print(provider);											intp.println(">"); //$NON-NLS-1$										}									}								}								if (title) {									intp.print("  "); //$NON-NLS-1$									intp.println(ConsoleMsg.CONSOLE_NO_REQUIRED_BUNDLES_MESSAGE);								}							}						} finally {							context.ungetService(packageAdminRef);						}					}				} else {					intp.print("  "); //$NON-NLS-1$					intp.println(ConsoleMsg.CONSOLE_NO_EXPORTED_PACKAGES_NO_PACKAGE_ADMIN_MESSAGE);				}				SecurityManager sm = System.getSecurityManager();				if (sm != null) {					ProtectionDomain domain = bundle.getProtectionDomain();					intp.println(domain);				}			}			nextArg = intp.nextArgument();		}	}