summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/java/mod-java.hpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-17 04:14:31 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2010-02-17 04:14:31 +0000
commit00438314438f3dde00b532ac5d8d28ccc35c7096 (patch)
tree80dbbb010c5125455a164c77670b8694231f123f /sca-cpp/trunk/modules/java/mod-java.hpp
parent50063bc212e8e93d014519ef0e4d4cabef0b6be2 (diff)
Working queue and chat components. Added a few useful start/stop scripts. Fixed lifecycle code to call start/stop/restart functions before APR pools are cleaned up in both parent and child processes. Minor build script improvements.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@910819 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/java/mod-java.hpp')
-rw-r--r--sca-cpp/trunk/modules/java/mod-java.hpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/sca-cpp/trunk/modules/java/mod-java.hpp b/sca-cpp/trunk/modules/java/mod-java.hpp
index ccb6d9262b..e7da06e930 100644
--- a/sca-cpp/trunk/modules/java/mod-java.hpp
+++ b/sca-cpp/trunk/modules/java/mod-java.hpp
@@ -34,20 +34,12 @@
#include "value.hpp"
#include "monad.hpp"
#include "eval.hpp"
-#include "../server/mod-eval.hpp"
namespace tuscany {
namespace server {
namespace modjava {
/**
- * Return the Java runtime configured in a server.
- */
-java::JavaRuntime& javaRuntime(modeval::ServerConf sc) {
- return *(java::JavaRuntime*)sc.moduleConf;
-}
-
-/**
* Apply a Java component implementation function.
*/
struct applyImplementation {
@@ -59,11 +51,10 @@ struct applyImplementation {
const value operator()(const list<value>& params) const {
const value expr = append<value>(params, px);
debug(expr, "modeval::java::applyImplementation::input");
- const failable<value> val = java::evalClass(jr, expr, impl);
+ const failable<value> res = java::evalClass(jr, expr, impl);
+ const value val = !hasContent(res)? mklist<value>(value(), reason(res)) : mklist<value>(content(res));
debug(val, "modeval::java::applyImplementation::result");
- if (!hasContent(val))
- return mklist<value>(value(), reason(val));
- return mklist<value>(content(val));
+ return val;
}
};
@@ -71,12 +62,12 @@ struct applyImplementation {
* Evaluate a Java component implementation and convert it to an applicable
* lambda function.
*/
-const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px, modeval::ServerConf& sc) {
+const failable<lambda<value(const list<value>&)> > evalImplementation(const string& path, const value& impl, const list<value>& px, java::JavaRuntime& jr) {
const string cn(attributeValue("class", impl));
- const failable<java::JavaClass> jc = java::readClass(javaRuntime(sc), path, cn);
+ const failable<java::JavaClass> jc = java::readClass(jr, path, cn);
if (!hasContent(jc))
return mkfailure<lambda<value(const list<value>&)> >(reason(jc));
- return lambda<value(const list<value>&)>(applyImplementation(content(jc), px, javaRuntime(sc)));
+ return lambda<value(const list<value>&)>(applyImplementation(content(jc), px, jr));
}
}