Tabnine Logo
ApplicationContext.getServiceEntry
Code IndexAdd Tabnine to your IDE (free)

How to use
getServiceEntry
method
in
com.b2international.snowowl.core.ApplicationContext

Best Java code snippets using com.b2international.snowowl.core.ApplicationContext.getServiceEntry (Showing top 4 results out of 315)

origin: com.b2international.snowowl/com.b2international.snowowl.core

public <T> T getService(final Class<T> serviceInterface) {
  return getServiceEntry(serviceInterface).implementation;
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

public <T> void removeServiceListener(final Class<T> serviceInterface, final IServiceChangeListener<T> listener) {
  final ServiceRegistryEntry<T> entry = getServiceEntry(serviceInterface);
  entry.listeners.remove(listener);
}
origin: com.b2international.snowowl/com.b2international.snowowl.core

public <T> void addServiceListener(final Class<T> serviceInterface, final IServiceChangeListener<T> listener) {
  final ServiceRegistryEntry<T> entry = getServiceEntry(serviceInterface);
  if (null != entry.implementation) {
    listener.serviceChanged(null, entry.implementation);
  }
  entry.listeners.add(listener);
}

origin: com.b2international.snowowl/com.b2international.snowowl.core

public <T> void registerService(final Class<T> serviceInterface, final T implementation) {
  
  Preconditions.checkNotNull(implementation, "Registering service for " + serviceInterface.getSimpleName() + " is prohibited with unspecified implementation.");
  
  final ServiceRegistryEntry<T> entry = getServiceEntry(serviceInterface);
  final T oldImplementation = entry.implementation;
  entry.implementation = implementation;
  // notify listeners
  for (final Iterator<IServiceChangeListener<T>> ir = new CopyOnWriteArrayList<IServiceChangeListener<T>>(entry.listeners).iterator(); ir.hasNext(); /**/) {
    final IServiceChangeListener<T> listener = ir.next();
    listener.serviceChanged(oldImplementation, implementation);
  }
  
  // dispose old registered implementation
  if (oldImplementation instanceof IDisposableService && !((IDisposableService) oldImplementation).isDisposed()) {
    ((IDisposableService)oldImplementation).dispose();
  }
  
  LOGGER.debug(MessageFormat.format("Registered service {0} for interface {1}.", implementation.getClass().getName(), serviceInterface.getName()));
}

com.b2international.snowowl.coreApplicationContextgetServiceEntry

Popular methods of ApplicationContext

  • getInstance
    Factory method.
  • getServiceForClass
    Returns with the service registered for the class argument key from the shared application context.
  • getService
  • getServiceChecked
    Returns with the service instance associated with the passed in service interface. May throw runtime
  • registerService
  • isServerMode
    Returns true if the application for the current application context is running in server mode. Other
  • <init>
  • addServiceListener
  • checkStrictServices
    Checks the availability of the registered services strictly, which means that null implementations
  • dispose
  • exists
    Returns true if a the service given with it interface is registered to the application context with
  • getServiceInfo
    Initializes the project specific MultiStatus object for generic serviceablility support for the plug
  • exists,
  • getServiceInfo

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • findViewById (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Reference (javax.naming)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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