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

How to use
AbstractConfigurableController
in
org.openbase.jul.extension.rsb.com

Best Java code snippets using org.openbase.jul.extension.rsb.com.AbstractConfigurableController (Showing top 12 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: org.openbase/jul.extension.rsb.com

this.config = config;
if (supportsDataField(TYPE_FIELD_ID) && hasConfigField(TYPE_FIELD_ID)) {
  setDataField(TYPE_FIELD_ID, getConfigField(TYPE_FIELD_ID));
if (supportsDataField(TYPE_FIELD_LABEL) && hasConfigField(TYPE_FIELD_LABEL)) {
  setDataField(TYPE_FIELD_LABEL, getConfigField(TYPE_FIELD_LABEL));
  if (isActive() && !currentScope.equals(detectScope(config))) {
    currentScope = detectScope();
    super.init(currentScope);
origin: org.openbase/jul.extension.rsb.com

protected final Object getConfigField(String name) throws CouldNotPerformException {
  synchronized (CONFIG_LOCK) {
    return getConfigField(name, getConfig());
  }
}
origin: org.openbase/jul.extension.rsb.com

private Scope detectScope() throws NotAvailableException {
  synchronized (CONFIG_LOCK) {
    return detectScope(getConfig());
  }
}
origin: org.openbase.bco/authentication.lib

@Override
public void init(Scope scope, ParticipantConfig participantConfig) throws InitializationException, InterruptedException {
  super.init(scope, participantConfig);
  try {
    RPCHelper.registerInterface(AuthenticatedRequestable.class, this, server);
  } catch (CouldNotPerformException ex) {
    throw new InitializationException(this, ex);
  }
}
origin: org.openbase/jul.extension.rsb.com

/**
 * Initialize the controller with a configuration.
 *
 * @param config the configuration
 * @throws InitializationException if the initialization fails
 * @throws java.lang.InterruptedException if the initialization is interrupted
 */
@Override
public void init(final CONFIG config) throws InitializationException, InterruptedException {
  synchronized (CONFIG_LOCK) {
    try {
      if (config == null) {
        throw new NotAvailableException("config");
      }
      currentScope = detectScope(config);
      applyConfigUpdate(config);
      super.init(currentScope);
    } catch (CouldNotPerformException ex) {
      throw new InitializationException(this, ex);
    }
  }
}
origin: org.openbase.bco/dal.lib

return super.applyConfigUpdate(config);
origin: org.openbase/jul.extension.rsb.com

private Scope detectScope(final CONFIG config) throws NotAvailableException {
  try {
    return (Scope) getConfigField(FIELD_SCOPE, config);
  } catch (CouldNotPerformException ex) {
    throw new NotAvailableException("scope");
  }
}
origin: org.openbase.bco/dal.lib

public AbstractUnitController(final Class unitClass, final DB builder) throws InstantiationException {
  super(builder);
  this.serviceList = new ArrayList<>();
  this.unitDataObservableMap = new HashMap<>();
  this.serviceTempusServiceTypeObservableMap = new HashMap<>();
  for (final ServiceTempus serviceTempus : ServiceTempus.values()) {
    unitDataObservableMap.put(serviceTempus, new UnitDataFilteredObservable<>(this, serviceTempus));
    super.addDataObserver((Observable<D> source, D data) -> {
      unitDataObservableMap.get(serviceTempus).notifyObservers(data);
    });
    serviceTempusServiceTypeObservableMap.put(serviceTempus, new HashMap<>());
  }
  this.unitRegistryObserver = new Observer<UnitRegistryData>() {
    @Override
    public void update(Observable<UnitRegistryData> source, UnitRegistryData data) throws Exception {
      try {
        final UnitConfig newUnitConfig = Registries.getUnitRegistry(true).getUnitConfigById(getId());
        if (!newUnitConfig.equals(getConfig())) {
          applyConfigUpdate(newUnitConfig);
        }
      } catch (NotAvailableException ex) {
        // unit config has been removed, probably because of deletion and a higher controller will do the shutdown in this case
        logger.debug("Could not update unit controller", ex);
      } catch (CouldNotPerformException ex) {
        ExceptionPrinter.printHistory("Could not update unit config of " + this, ex, logger);
      }
    }
  };
}
origin: org.openbase.bco/dal.lib

@Override
protected void postInit() throws InitializationException, InterruptedException {
  try {
    super.postInit();
    if (!initialized) {
      Registries.getUnitRegistry().addDataObserver(unitRegistryObserver);
      initialized = true;
    }
  } catch (CouldNotPerformException ex) {
    throw new InitializationException(this, ex);
  }
}
origin: org.openbase.bco/dal.lib

@Override
protected void notifyDataUpdate(final D data) throws CouldNotPerformException {
  super.notifyDataUpdate(data);
  for (final ServiceTempus serviceTempus : ServiceTempus.values()) {
    final Set<ServiceType> serviceTypeSet = new HashSet<>();
    for (final ServiceDescription serviceDescription : getUnitTemplate().getServiceDescriptionList()) {
      // check if already handled
      if (!serviceTypeSet.contains(serviceDescription.getType())) {
        serviceTypeSet.add(serviceDescription.getType());
        try {
          Object serviceData = Services.invokeServiceMethod(serviceDescription.getType(), ServicePattern.PROVIDER, serviceTempus, data);
          serviceTempusServiceTypeObservableMap.get(serviceTempus).get(serviceDescription.getType()).notifyObservers(serviceData);
        } catch (CouldNotPerformException ex) {
          logger.debug("Could not notify state update for service[" + serviceDescription.getType() + "] because this service is not supported by this controller.", ex);
        }
      }
    }
  }
}
origin: org.openbase.bco/dal.lib

@Override
public void init(ScopeType.Scope scope) throws InitializationException, InterruptedException {
  try {
    super.init(Registries.getUnitRegistry(true).getUnitConfigByScope(scope));
  } catch (CouldNotPerformException ex) {
    throw new InitializationException(this, ex);
  }
}
origin: org.openbase.bco/dal.lib

@Override
public void init(final UnitConfig config) throws InitializationException, InterruptedException {
  try {
    if (config == null) {
      throw new NotAvailableException("config");
    }
    if (!config.hasId()) {
      throw new NotAvailableException("config.id");
    }
    if (config.getId().isEmpty()) {
      throw new NotAvailableException("Field config.id is empty!");
    }
    if (!config.hasLabel()) {
      throw new NotAvailableException("config.label");
    }
    if (config.getLabel().isEmpty()) {
      throw new NotAvailableException("Field config.label is emty!");
    }
    super.init(config);
  } catch (CouldNotPerformException ex) {
    throw new InitializationException(this, ex);
  }
}
org.openbase.jul.extension.rsb.comAbstractConfigurableController

Most used methods

  • applyConfigUpdate
    Apply an update to the configuration of this controller.
  • init
  • addDataObserver
  • detectScope
  • getConfig
  • getConfigField
  • hasConfigField
  • isActive
  • notifyDataUpdate
  • postInit
  • setDataField
  • shutdown
  • setDataField,
  • shutdown,
  • supportsDataField

Popular in Java

  • Reading from database using SQL prepared statement
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
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