Codota Logo
ServicesConfig.findFactoryById
Code IndexAdd Codota to your IDE (free)

How to use
findFactoryById
method
in
org.granite.config.flex.ServicesConfig

Best Java code snippets using org.granite.config.flex.ServicesConfig.findFactoryById (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.ow2.kerneos.graniteds-osgi/granite-core

@Validate
public void start() {
  log.debug("Start Factory: " + toString());
  if (servicesConfig.findFactoryById(id) == null) {
    servicesConfig.addFactory(this);
    started = true;
  } else {
    log.error("Factory \"" + id + "\" already registered");
  }
}
origin: org.graniteds/granite-server

private static ServiceFactory getServiceFactory(Map<String, Object> cache, GraniteContext context, String factoryId, String key) {
  lock.lock();
  try {
    ServiceFactory factory = (ServiceFactory)cache.get(key);
    if (factory == null) {
      log.debug(">> No cached factory for: %s", factoryId);
      Factory config = ((ServicesConfig)context.getServicesConfig()).findFactoryById(factoryId);
      if (config == null)
        config = getDefaultFactoryConfig();
      try {
        Class<? extends ServiceFactory> clazz = TypeUtil.forName(config.getClassName(), ServiceFactory.class);
        factory = clazz.newInstance();
        factory.configure(config.getProperties());
      } 
      catch (Exception e) {
        throw new ServiceException("Could not instantiate factory: " + factoryId + " of type " + config.getClassName(), e);
      }
      cache.put(key, factory);
    }
    else
      log.debug(">> Found a cached factory for: %s", factoryId);
    log.debug("<< Returning factory: %s", factory);
    return factory;
  } finally {
    lock.unlock();
  }
}
origin: org.graniteds/granite-client

private static ServiceFactory getServiceFactory(Map<String, Object> cache, GraniteContext context, String factoryId, String key) {
  lock.lock();
  try {
    ServiceFactory factory = (ServiceFactory)cache.get(key);
    if (factory == null) {
      log.debug(">> No cached factory for: %s", factoryId);
      Factory config = context.getServicesConfig().findFactoryById(factoryId);
      if (config == null)
        config = getDefaultFactoryConfig();
      try {
        Class<? extends ServiceFactory> clazz = TypeUtil.forName(config.getClassName(), ServiceFactory.class);
        factory = clazz.newInstance();
        factory.configure(config.getProperties());
      } 
      catch (Exception e) {
        throw new ServiceException("Could not instantiate factory: " + factoryId + " of type " + config.getClassName(), e);
      }
      cache.put(key, factory);
    }
    else
      log.debug(">> Found a cached factory for: %s", factoryId);
    log.debug("<< Returning factory: %s", factory);
    return factory;
  } finally {
    lock.unlock();
  }
}
origin: org.graniteds/granite-server

Factory factory = servicesConfig.findFactoryById("tide-" + type + "-factory");
if (factory == null) {
  factory = new Factory("tide-" + type + "-factory", factoryClass.getName(), factoryProperties);
org.granite.config.flexServicesConfigfindFactoryById

Popular methods of ServicesConfig

  • findDestinationById
  • findChannelById
  • <init>
  • addChannel
  • addFactory
  • addService
  • findServiceById
  • forElement
  • handleClass
  • loadConfig
  • scan
  • scanConfig
  • scan,
  • scanConfig,
  • findServiceByDestination,
  • findServicesByMessageType,
  • removeChannel,
  • removeFactory,
  • removeService

Popular in Java

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTextField (javax.swing)
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