congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OSGiUtilitiesProducer
Code IndexAdd Tabnine to your IDE (free)

How to use
OSGiUtilitiesProducer
in
org.jboss.weld.environment.osgi.impl.extension.beans

Best Java code snippets using org.jboss.weld.environment.osgi.impl.extension.beans.OSGiUtilitiesProducer (Showing top 3 results out of 315)

origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Produces
@BundleHeaders
public Map<String, String> getBundleHeaders(BundleHolder holder,
                      InjectionPoint p) {
  logger.trace("Entering OSGiUtilitiesProducer : getBundleHeaders() "
      + "with parameters {} | {}",
         new Object[] {holder,p});
  Dictionary dict = getBundle(holder, p).getHeaders();
  if (dict == null) {
    logger.warn("Returning null, unable to retrieve the dictionary headers"
          + " for bundle {}", getBundle(holder, p));
    return null;
  }
  Map<String, String> headers = new HashMap<String, String>();
  Enumeration<String> keys = dict.keys();
  while (keys.hasMoreElements()) {
    String key = keys.nextElement();
    headers.put(key, (String) dict.get(key));
  }
  logger.debug("Returning the headers {} "
         + "for bundle {}",
         headers,
         getBundle(holder, p));
  return headers;
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Produces
@BundleDataFile("")
public File getDataFile(BundleHolder holder, InjectionPoint p) {
  logger.trace("Entering OSGiUtilitiesProducer : getDataFile() "
      + "with parameters {} | {}",
         new Object[] {holder,p});
  Set<Annotation> qualifiers = p.getQualifiers();
  BundleDataFile file = null;
  for (Annotation qualifier : qualifiers) {
    if (qualifier.annotationType().equals(BundleDataFile.class)) {
      file = (BundleDataFile) qualifier;
      break;
    }
  }
  if (file.value().equals("")) {
    logger.warn("Returning null,"
          + " the BundleDataFile annotation path was empty");
    return null;
  }
  BundleContext context = getBundleContext(holder, p);
  if (context == null) {
    logger.warn("Returning null, unable to retrieve the BundleContext "
          + "for holder {} and injection point {}", holder, p);
    return null;
  }
  logger.debug("Returning the file {} from bundle context {}",
         file.value(),
         context);
  return context.getDataFile(file.value());
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

  return null;
Dictionary dict = getBundle(holder, p).getHeaders();
if (dict == null) {
  logger.warn("Returning null, unable to retrieve the dictionary headers"
        + " for bundle {}", getBundle(holder, p));
  return null;
       + "for bundle {}",
       header,
       getBundle(holder, p));
return (String) dict.get(header.value());
org.jboss.weld.environment.osgi.impl.extension.beansOSGiUtilitiesProducer

Javadoc

This the class responsible for OSGi utility injection for the current bundle.

Most used methods

  • getBundle
  • getBundleContext

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Notification (javax.management)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now