public String toString() { if (ceilingVersion != null) { StringBuilder sb = new StringBuilder(); sb.append(isFloorInclusive ? LEFT_CLOSED : LEFT_OPEN); sb.append(floorVersion.getVersion()).append(ENDPOINT_DELIMITER).append( ceilingVersion.getVersion()); sb.append(isCeilingInclusive ? RIGHT_CLOSED : RIGHT_OPEN); return sb.toString(); } else { return floorVersion.getVersion(); } } }
public String toString() { if (ceilingVersion != null) { StringBuilder sb = new StringBuilder(); sb.append(isFloorInclusive ? LEFT_CLOSED : LEFT_OPEN); sb.append(floorVersion.getVersion()).append(ENDPOINT_DELIMITER).append( ceilingVersion.getVersion()); sb.append(isCeilingInclusive ? RIGHT_CLOSED : RIGHT_OPEN); return sb.toString(); } else { return floorVersion.getVersion(); } } }
@Override public String getFrameworkVersion() { Version version = FrameworkUtil.getFrameworkVersion(); if (version == null) { return null; } return version.getVersion(); }
@SuppressWarnings("unchecked") @Override public void start(BundleContext context) throws Exception { LOG.debug("ConnId OSGi Extender - Starting"); OsgiConnectorInfoManagerImpl manager = new OsgiConnectorInfoManagerImpl(); connectorWatcher = new BundleWatcher<>(context, new ConnectorManifestScanner( FrameworkUtil.getFrameworkVersion()), manager); connectorWatcher.start(); Hashtable<String, String> prop = new Hashtable<>(); prop.put("ConnectorBundle-FrameworkVersion", FrameworkUtil.getFrameworkVersion().getVersion()); connectorInfoManager = context.registerService(new String[] { ConnectorInfoManager.class.getName(), ConnectorEventPublisher.class.getName() }, manager, prop); LOG.debug("ConnId OSGi Extender - Started"); }
"Bundle " + parsed.getLocation() + " requests an unrecognized framework version " + frameworkVersion + " but available is " + FrameworkUtil.getFrameworkVersion().getVersion(); throw new ConfigurationException(message);
/** * Parses the manifest. * @return The manifest. Note that the classes/classloaders will * not be populated yet. That is to be done at a higher-level. * @throws ConfigurationException If there were any structural problems. */ public ConnectorBundleManifest parse() throws ConfigurationException { String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION); String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME); String bundleVersion =getRequiredAttribute(ATT_BUNDLE_VERSION); if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) { String message = "Bundle " + _fileName + " requests an unrecognized " + "framework version " + frameworkVersion + " but available is " + FrameworkUtil.getFrameworkVersion().getVersion(); throw new ConfigurationException(message); } ConnectorBundleManifest rv = new ConnectorBundleManifest(); rv.setFrameworkVersion(frameworkVersion); rv.setBundleName(bundleName); rv.setBundleVersion(bundleVersion); return rv; }
/** * Parses the manifest. * * @return The manifest. Note that the classes/classloaders will not be populated yet. That is to be done at a * higher-level. * @throws ConfigurationException if there were any structural problems. */ public ConnectorBundleManifest parse() throws ConfigurationException { String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION); String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME); String bundleVersion = getRequiredAttribute(ATT_BUNDLE_VERSION); if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) { String message = "Bundle " + fileName + " requests an unrecognized " + "framework version " + frameworkVersion + " but available is " + FrameworkUtil.getFrameworkVersion().getVersion(); throw new ConfigurationException(message); } ConnectorBundleManifest rv = new ConnectorBundleManifest(); rv.setFrameworkVersion(frameworkVersion); rv.setBundleName(bundleName); rv.setBundleVersion(bundleVersion); return rv; }
/** * Parses the manifest. * * @return The manifest. Note that the classes/classloaders will not be populated yet. That is to be done at a * higher-level. * @throws ConfigurationException if there were any structural problems. */ public ConnectorBundleManifest parse() throws ConfigurationException { String frameworkVersion = getRequiredAttribute(ATT_FRAMEWORK_VERSION); String bundleName = getRequiredAttribute(ATT_BUNDLE_NAME); String bundleVersion = getRequiredAttribute(ATT_BUNDLE_VERSION); if (FrameworkUtil.getFrameworkVersion().compareTo(Version.parse(frameworkVersion)) < 0) { String message = "Bundle " + fileName + " requests an unrecognized " + "framework version " + frameworkVersion + " but available is " + FrameworkUtil.getFrameworkVersion().getVersion(); throw new ConfigurationException(message); } ConnectorBundleManifest rv = new ConnectorBundleManifest(); rv.setFrameworkVersion(frameworkVersion); rv.setBundleName(bundleName); rv.setBundleVersion(bundleVersion); return rv; }