diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.esb.camel/META-INF/MANIFEST.MF
index 0b39eb70af..e80009c742 100644
--- a/edexOsgi/com.raytheon.uf.edex.esb.camel/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/META-INF/MANIFEST.MF
@@ -14,7 +14,8 @@ Require-Bundle: org.apache.camel;bundle-version="1.0.0",
com.raytheon.uf.common.util,
com.raytheon.uf.edex.core,
org.apache.commons.logging,
- com.raytheon.uf.common.stats;bundle-version="1.0.0"
+ com.raytheon.uf.common.stats;bundle-version="1.0.0",
+ org.quartz;bundle-version="1.8.6"
Export-Package: com.raytheon.uf.edex.esb.camel,
com.raytheon.uf.edex.esb.camel.directvm
Import-Package: com.raytheon.uf.common.event,
diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/FileChangedExclusiveReadLockStrategy.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/FileChangedExclusiveReadLockStrategy.java
index 4ba09570a7..80e3614322 100644
--- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/FileChangedExclusiveReadLockStrategy.java
+++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/FileChangedExclusiveReadLockStrategy.java
@@ -30,14 +30,24 @@ import org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy;
import org.apache.camel.component.file.GenericFileOperations;
/**
- * TODO Add Description
+ * Two step file scan strategy to ensure files aren't accepted for processing
+ * while they are still being written. First time a file is found its modify
+ * time is checked. If the modify time is older than 1 minute (such as system
+ * restart scenario) the file is immediately accepted. If the file has been
+ * modified recently the time is recorded and the file is not processed at this
+ * time. In, general this requires a file to be checked twice making its minimum
+ * latency at least 1 full scan period before being processed.
+ *
+ * This class is not thread safe. A separate instance of this strategy should be
+ * created for each directory.
*
*
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Sep 2, 2010 rjpeter Initial creation
+ * Sep 2, 2010 rjpeter Initial creation
+ * May 9, 2013 1989 njensen Camel 2.11 compatibility
*
*
*
@@ -82,6 +92,10 @@ public class FileChangedExclusiveReadLockStrategy implements
}
}
+ if (rval) {
+ modifyTimeMap.remove(file.getAbsoluteFilePath());
+ }
+
return rval;
}
@@ -111,7 +125,6 @@ public class FileChangedExclusiveReadLockStrategy implements
public void releaseExclusiveReadLock(
GenericFileOperations operations, GenericFile file,
Exchange exchange) throws Exception {
- modifyTimeMap.remove(file.getAbsoluteFilePath());
}
/*
@@ -124,4 +137,8 @@ public class FileChangedExclusiveReadLockStrategy implements
@Override
public void setTimeout(long timeout) {
}
+
+ @Override
+ public void setCheckInterval(long checkInterval) {
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java
index 72c1f255e6..dfdfce69b7 100644
--- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java
+++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java
@@ -27,9 +27,8 @@ import java.util.Enumeration;
import java.util.List;
import org.apache.camel.CamelContext;
-import org.apache.camel.Consumer;
import org.apache.camel.Route;
-import org.apache.camel.impl.ServiceSupport;
+import org.apache.camel.ServiceStatus;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@@ -50,13 +49,16 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask;
* ------------ ---------- ----------- --------------------------
* Nov 10, 2010 5050 rjpeter Initial creation
* Jul 16, 2012 DR 15073 D. Friedman Stop consumers instead of whole context
+ * May 14, 2013 1989 njensen Camel 2.11 compatibility
*
*
* @author rjpeter
* @version 1.0
*/
public class ClusteredContextManager {
- private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ClusteredContextManager.class);
+ private static final transient IUFStatusHandler statusHandler = UFStatus
+ .getHandler(ClusteredContextManager.class);
+
private static final String taskName = "ClusteredContext";
private String myName;
@@ -132,43 +134,41 @@ public class ClusteredContextManager {
ClusterLockUtils.updateLockTime(taskName, contextName,
System.currentTimeMillis());
- if (! camelContext.getStatus().isStarted())
- camelContext.start();
- else
- for (Route route: camelContext.getRoutes()) {
- Consumer consumer = route.getConsumer();
- /*
- * It is safe to call Consumer.start/.stop
- * unconditionally (assuming the component is
- * written correctly), but in order to provide
- * useful logging of these events, we must perform a
- * status check.
- */
- if (consumer instanceof ServiceSupport) {
- if (! ((ServiceSupport) consumer).getStatus().isStarted()) {
- statusHandler.handle(Priority.INFO,
- "Starting consumer for route " + route.getId());
- consumer.start();
- }
- } else
- consumer.start();
+ for (Route route : camelContext.getRoutes()) {
+ String routeId = route.getId();
+ ServiceStatus status = camelContext
+ .getRouteStatus(routeId);
+ if (status == ServiceStatus.Stopped
+ || status == ServiceStatus.Stopping) {
+ camelContext.startRoute(routeId);
+ } else if (status == ServiceStatus.Suspended
+ || status == ServiceStatus.Suspending) {
+ camelContext.resumeRoute(routeId);
}
+ }
} else {
- for (Route route: camelContext.getRoutes()) {
- Consumer consumer = route.getConsumer();
- if (consumer instanceof ServiceSupport) {
- if (((ServiceSupport) consumer).getStatus().isStarted()) {
- statusHandler.handle(Priority.INFO,
- "Stopping consumer for route " + route.getId());
- consumer.stop();
- }
- } else
- consumer.stop();
+ for (Route route : camelContext.getRoutes()) {
+ String routeId = route.getId();
+ ServiceStatus status = camelContext
+ .getRouteStatus(routeId);
+ if (status == ServiceStatus.Started
+ || status == ServiceStatus.Starting) {
+ // CamelContext API says to use suspend, not stop
+ camelContext.suspendRoute(routeId);
+ }
}
}
} catch (Exception e) {
- statusHandler.handle(Priority.ERROR,
- "Failed to start/stop route", e);
+ StringBuilder msg = new StringBuilder();
+ msg.append("Failed to ");
+ if (activateRoute) {
+ msg.append("start ");
+ } else {
+ msg.append("suspend ");
+ }
+ msg.append("context ");
+ msg.append(camelContext.getName());
+ statusHandler.handle(Priority.ERROR, msg.toString(), e);
}
}
}
diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java
index 3db10c0d37..4a8e4dd72b 100644
--- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java
+++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ContextManager.java
@@ -40,13 +40,16 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 10, 2010 5050 rjpeter Initial creation
+ * May 13, 2013 1989 njensen Camel 2.11 compatibility
*
*
* @author rjpeter
* @version 1.0
*/
public class ContextManager {
- private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(ContextManager.class);
+ private static final transient IUFStatusHandler statusHandler = UFStatus
+ .getHandler(ContextManager.class);
+
private List contextList = new ArrayList();
private static ContextManager instance = new ContextManager();
@@ -59,14 +62,29 @@ public class ContextManager {
}
public void startContexts() {
+ statusHandler.info("Context Manager starting routes");
for (CamelContext camelContext : contextList) {
try {
- if (camelContext.getStatus().isStopped()) {
+ /*
+ * In camel 2.11, all contexts are "started" automatically but
+ * the isAutoStartup() flag determines if the routes are
+ * automatically started. The code in DefaultCamelContext is
+ * safe to call start() on a second time to get the routes
+ * started.
+ *
+ * For more information, see:
+ * http://camel.465427.n5.nabble.com/Camel
+ * -context-autostartup-td5721638.html
+ *
+ * https://issues.apache.org/jira/browse/CAMEL-5759
+ */
+ if (!camelContext.isAutoStartup()) {
camelContext.start();
}
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
- "Failed to start route", e);
+ "Failed to start routes for " + camelContext.getName(),
+ e);
}
}
}
diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/directvm/DirectVMEndpoint.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/directvm/DirectVMEndpoint.java
index a0822449b3..9bdbad2eab 100644
--- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/directvm/DirectVMEndpoint.java
+++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/directvm/DirectVMEndpoint.java
@@ -37,6 +37,7 @@ import org.apache.camel.impl.DefaultConsumer;
* ------------ ---------- ----------- --------------------------
* Nov 18, 2008 chammack Initial creation
* Jul 16, 2012 DR 15073 D. Friedman Override correct methods
+ * May 09, 2013 1989 njensen Camel 2.11 compatibility
*
*
*
@@ -59,10 +60,6 @@ public class DirectVMEndpoint extends DirectEndpoint {
this.consumers = consumers;
}
- public DirectVMEndpoint(String endpointUri) {
- super(endpointUri);
- }
-
@Override
public Producer createProducer() throws Exception {
return new DirectVMProducer(this);
diff --git a/edexOsgi/com.raytheon.uf.edex.event/src/com/raytheon/uf/edex/event/EdexEventBusHandler.java b/edexOsgi/com.raytheon.uf.edex.event/src/com/raytheon/uf/edex/event/EdexEventBusHandler.java
index 330e60a2ca..db2e593500 100644
--- a/edexOsgi/com.raytheon.uf.edex.event/src/com/raytheon/uf/edex/event/EdexEventBusHandler.java
+++ b/edexOsgi/com.raytheon.uf.edex.event/src/com/raytheon/uf/edex/event/EdexEventBusHandler.java
@@ -41,8 +41,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Feb 5, 2013 1580 mpduff Initial creation.
+ * Feb 5, 2013 1580 mpduff Initial creation.
* 3/18/2013 1802 bphillip Modified to use transaction synchronization
+ * May 9, 2013 1989 njensen Spring 3.1.4 compatibility
*
*
*
@@ -98,8 +99,10 @@ public class EdexEventBusHandler implements IEventBusHandler,
}
eventStorageList.get().add(event);
} else {
- statusHandler
- .info("Sending event from non-transactional operation");
+ if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
+ statusHandler
+ .debug("Sending event from non-transactional operation");
+ }
this.googleEventBus.post(event);
}
}
@@ -158,4 +161,8 @@ public class EdexEventBusHandler implements IEventBusHandler,
}
list.clear();
}
+
+ @Override
+ public void flush() {
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-plugin.xml b/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-plugin.xml
index 7c9393b671..ffe95bb0a7 100644
--- a/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-plugin.xml
+++ b/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-plugin.xml
@@ -27,7 +27,7 @@
+ errorHandlerRef="errorHandler" autoStartup="false">
diff --git a/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-spring.xml b/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-spring.xml
index 60f670499b..ea5ee261ee 100644
--- a/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-spring.xml
+++ b/edexOsgi/com.raytheon.uf.edex.metartohmdbsrv/res/spring/metartohmdb-spring.xml
@@ -1,7 +1,6 @@
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml
index 95510ae456..9a5ad1baab 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/res/spring/manualIngest-spring.xml
@@ -1,7 +1,6 @@
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-constants.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-constants.xml
index a5cd570d06..1ee92c89fe 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-constants.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-constants.xml
@@ -6,7 +6,7 @@
http://www.springframework.org/schema/tx/spring-tx.xsd">
-
+
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webserver.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webserver.xml
index d1b1f11c06..dc363b4198 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webserver.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webserver.xml
@@ -9,9 +9,8 @@
init-method="start" destroy-method="stop">
-
-
-
+
+
diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/util/IdftParser.java b/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/util/IdftParser.java
index 9da363bf27..56b9d13ee6 100644
--- a/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/util/IdftParser.java
+++ b/ncep/gov.noaa.nws.ncep.edex.plugin.idft/src/gov/noaa/nws/ncep/edex/plugin/idft/util/IdftParser.java
@@ -55,8 +55,7 @@ public class IdftParser {
File baseDir = null;
String stnsFileName = null;
baseContext = manager.getContext(EDEX_STATIC, LocalizationLevel.BASE);
- baseContext.setContextName(NCEP_DIR);
- baseDir = manager.getFile(baseContext, "");
+ baseDir = manager.getFile(baseContext, NCEP_DIR);
stnsFileName = baseDir + File.separator + stnsDir + File.separator
+ idftLocTableName;
StationTable myloc = new StationTable(stnsFileName);