Search in sources :

Example 1 with Preference

use of org.apache.felix.ipojo.extender.internal.queue.pref.Preference in project felix by apache.

the class EnforcedQueueService method checkBundlePreference.

/**
 * Checks the bundle processing preference and compare with the enforced preference.
 *
 * @param callable the callable
 */
private void checkBundlePreference(Callable<?> callable) {
    if (callable instanceof BundleReference) {
        Bundle bundle = ((BundleReference) callable).getBundle();
        Preference preference = m_strategy.select(bundle);
        if (!isCompatible(preference)) {
            // Log a warning, Bundle asked for a synchronous processing,
            // but we will enforce parametrised processing
            String message = String.format("Enforcing %s mode for Bundle %s/%s [%d] (asking for %s)", m_enforced.name(), bundle.getSymbolicName(), bundle.getVersion(), bundle.getBundleId(), preference);
            m_logger.log(Logger.WARNING, message);
        }
    }
}
Also used : Preference(org.apache.felix.ipojo.extender.internal.queue.pref.Preference) Bundle(org.osgi.framework.Bundle) BundleReference(org.osgi.framework.BundleReference)

Aggregations

Preference (org.apache.felix.ipojo.extender.internal.queue.pref.Preference)1 Bundle (org.osgi.framework.Bundle)1 BundleReference (org.osgi.framework.BundleReference)1