Code example for Hashtable

Methods: put

0
   *  
   * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) 
   */ 
  @Override 
  public void start(BundleContext context) throws Exception {
    Hashtable<String, String> properties = new Hashtable<String, String>();
    properties.put("service.pid", "org.opencastproject.userdirectory.ldap");
    properties.put("service.description", "Provides ldap user directory instances");
    context.registerService(ManagedServiceFactory.class.getName(), new LdapUserProviderFactory(context), properties);
  } 
 
  /** 
   * {@inheritDoc} 
   *  
   * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) 
   */ 
  @Override 
  public void stop(BundleContext context) throws Exception {
    // Nothing to do, the services registered using this context will be unregistered automatically 
  }