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

How to use
OSGIServiceDescriptor
in
org.killbill.billing.osgi.api

Best Java code snippets using org.killbill.billing.osgi.api.OSGIServiceDescriptor (Showing top 11 results out of 315)

origin: killbill/killbill

@Override
public void registerService(final OSGIServiceDescriptor desc, final CatalogPluginApi service) {
  log.info("Registering service='{}'", desc.getRegistrationName());
  pluginsByName.put(desc.getRegistrationName(), service);
}
origin: killbill/killbill

@Override
public void registerService(final OSGIServiceDescriptor desc, final CurrencyPluginApi service) {
  log.info("Registering service='{}'", desc.getRegistrationName());
  pluginsByName.put(desc.getRegistrationName(), service);
}
origin: org.kill-bill.billing/killbill-invoice

@Override
public void registerService(final OSGIServiceDescriptor desc, final InvoicePluginApi service) {
  log.info("Registering service='{}'", desc.getRegistrationName());
  pluginsByName.put(desc.getRegistrationName(), service);
}
origin: org.kill-bill.billing/killbill-osgi

private void registerServiceInternal(final OSGIServiceDescriptor desc) {
  pluginRegistrations.put(desc.getRegistrationName(), desc);
}
origin: org.kill-bill.billing/killbill-catalog

@Override
public void registerService(final OSGIServiceDescriptor desc, final CatalogPluginApi service) {
  log.info("Registering service='{}'", desc.getRegistrationName());
  pluginsByName.put(desc.getRegistrationName(), service);
}
origin: org.kill-bill.billing/killbill-currency

@Override
public void registerService(final OSGIServiceDescriptor desc, final CurrencyPluginApi service) {
  log.info("Registering service='{}'", desc.getRegistrationName());
  pluginsByName.put(desc.getRegistrationName(), service);
}
origin: org.kill-bill.billing/killbill-osgi

private OSGIServiceDescriptor unRegisterServiceInternal(final OSGIServiceDescriptor desc) {
  return pluginRegistrations.remove(desc.getRegistrationName());
}
origin: org.kill-bill.billing/killbill-osgi

private String getPathPrefixFromDescriptor(final OSGIServiceDescriptor desc) {
  return sanitizePathPrefix(desc.getRegistrationName());
}
origin: org.kill-bill.billing/killbill-osgi

@Override
public void unregisterService(final String serviceName) {
  synchronized (this) {
    final OSGIServiceDescriptor desc = pluginRegistrations.get(serviceName);
    if (desc != null) {
      final String pathPrefix = getPathPrefixFromDescriptor(desc);
      if (pathPrefix == null) {
        logger.warn("Skipping unregistration of OSGI servlet for service {} (service info is not specified)", desc.getRegistrationName());
        return;
      }
      logger.info("Unregistering OSGI servlet " + desc.getRegistrationName() + " at path " + pathPrefix);
      synchronized (this) {
        unRegisterServletInternal(pathPrefix);
        unRegisterServiceInternal(desc);
      }
    }
  }
}
origin: org.kill-bill.billing/killbill-osgi

@Override
public void registerService(final OSGIServiceDescriptor desc, final Servlet httpServlet) {
  // Enforce each route to start with /
  final String pathPrefix = getPathPrefixFromDescriptor(desc);
  if (pathPrefix == null) {
    logger.warn("Skipping registration of OSGI servlet for service {} (service info is not specified)", desc.getRegistrationName());
    return;
  }
  logger.info("Registering OSGI servlet at " + pathPrefix);
  synchronized (this) {
    registerServletInternal(pathPrefix, httpServlet);
    registerServiceInternal(desc);
  }
}
origin: org.kill-bill.billing/killbill-osgi

private <T> boolean listenForServiceType(final ServiceReference serviceReference, final int eventType, final Class<T> claz, final OSGIServiceRegistration<T> registration) {
  // Make sure we can retrieve the plugin name
  final String serviceName = (String) serviceReference.getProperty(OSGIPluginProperties.PLUGIN_NAME_PROP);
  if (serviceName == null || !checkSanityPluginRegistrationName(serviceName)) {
    // Quite common for non Killbill bundles
    logger.debug("Ignoring registered OSGI service {} with no {} property", claz.getName(), OSGIPluginProperties.PLUGIN_NAME_PROP);
    return true;
  }
  final Object theServiceObject = context.getService(serviceReference);
  // Is that for us? We look for a subclass here for greater flexibility (e.g. HttpServlet for a Servlet service)
  if (theServiceObject == null || !claz.isAssignableFrom(theServiceObject.getClass())) {
    return false;
  }
  final T theService = (T) theServiceObject;
  final OSGIServiceDescriptor desc = new DefaultOSGIServiceDescriptor(serviceReference.getBundle().getSymbolicName(), serviceName);
  switch (eventType) {
    case ServiceEvent.REGISTERED:
      final T wrappedService = ContextClassLoaderHelper.getWrappedServiceWithCorrectContextClassLoader(theService);
      registration.registerService(desc, wrappedService);
      break;
    case ServiceEvent.UNREGISTERING:
      registration.unregisterService(desc.getRegistrationName());
      break;
    default:
      break;
  }
  return true;
}
org.killbill.billing.osgi.apiOSGIServiceDescriptor

Most used methods

  • getRegistrationName

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Top plugins for WebStorm
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