Package org.springframework.osgi.util.internal

Examples of org.springframework.osgi.util.internal.MapBasedDictionary


   * @param reference OSGi service reference
   * @return a <code>Dictionary</code> containing the service reference
   * properties taken as a snapshot
   */
  public static Dictionary getServicePropertiesSnapshot(ServiceReference reference) {
    return new MapBasedDictionary(getServicePropertiesSnapshotAsMap(reference));
  }
View Full Code Here


   * @param reference OSGi service reference
   * @return a <code>Dictionary</code> containing the latest service
   * reference properties
   */
  public static Dictionary getServiceProperties(ServiceReference reference) {
    return new MapBasedDictionary(getServicePropertiesAsMap(reference));
  }
View Full Code Here

    Assert.notNull(pid, "persistence id property is required");
    for (Iterator l = listeners.iterator(); l.hasNext();) {
      ConfigListener listener = (ConfigListener) l.next();
      listener.resolve(beanFactory, factory);
    }
    Dictionary props = new MapBasedDictionary();
    props.put(Constants.SERVICE_PID, pid);

    if (factory) {
      registration = bundleContext.registerService(ManagedServiceFactory.class.getName(), new OsgiManagedServiceFactoryUpdater(),
        props);
    }
View Full Code Here

      }
    }

    void updated(String instancePid, Dictionary properties) throws ConfigurationException {
      Method update;
      MapBasedDictionary props = new MapBasedDictionary(properties);
      try {
        update = bean.getClass().getMethod(updateMethod, new Class[] { String.class, Map.class });
      }
      catch (NoSuchMethodException e) {
        try {
View Full Code Here

      }
    }

    void updated(Dictionary properties, String servicePid) throws ConfigurationException {
      Method update;
      MapBasedDictionary props = new MapBasedDictionary(properties);
      try {
        update = bean.getClass().getMethod(updateMethod, new Class[] { Map.class });
      }
      catch (NoSuchMethodException e) {
        try {
View Full Code Here

    // wrap configuration object as the backing properties of the
    // placeholder
    cmProperties = new Properties();
    Dictionary dict = config.getProperties();
    if (dict == null) {
      dict = new MapBasedDictionary();
    }

    // copy dictionary into properties
    for (Enumeration keys = dict.keys(); keys.hasMoreElements();) {
      Object key = keys.nextElement();
View Full Code Here

    }
    return target;
  }

  private Dictionary mergeServiceProperties(String beanName) {
    MapBasedDictionary props = new MapBasedDictionary(propertiesResolver.getServiceProperties(beanName));

    props.putAll((Map) props);

    // add service properties
    if (serviceProperties != null)
      props.putAll(serviceProperties);

    if (ranking != 0) {
      props.put(org.osgi.framework.Constants.SERVICE_RANKING, new Integer(ranking));
    }
    return props;
  }
View Full Code Here

   * publishing is required or not.
   *
   */
  void publishContextAsOsgiServiceIfNecessary() {
    if (publishContextAsService) {
      Dictionary serviceProperties = new MapBasedDictionary();

      customizeApplicationContextServiceProperties((Map) serviceProperties);

      if (logger.isInfoEnabled()) {
        logger.info("Publishing application context as OSGi service with properties " + serviceProperties);
View Full Code Here

   * @param reference OSGi service reference
   * @return a <code>Dictionary</code> containing the service reference
   *         properties taken as a snapshot
   */
  public static Dictionary getServicePropertiesSnapshot(ServiceReference reference) {
    return new MapBasedDictionary(getServicePropertiesSnapshotAsMap(reference));
  }
View Full Code Here

   * @param reference OSGi service reference
   * @return a <code>Dictionary</code> containing the latest service
   *         reference properties
   */
  public static Dictionary getServiceProperties(ServiceReference reference) {
    return new MapBasedDictionary(getServicePropertiesAsMap(reference));
  }
View Full Code Here

TOP

Related Classes of org.springframework.osgi.util.internal.MapBasedDictionary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.