Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 181090 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/hyades/logging/adapter/Adapter.java (-12 / +35 lines)
Lines 197-207 Link Here
197
     * @throws AdapterException If an error occurs during execution.
197
     * @throws AdapterException If an error occurs during execution.
198
     */
198
     */
199
    public void start(boolean separateThread, boolean daemon) throws AdapterException {
199
    public void start(boolean separateThread, boolean daemon) throws AdapterException {
200
    	/* bugzilla 181090
201
    	 * Only run the adapter if it is not already running.
202
    	 */
203
    	synchronized(this) {
204
	    	if (status.isActive()) {
205
	    		return;
206
	    	}
207
200
		/* bugzilla 86674
208
		/* bugzilla 86674
201
		 * Set the active status of the Adapter to true here so we include the configuration time
209
		 * Set the active status of the Adapter to true here so we include the configuration time
202
		 */
210
		 */
203
    	status.setActive(true);
211
	    	status.setActive(true);
204
    	
212
    	}
205
    	/* If the controller object already exists and the adapter configuration file has not changed Then
213
    	/* If the controller object already exists and the adapter configuration file has not changed Then
206
    	 * use the current configuration.
214
    	 * use the current configuration.
207
    	 */
215
    	 */
Lines 246-252 Link Here
246
        	/* Run the controller and therefore the adapter in the current thread. */
254
        	/* Run the controller and therefore the adapter in the current thread. */
247
            rootController.run();
255
            rootController.run();
248
            // All contexts have stopped so set the active status to false
256
            // All contexts have stopped so set the active status to false
249
            status.setActive(false);
257
            synchronized(this) {
258
            	status.setActive(false);
259
            }
250
        }
260
        }
251
        else {
261
        else {
252
        	/* Run the controller and therefore the adapter in a separate thread */ 
262
        	/* Run the controller and therefore the adapter in a separate thread */ 
Lines 265-271 Link Here
265
        if (rootController != null) {
275
        if (rootController != null) {
266
            rootController.stop();
276
            rootController.stop();
267
        }
277
        }
268
        status.setActive(false);
278
        synchronized(this) {
279
        	status.setActive(false);
280
        }
269
    }
281
    }
270
    
282
    
271
	/**
283
	/**
Lines 276-282 Link Here
276
		if (rootController != null) {
288
		if (rootController != null) {
277
			rootController.hardStop();
289
			rootController.hardStop();
278
		}
290
		}
279
		status.setActive(false);
291
		synchronized(this) {
292
			status.setActive(false);
293
		}
280
	}
294
	}
281
	
295
	
282
	/**
296
	/**
Lines 358-369 Link Here
358
     * @return the org.eclipse.hyades.logging.adapter.IStatus object representing the status.
372
     * @return the org.eclipse.hyades.logging.adapter.IStatus object representing the status.
359
     */
373
     */
360
    public IStatus getStatus() {
374
    public IStatus getStatus() {
361
    	// This method may be called before start() is called so check for null rootController
375
    	synchronized(this) {
362
    	if (rootController != null) {
376
	    	// This method may be called before start() is called so check for null rootController
363
    		status.setChildrenStatus(rootController.getStatus());
377
	    	if (rootController != null) {
364
    	}
378
	    		status.setChildrenStatus(rootController.getStatus());
365
    	else {
379
	    	}
366
    		status.setActive(false);
380
	    	else {
381
	    		status.setActive(false);
382
	    	}
367
    	}
383
    	}
368
    	return status;
384
    	return status;
369
    }
385
    }
Lines 376-382 Link Here
376
     * @param outputter component where GLA will log its messages.
392
     * @param outputter component where GLA will log its messages.
377
     */
393
     */
378
    public void setLogOutputter(IOutputter outputter) {
394
    public void setLogOutputter(IOutputter outputter) {
379
    	logOutputter = outputter;
395
    	/* bugzilla 181090
396
    	 * Only set the log outputter if the adapter is not already running.
397
    	 */
398
    	synchronized(this) {
399
	    	if (!status.isActive()) {
400
	    		logOutputter = outputter;
401
	    	}
402
    	}
380
    }
403
    }
381
    
404
    
382
    /**
405
    /**

Return to bug 181090