Tabnine Logo
Descriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
Descriptor
in
org.jflux.api.registry

Best Java code snippets using org.jflux.api.registry.Descriptor (Showing top 7 results out of 315)

origin: org.jflux/org.jflux.impl.registry.osgi

/**
 * Converts a descriptor into an OSGi filter string.
 * @param a the descriptor
 * @return an OSGi filter string
 */
public static String getFullFilter(Descriptor a) {
  Set<String> keys = a.getPropertyKeys();
  List<String> conditions = new ArrayList<String>(keys.size());
  for(String key : a.getPropertyKeys()){
    String val = a.getProperty(key);
    String condition = format(key, val);
    conditions.add(condition);
  }
  conditions.add(format(Constants.OBJECTCLASS, a.getClassName()));
  String filter;
  if(conditions.size() > 1) {
    filter = combine(conditions);
  } else if(conditions.size() == 1) {
    filter = conditions.get(0);
  } else {
    filter = null;
  }
  return filter;
}
origin: org.jflux/org.jflux.impl.registry.osgi

/**
 * Creates an OSGi filter string from a descriptor's properties.
 * @param a the descriptor
 * @return an OSGi filter string
 */
public static String getPropertiesFilter(Descriptor a) {
  Set<String> keys = a.getPropertyKeys();
  List<String> conditions = new ArrayList<String>(keys.size());
  for(String key : a.getPropertyKeys()){
    String val = a.getProperty(key);
    String condition = format(key, val);
    conditions.add(condition);
  }
  String filter;
  if(conditions.size() > 1) {
    filter = combine(conditions);
  } else if(conditions.size() == 1) {
    filter = conditions.get(0);
  } else {
    filter = null;
  }
  return filter;
}
/**
origin: org.jflux/org.jflux.impl.registry.osgi

private ServiceReference[] find(Descriptor a) {
  String className = a.getClassName();
  String filter = OSGiRegistryUtil.getPropertiesFilter(a);
  try{
    return myContext.getServiceReferences(className, filter);
  }catch(InvalidSyntaxException ex){
    theLogger.log(Level.SEVERE, "Invalid LDAP filter: " + filter, ex);
    return null;
  }
}

origin: org.jflux/org.jflux.swing.services

  for(String s : sb.getDescriptor().getPropertyKeys()){
    for(String f : myFilters){
      Pattern p = Pattern.compile(
for(ServiceBinding sb: thals.getDependencies().keySet()){
  Descriptor desc = sb.getDescriptor();
  for(String key : desc.getPropertyKeys()){
    for(String f : myFilters){
      String s = desc.getProperty(key);
      Pattern p = Pattern.compile(
          ".*" + f + ".*",
    Properties props = new Properties();
    Descriptor desc = sb.getDescriptor();
    for(String key: desc.getPropertyKeys()){
      props.put(key, desc.getProperty(key));
origin: org.jflux/org.jflux.swing.services

public void updateDisplay(Boolean status){
  updateStatus(status, null);
  if(myDependency == null){
    lblName.setText("--");
    lblFilter.setText("--");
    lblType.setText("--");
    return;
  }
  String name = myDependency.getDependencyName();
  Descriptor desc = myDependency.getDescriptor();
  String type = desc.getClassName();
  Properties props = new Properties();
  
  for(String key: desc.getPropertyKeys()){
    props.put(key, desc.getProperty(key));
  }
  
  String filter = OSGiUtils.createServiceFilter(props);
  
  name = name == null ? "--" : name;
  type = type == null ? "--" : type;
  filter = filter == null ? "--" : filter;
  lblName.setText(name);
  lblFilter.setText(filter);
  lblType.setText(type);
}

origin: org.rwshop/org.rwshop.swing.common

  for(String s : sb.getDescriptor().getPropertyKeys()){
    for(String f : myFilters){
      Pattern p = Pattern.compile(
for(ServiceBinding sb: thals.getDependencies().keySet()){
  Descriptor desc = sb.getDescriptor();
  for(String key : desc.getPropertyKeys()){
    for(String f : myFilters){
      String s = desc.getProperty(key);
      Pattern p = Pattern.compile(
          ".*" + f + ".*",
    Properties props = new Properties();
    Descriptor desc = sb.getDescriptor();
    for(String key: desc.getPropertyKeys()){
      props.put(key, desc.getProperty(key));
origin: org.rwshop/org.rwshop.swing.common

public void updateDisplay(Boolean status){
  updateStatus(status);
  if(myDependency == null){
    lblName.setText("--");
    lblFilter.setText("--");
    lblType.setText("--");
    return;
  }
  String name = myDependency.getDependencyName();
  Descriptor desc = myDependency.getDescriptor();
  String type = desc.getClassName();
  Properties props = new Properties();
  
  for(String key: desc.getPropertyKeys()){
    props.put(key, desc.getProperty(key));
  }
  
  String filter = OSGiUtils.createServiceFilter(props);
  
  name = name == null ? "--" : name;
  type = type == null ? "--" : type;
  filter = filter == null ? "--" : filter;
  lblName.setText(name);
  lblFilter.setText(filter);
  lblType.setText(type);
}

org.jflux.api.registryDescriptor

Javadoc

A Descriptor describes one or more items in the registry. Descriptors are used to retrieve references and filter reference events.

Most used methods

  • getClassName
    Gets the name of the class associated with the descriptor
  • getProperty
    Gets one of the descriptor's properties by name
  • getPropertyKeys
    Gets all of the descriptor's properties

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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