summaryrefslogtreecommitdiffstats
path: root/src/uscxml/server
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-02 18:42:17 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-02 18:42:17 (GMT)
commitf627a8a8b139a42568f67dc18679d92806e0ff4e (patch)
tree0ef345134ce775c6fca5ec35d2b6eecddbf3450e /src/uscxml/server
parentf19be97dea6fd8da994392d6fa7de5b3f0d9bf3e (diff)
downloaduscxml-f627a8a8b139a42568f67dc18679d92806e0ff4e.zip
uscxml-f627a8a8b139a42568f67dc18679d92806e0ff4e.tar.gz
uscxml-f627a8a8b139a42568f67dc18679d92806e0ff4e.tar.bz2
More bug-fixes for W3C tests
Diffstat (limited to 'src/uscxml/server')
-rw-r--r--src/uscxml/server/InterpreterServlet.cpp18
-rw-r--r--src/uscxml/server/InterpreterServlet.h18
2 files changed, 35 insertions, 1 deletions
diff --git a/src/uscxml/server/InterpreterServlet.cpp b/src/uscxml/server/InterpreterServlet.cpp
index e537275..99b81b2 100644
--- a/src/uscxml/server/InterpreterServlet.cpp
+++ b/src/uscxml/server/InterpreterServlet.cpp
@@ -1,5 +1,6 @@
#include "InterpreterServlet.h"
#include "uscxml/Interpreter.h"
+#include <glog/logging.h>
namespace uscxml {
@@ -17,6 +18,12 @@ InterpreterServlet::InterpreterServlet(Interpreter* interpreter) {
_path = path.str();
}
+boost::shared_ptr<IOProcessorImpl> InterpreterServlet::create(Interpreter* interpreter) {
+ // we instantiate directly in Interpreter
+ boost::shared_ptr<IOProcessorImpl> io = boost::shared_ptr<InterpreterServlet>(new InterpreterServlet(interpreter));
+ return io;
+}
+
void InterpreterServlet::httpRecvRequest(const HTTPServer::Request& req) {
tthread::lock_guard<tthread::recursive_mutex> lock(_mutex);
@@ -31,4 +38,15 @@ void InterpreterServlet::httpRecvRequest(const HTTPServer::Request& req) {
_interpreter->receive(event);
}
+Data InterpreterServlet::getDataModelVariables() {
+ Data data;
+ assert(_url.length() > 0);
+ data.compound["location"] = Data(_url, Data::VERBATIM);
+ return data;
+}
+
+void InterpreterServlet::send(const SendRequest& req) {
+ LOG(ERROR) << "send not supported by http iorprocessor, use the fetch element";
+}
+
} \ No newline at end of file
diff --git a/src/uscxml/server/InterpreterServlet.h b/src/uscxml/server/InterpreterServlet.h
index 72f2f67..18e1d28 100644
--- a/src/uscxml/server/InterpreterServlet.h
+++ b/src/uscxml/server/InterpreterServlet.h
@@ -2,15 +2,30 @@
#define INTERPRETERSERVLET_H_XQLWNMH4
#include "HTTPServer.h"
+#include "uscxml/Factory.h"
namespace uscxml {
class Interpreter;
-class InterpreterServlet : public HTTPServlet {
+class InterpreterServlet : public HTTPServlet, public IOProcessorImpl {
public:
+ InterpreterServlet() {};
InterpreterServlet(Interpreter* interpreter);
virtual ~InterpreterServlet() {}
+
+ virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+
+ virtual std::set<std::string> getNames() {
+ std::set<std::string> names;
+ names.insert("http");
+ names.insert("http://www.w3.org/TR/scxml/#HTTPEventProcessor");
+ return names;
+ }
+
+ Data getDataModelVariables();
+ virtual void send(const SendRequest& req);
+
virtual void httpRecvRequest(const HTTPServer::Request& req);
std::string getPath() {
@@ -26,6 +41,7 @@ public:
return false;
}
+
std::map<std::string, HTTPServer::Request>& getRequests() {
return _requests;
}