Пример #1
0
 public ServiceRegistry(Core.Framework framework)
 {
     this.framework             = framework;
     serviceid                  = 1;
     publishedServicesByClass   = new Hashtable(initialCapacity);
     publishedServicesByContext = new Hashtable(initialCapacity);
     allPublishedServices       = new ArrayList(initialCapacity);
     serviceEventListeners      = new Hashtable(initialCapacity);
 }
Пример #2
0
        internal ServiceRegistrationImpl(ServiceRegistry registry, BundleContextImpl context, String[] clazzes, Object service)
        {
            this.registry      = registry;
            this.context       = context;
            this.bundle        = context.GetBundleImpl();
            this.framework     = context.Framework;
            this.clazzes       = clazzes;                     /* must be set before calling createProperties. */
            this.service       = service;
            this.serviceid     = registry.GetNextServiceId(); /* must be set before calling createProperties. */
            this.contextsUsing = new ArrayList(10);

            lock (registrationLock)
            {
                this.state = REGISTERED;

                /* We leak this from the constructor here, but it is ok
                 * because the ServiceReferenceImpl constructor only
                 * stores the value in a final field without
                 * otherwise using it.
                 */
                this.reference = new ServiceReferenceImpl(this);
            }
        }