/** * Checks whether or not the service reference has the given service object. * @param object the service object, must not be <code>null</code> * @return <code>true</code> if the service reference service object is equal to the given object, <code>false</code> otherwise. */ public boolean isHolding(Object object) { boolean ret = delegate.isHolding(object); return ret; }
/** * Checks whether or not the service reference has the given service object. * @param object the service object, must not be <code>null</code> * @return <code>true</code> if the service reference service object is equal to the given object, <code>false</code> otherwise. */ public boolean isHolding(Object object) { boolean ret = delegate.isHolding(object); return ret; }
public static boolean isHolding(io.vertx.servicediscovery.ServiceReference j_receiver, java.lang.Object object) { return j_receiver.isHolding(io.vertx.core.impl.ConversionHelper.toObject(object)); } }
/** * Release the service object retrieved using {@code get} methods from the service type interface. * It searches for the reference associated with the given object and release it. * * @param discovery the service discovery * @param svcObject the service object */ static void releaseServiceObject(ServiceDiscovery discovery, Object svcObject) { Objects.requireNonNull(discovery); Objects.requireNonNull(svcObject); Object svc = ClassLoaderUtils.extractDelegate(svcObject); if (svc == null) { svc = svcObject; } Collection<ServiceReference> references = discovery.bindings(); Object finalSvc = svc; references.stream().filter(ref -> ref.isHolding(finalSvc)).forEach(ServiceReference::release); } }
/** * Release the service object retrieved using {@code get} methods from the service type interface. * It searches for the reference associated with the given object and release it. * * @param discovery the service discovery * @param svcObject the service object */ static void releaseServiceObject(ServiceDiscovery discovery, Object svcObject) { Objects.requireNonNull(discovery); Objects.requireNonNull(svcObject); Object svc = ClassLoaderUtils.extractDelegate(svcObject); if (svc == null) { svc = svcObject; } Collection<ServiceReference> references = discovery.bindings(); Object finalSvc = svc; references.stream().filter(ref -> ref.isHolding(finalSvc)).forEach(ServiceReference::release); } }