Tabnine Logo
org.jboss.weld.environment.osgi.impl.extension.beans
Code IndexAdd Tabnine to your IDE (free)

How to use org.jboss.weld.environment.osgi.impl.extension.beans

Best Java code snippets using org.jboss.weld.environment.osgi.impl.extension.beans (Showing top 20 results out of 315)

origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public T get() {
  populateServices();
  return service;
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public <T> Service<T> getServiceReference() {
  return new ServiceImpl<T>(contract, registry);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public boolean isAmbiguous() {
  return (size() > 1);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Produces
public <T> Registration<T> getRegistrations(BundleHolder bundleHolder,
                      RegistrationHolder holder,
                      InjectionPoint p) {
  logger.trace("Entering OSGiUtilitiesProducer : getRegistrations() "
      + "with parameters {} | {} | {}",
         new Object[] {bundleHolder,holder,p});
  Class<T> contract = ((Class<T>) ((ParameterizedType) p.getType()).getActualTypeArguments()[0]);
  Registration<T> result = new RegistrationImpl<T>(contract,
                           bundleHolder.getContext(),
                           bundleHolder.getBundle(),
                           holder);
  logger.debug("Returning the registrations {}", result);
  return result;
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public <T, U extends T> Registration<T> registerService(Class<T> contract,
                            U implementation) {
  ServiceRegistration reg = registry.registerService(contract.getName(),
                            implementation,
                            null);
  holder.addRegistration(reg);
  return new RegistrationImpl<T>(contract, registry, bundle, holder);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Produces
public BundleContext getBundleContext(BundleHolder holder, InjectionPoint p) {
  logger.trace("Entering OSGiUtilitiesProducer : getBundleContext() "
      + "with parameters {} | {}",
         new Object[] {holder,p});
  logger.debug("Returning the current bundle {} bundle context {}",
         holder.getBundle(),
         holder.getContext());
  return holder.getContext();
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public Registration<T> select(String filter) {
  Filter osgiFilter = null;
  try {
    osgiFilter = FrameworkUtil.createFilter(filter);
  }
  catch(InvalidSyntaxException e) {
    throw new IllegalArgumentException("Invalid LDAP filter : "
                      + e.getMessage());
  }
  RegistrationHolder holder = new RegistrationsHolderImpl();
  for (ServiceRegistration registration : holder.getRegistrations()) {
    if (osgiFilter.match(registration.getReference())) {
      holder.addRegistration(registration);
    }
  }
  return new RegistrationImpl<T>(contract, registry, bundle, holder);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

public void bind(@Observes ServiceEvents.ServiceArrival arrival) {
  checkForValidDependencies(arrival);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public Iterator<Registration<T>> iterator() {
  populate();
  return registrations.iterator();
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

public <T> void registerNewType(Class<T> type) {
  if (!types.containsKey(type)) {
    types.put(type, new Beantype<T>(type, manager));
  }
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@PreDestroy
public void stop() {
  for (Beantype<?> type : types.values()) {
    type.destroy();
  }
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Produces
public Bundle getBundle(BundleHolder holder, InjectionPoint p) {
  logger.trace("Entering OSGiUtilitiesProducer : getBundle() "
         + "with parameters {} | {}",
         new Object[] {holder,p});
  logger.debug("Returning the current bundle {}", holder.getBundle());
  return holder.getBundle();
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public <T> Registration<T> registerService(Class<T> contract,
                      Class<? extends T> implementation) {
  ServiceRegistration reg = registry.registerService(contract.getName(),
                            instances.select(implementation).get(),
                            null);
  holder.addRegistration(reg);
  return new RegistrationImpl<T>(contract, registry, bundle, holder);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

public void changed(@Observes ServiceEvents.ServiceChanged changed) {
  checkForValidDependencies(changed);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public int size() {
  if (service == null) {
    try {
      populateServices();
    }
    catch(Exception e) {
      e.printStackTrace();
      return -1;
    }
  }
  return services.size();
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public <T> Service<T> getServiceReferences(Class<T> contract) {
  return new ServiceImpl<T>(contract, registry);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public boolean isUnsatisfied() {
  return (size() <= 0);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

public void unbind(@Observes ServiceEvents.ServiceDeparture departure) {
  checkForValidDependencies(departure);
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

@Override
public Iterator<T> iterator() {
  try {
    populateServices();
  }
  catch(Exception ex) {
    ex.printStackTrace();
    services = Collections.emptyList();
  }
  return services.iterator();
}
origin: org.jboss.weld.osgi/weld-osgi-core-extension

public void listenStartup(@Observes BundleContainerEvents.BundleContainerInitialized event) {
  osgiServiceDependencies = extension.getRequiredOsgiServiceDependencies();
  checkForValidDependencies(null);
}
org.jboss.weld.environment.osgi.impl.extension.beans

Most used classes

  • BundleHolder
    This the reference to the current bundle used by Weld-OSGi. It wraps the OSGi Bundle. It is aware of
  • RegistrationsHolderImpl
    Implementation of RegistrationHolder.
  • ContainerObserver
    Store Weld containers of all bean bundle. Broadcast InterBundleEventfrom current bean bundle to othe
  • DynamicServiceHandler
    Handler for proxy used by OSGiServiceBean. Dynamicaly lookup for a matching OSGi service at method c
  • OSGiUtilitiesProducer
    This the class responsible for OSGi utility injection for the current bundle.
  • ServiceImpl,
  • ServiceReferenceHandler,
  • ServiceRegistryImpl$Beantype,
  • ServiceRegistryImpl
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