service = null;
state = UNREGISTERING;
	public void unregister() {		synchronized (registrationLock) {			if (service == null) /* in the process of unregisterING */			{				throw new IllegalStateException(Msg.SERVICE_ALREADY_UNREGISTERED_EXCEPTION); //$NON-NLS-1$			}			/* remove this object from the service registry */			if (Debug.DEBUG && Debug.DEBUG_SERVICES) {				Debug.println("unregisterService[" + bundle + "](" + this + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$			}			synchronized (framework.serviceRegistry) {				framework.serviceRegistry.unpublishService(context, this);			}			service = null; /* mark unregisterING */		}		/* must not hold the registrationLock when this event is published */		framework.publishServiceEvent(ServiceEvent.UNREGISTERING, reference);		/* we have published the ServiceEvent, now mark the service fully unregistered */		unregistered = true;		int size = 0;		BundleContextImpl[] users = null;		synchronized (registrationLock) {			if (contextsUsing != null) {				size = contextsUsing.size();				if (size > 0) {					if (Debug.DEBUG && Debug.DEBUG_SERVICES) {						Debug.println("unregisterService: releasing users"); //$NON-NLS-1$					}					users = (BundleContextImpl[]) contextsUsing.toArray(new BundleContextImpl[size]);				}			}		}		/* must not hold the registrationLock while releasing services */		for (int i = 0; i < size; i++) {			releaseService(users[i]);		}		contextsUsing = null;		reference = null; /* mark registration dead */		context = null;		/* These fields must be valid after unregister is called:		 *   properties		 */	}