internal Bundle[] getUsingBundles(ServiceReferenceImpl serviceReferenceImpl) { if (usingServiceBundleDict.ContainsKey(serviceReferenceImpl)) { IList <Bundle> usingBundleList = usingServiceBundleDict[serviceReferenceImpl]; Bundle[] usingBundles = new Bundle[usingBundleList.Count]; usingBundleList.CopyTo(usingBundles, 0); return(usingBundles); } else { return(new Bundle[0]); } }
internal object getService(ServiceReference reference, Bundle bundle) { ServiceReferenceImpl sri = reference as ServiceReferenceImpl; if (sri == null) { return(null); } IList <Bundle> usingBundleList = null; if (usingServiceBundleDict.ContainsKey(reference)) { usingBundleList = usingServiceBundleDict[reference]; } else { usingBundleList = new List <Bundle>(); } usingBundleList.Add(bundle); return(sri.getService()); }
internal ServiceRegistration registerService(BundleContext bundleContext, string[] clazzes, object service, IDictionary <string, object> properties) { BundleContextImpl bundleContextImpl = bundleContext as BundleContextImpl; ServiceReferenceImpl reference = new ServiceReferenceImpl(bundleContextImpl, clazzes, properties, service); foreach (String clazz in clazzes) { IList <ServiceReference> serviceReferenceList = null; if (serviceReferenceDictionary.ContainsKey(clazz)) { serviceReferenceList = serviceReferenceDictionary[clazz]; } else { serviceReferenceList = new List <ServiceReference>(); serviceReferenceDictionary.Add(clazz, serviceReferenceList); } serviceReferenceList.Add(reference); } fireServiceEvent(new ServiceEvent(ServiceEvent.REGISTERED, reference)); return(new ServiceRegistrationImpl(this, bundleContextImpl, reference)); }