Codota Logo
SynchronizableRegistryImpl
Code IndexAdd Codota to your IDE (free)

How to use
SynchronizableRegistryImpl
in
org.openbase.jul.storage.registry

Best Java code snippets using org.openbase.jul.storage.registry.SynchronizableRegistryImpl (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.openbase.bco/psc.skeleton-merging

@Override
public void init() throws InitializationException, InterruptedException {
  if (!initialized) {
    try {
      registryTransformerRegistry = new SynchronizableRegistryImpl<>();
      registryTransformerRegistry.setName("registryTransformers");
      handleJPArguments();
      rsbConnection.init();
      initialized = true;
    } catch (JPValidationException | JPNotAvailableException | CouldNotPerformException ex) {
      throw new InitializationException(SkeletonMergingController.class, ex);
    }
  }
}
origin: org.openbase.bco/psc.identification

public UnitProbabilityCollection getUnitProbabilities(PointingRay3DFloatDistributionCollection pointingRays) throws CouldNotPerformException {
  UnitProbabilityCollection.Builder collectionBuilder = UnitProbabilityCollection.newBuilder();
  //TODO: Invert this here! first iterate the distributions, then the objects!
  collectionBuilder.addAllElement(selectedObjectRegistry.getEntries().stream()
      .map(
          entry -> pointingRays.getElementList().stream()
              .map(rayDist -> getUnitProbability(entry, rayDist))
              .max((u1, u2) -> Float.compare(u1.getProbability(), u2.getProbability())))
      .filter(u -> u.isPresent() && u.get().getProbability() >= threshold)
      .map(u -> u.get())
      .collect(Collectors.toList()));
  return collectionBuilder.build();
}
origin: org.openbase.bco/psc.identification

public AbstractUnitSelector(double threshold) throws InstantiationException {
  this.threshold = threshold;
  try {
    this.selectedObjectRegistry = new SynchronizableRegistryImpl<>();
  } catch (InstantiationException ex) {
    throw new InstantiationException(this, ex);
  }
}
origin: org.openbase.bco/psc.control

/**
 * {@inheritDoc}
 *
 * @param event {@inheritDoc}
 */
@Override
public void handleEvent(final Event event) {
  LOGGER.trace(event.toString());
  if ((event.getData() instanceof UnitProbabilityCollection)) {
    UnitProbabilityCollection collection = (UnitProbabilityCollection) event.getData();
    collection.getElementList().stream().filter(x -> x.getProbability() >= threshold).forEach(x -> {
      try {
        if (controllableObjectRegistry.contains(x.getId())) {
          try {
            if (controllableObjectRegistry.get(x.getId()).switchPowerState()) {
              LOGGER.info("Switched power state of unit " + controllableObjectRegistry.get(x.getId()).getConfig().getLabel() + " with id " + x.getId());
            } else {
              LOGGER.trace("Did not switch power state of unit " + controllableObjectRegistry.get(x.getId()).getConfig().getLabel() + " with id " + x.getId());
            }
          } catch (CouldNotPerformException ex) {
            ExceptionPrinter.printHistory(ex, LOGGER, LogLevel.ERROR);
          }
        }
      } catch (CouldNotPerformException ex) {
        ExceptionPrinter.printHistory(new CouldNotPerformException("Id of the UnitProbability is not set.", ex), LOGGER, LogLevel.WARN);
      }
    });
  }
}
origin: org.openbase.bco/psc.skeleton-merging

if (scopeIdMap.containsKey(scope)) {
  LOGGER.trace("Using transformation for scope " + scope.toString() + " unit " + scopeIdMap.get(scope));
  currentTransformer = registryTransformerRegistry.get(scopeIdMap.get(scope));
} else {
  LOGGER.trace("Using transformation for scope " + scope.toString() + " from file.");
origin: org.openbase.bco/psc.skeleton-merging

  registryTransformerRegistry.addObserver(this);
} catch (NotAvailableException ex) {
  throw new CouldNotPerformException("Could not connect to the registry.", ex);
origin: org.openbase.bco/psc.control

/**
 * {@inheritDoc}
 *
 * @throws InitializationException {@inheritDoc}
 * @throws InterruptedException {@inheritDoc}
 */
@Override
public void init() throws InitializationException, InterruptedException {
  if (!initialized) {
    try {
      LOGGER.info("Initializing ControlController.");
      controllableObjectRegistry = new SynchronizableRegistryImpl<>();
      registryFlags = JPService.getProperty(JPPscUnitFilterList.class).getValue();
      LOGGER.info("Selected Control Registry flags: " + registryFlags.toString());
      threshold = JPService.getProperty(JPControlThreshold.class).getValue();
      LOGGER.info("Selected Control threshold: " + threshold);
      initializeRegistryConnection();
      rsbConnection = new RSBConnection(this);
      rsbConnection.init();
      initialized = true;
    } catch (JPNotAvailableException | CouldNotPerformException ex) {
      throw new InitializationException(ControlController.class, ex);
    }
  }
}
org.openbase.jul.storage.registrySynchronizableRegistryImpl

Most used methods

  • <init>
  • get
  • addObserver
  • contains
  • getEntries
  • setName

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • JComboBox (javax.swing)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now