Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 88621 Details for
Bug 181090
Unpredictable results when one GLA instance runs multiple adapters concurrently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated patch
runnMultiple.txt (text/plain), 7.81 KB, created by
Rohit Shetty
on 2008-02-01 14:23:03 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Rohit Shetty
Created:
2008-02-01 14:23:03 EST
Size:
7.81 KB
patch
obsolete
>Index: src/org/eclipse/hyades/logging/adapter/util/properties/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.logging.adapter/src/org/eclipse/hyades/logging/adapter/util/properties/messages.properties,v >retrieving revision 1.6 >diff -u -r1.6 messages.properties >--- src/org/eclipse/hyades/logging/adapter/util/properties/messages.properties 22 Mar 2007 06:03:38 -0000 1.6 >+++ src/org/eclipse/hyades/logging/adapter/util/properties/messages.properties 1 Feb 2008 19:14:26 -0000 >@@ -194,7 +194,8 @@ > HyadesGAValidation_No_GLAHome_WARN_=IWAT0871W GLA_HOME is not provided to the JVM. The adapter configuration will not be validated against the schema. > INVALID_LOG_TYPE_INFO_ = IWAT0812I No log records were parsed. Ensure the log you are parsing is of the expected type. > >- >+HyadesGAAdapter_Already_Running_ERROR_=IWAT0876E This instance of the adapter is already active. Please ensure that you stop the adapter before trying to start it again. >+ > # Message strings: > EXCEPTION = Exception > >Index: src/org/eclipse/hyades/logging/adapter/Adapter.java >=================================================================== >RCS file: /cvsroot/tptp/monitoring/org.eclipse.hyades.logging.adapter/src/org/eclipse/hyades/logging/adapter/Adapter.java,v >retrieving revision 1.15 >diff -u -r1.15 Adapter.java >--- src/org/eclipse/hyades/logging/adapter/Adapter.java 24 Jan 2008 02:25:53 -0000 1.15 >+++ src/org/eclipse/hyades/logging/adapter/Adapter.java 1 Feb 2008 19:14:25 -0000 >@@ -136,9 +136,18 @@ > * Setup the adapter and validate the configuration file. This method > * will not run the adapter and stops after validation. > * @throws AdapterException if the configuration is invalid >+ * @throws AdapterBusy if the adapter is already running > */ >- public void validate() throws AdapterException { >- synchronized(this) { >+ public void validate() throws AdapterBusy, AdapterException { >+ >+ synchronized(this) { >+ >+ /* bugzilla 181090 >+ * Only validate the adapter if it is not already running. >+ */ >+ if (status.isActive()) { >+ throw new AdapterBusy(Messages.getString("HyadesGAAdapter_Already_Running_ERROR_")); >+ } > /* If the controller object already exists and the adapter configuration file has not changed Then > * validate the current configuration. > */ >@@ -194,14 +203,23 @@ > * unless the configuration files were specified with setContextConfigPath and setComponentConfigPath methods. > * @param separateThread Run the adapter in a separate thread > * @param daemon Run the adapter as a daemon thread. >- * @throws AdapterException If an error occurs during execution. >+ * @throws AdapterException if the configuration is invalid >+ * @throws AdapterBusy if the adapter is already running > */ >- public void start(boolean separateThread, boolean daemon) throws AdapterException { >+ public void start(boolean separateThread, boolean daemon) throws AdapterBusy, AdapterException { >+ /* bugzilla 181090 >+ * Only run the adapter if it is not already running. >+ */ >+ synchronized(this) { >+ if (status.isActive()) { >+ throw new AdapterBusy(Messages.getString("HyadesGAAdapter_Already_Running_ERROR_")); >+ } >+ > /* bugzilla 86674 > * Set the active status of the Adapter to true here so we include the configuration time > */ >- status.setActive(true); >- >+ status.setActive(true); >+ } > /* If the controller object already exists and the adapter configuration file has not changed Then > * use the current configuration. > */ >@@ -246,7 +264,9 @@ > /* Run the controller and therefore the adapter in the current thread. */ > rootController.run(); > // All contexts have stopped so set the active status to false >- status.setActive(false); >+ synchronized(this) { >+ status.setActive(false); >+ } > } > else { > /* Run the controller and therefore the adapter in a separate thread */ >@@ -265,7 +285,9 @@ > if (rootController != null) { > rootController.stop(); > } >- status.setActive(false); >+ synchronized(this) { >+ status.setActive(false); >+ } > } > > /** >@@ -276,7 +298,9 @@ > if (rootController != null) { > rootController.hardStop(); > } >- status.setActive(false); >+ synchronized(this) { >+ status.setActive(false); >+ } > } > > /** >@@ -358,12 +382,14 @@ > * @return the org.eclipse.hyades.logging.adapter.IStatus object representing the status. > */ > public IStatus getStatus() { >- // This method may be called before start() is called so check for null rootController >- if (rootController != null) { >- status.setChildrenStatus(rootController.getStatus()); >- } >- else { >- status.setActive(false); >+ synchronized(this) { >+ // This method may be called before start() is called so check for null rootController >+ if (rootController != null) { >+ status.setChildrenStatus(rootController.getStatus()); >+ } >+ else { >+ status.setActive(false); >+ } > } > return status; > } >@@ -376,7 +402,14 @@ > * @param outputter component where GLA will log its messages. > */ > public void setLogOutputter(IOutputter outputter) { >- logOutputter = outputter; >+ /* bugzilla 181090 >+ * Only set the log outputter if the adapter is not already running. >+ */ >+ synchronized(this) { >+ if (!status.isActive()) { >+ logOutputter = outputter; >+ } >+ } > } > > /** >Index: src/org/eclipse/hyades/logging/adapter/AdapterBusy.java >=================================================================== >RCS file: src/org/eclipse/hyades/logging/adapter/AdapterBusy.java >diff -N src/org/eclipse/hyades/logging/adapter/AdapterBusy.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/hyades/logging/adapter/AdapterBusy.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,55 @@ >+package org.eclipse.hyades.logging.adapter; >+/********************************************************************** >+ * Copyright (c) 2008 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: AdapterBusy.java,v 1.6 2008/01/24 02:25:53 rshetty Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+public class AdapterBusy extends AdapterException >+{ >+ /** >+ * serial version UID >+ */ >+ private static final long serialVersionUID = 1L; >+ >+ /** >+ * Constructor for AdapterBusy. >+ */ >+ public AdapterBusy() >+ { >+ super(); >+ } >+ /** >+ * Create an AdapterBusy with the specified message. >+ * @param message >+ */ >+ public AdapterBusy(String message) >+ { >+ super(message); >+ } >+ >+ /** >+ * Create an AdapterBusy with the specified message and cause exception. >+ * @param message >+ * @param cause >+ */ >+ public AdapterBusy(String message, Throwable cause) >+ { >+ super(message,cause); >+ } >+ /** >+ * Create an AdapterBusy with the specified cause exception. >+ * @param cause >+ */ >+ public AdapterBusy(Throwable cause) >+ { >+ super(cause); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 181090
:
87987
| 88621