Author: cwiklik Date: Fri Jan 6 22:53:02 2012 New Revision: 1228483 URL: http://svn.apache.org/viewvc?rev=1228483&view=rev Log: UIMA-2317 instantiate getMetaSemaphore with 0 permits
Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=1228483&r1=1228482&r2=1228483&view=diff ============================================================================== --- uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java (original) +++ uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java Fri Jan 6 22:53:02 2012 @@ -191,7 +191,7 @@ public abstract class BaseUIMAAsynchrono protected Semaphore cpcSemaphore = new Semaphore(1); // Create Semaphore that will signal when GetMeta reply has been received - protected Semaphore getMetaSemaphore = new Semaphore(1); + protected Semaphore getMetaSemaphore = new Semaphore(0, true); // Signals when the client is ready to send CPC request protected Semaphore cpcReadySemaphore = new Semaphore(1); @@ -748,9 +748,7 @@ public abstract class BaseUIMAAsynchrono getMetaSemaphore.acquire(); } catch (InterruptedException e) { e.printStackTrace(); - } finally { - getMetaSemaphore.release(); - } + } } public String getPerformanceReport() { @@ -1107,8 +1105,8 @@ public abstract class BaseUIMAAsynchrono } @SuppressWarnings("unchecked") private List<AnalysisEnginePerformanceMetrics> deserializePerformanceMetrics(String serializedComponentStats) { - XStream xstream = new XStream(new DomDriver()); - return (List<AnalysisEnginePerformanceMetrics>)xstream.fromXML(serializedComponentStats); + XStream xstream = new XStream(new DomDriver()); + return (List<AnalysisEnginePerformanceMetrics>)xstream.fromXML(serializedComponentStats); } protected void notifyListeners(CAS aCAS, EntityProcessStatus aStatus, int aCommand) { for (int i = 0; listeners != null && i < listeners.size(); i++) { @@ -2708,9 +2706,11 @@ public abstract class BaseUIMAAsynchrono protected SharedConnection lookupConnection(String brokerUrl) { - if ( sharedConnections.containsKey(brokerUrl) ) { - return sharedConnections.get(brokerUrl); - } + if ( brokerUrl != null ) { + if ( sharedConnections.containsKey(brokerUrl) ) { + return sharedConnections.get(brokerUrl); + } + } return null; }