]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update mod_java to the new module api
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 31 Jul 2008 20:16:44 +0000 (20:16 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 31 Jul 2008 20:16:44 +0000 (20:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9214 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_java/modjava.c

index 05f3b00faefcde160e79af8fde96894ff6d46997..90b492004b04264fa49b906d5af62683f8c62930 100644 (file)
@@ -111,29 +111,6 @@ SWITCH_STANDARD_APP(java_function)
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error attaching thread to Java VM!\n");
 }
 
-
-static switch_application_interface_t java_application_interface = {
-       /*.interface_name */ "java",
-       /*.application_function */ java_function,
-       NULL, NULL, NULL,
-       /* flags */ SAF_NONE,
-       /* should we support no media mode here?  If so, we need to detect the mode, and either disable the media functions or indicate media if/when we need */
-       /*.next */ NULL
-};
-
-static switch_loadable_module_interface_t java_module_interface = {
-       /*.module_name */ modname,
-       /*.endpoint_interface */ NULL,
-       /*.timer_interface */ NULL,
-       /*.dialplan_interface */ NULL,
-       /*.codec_interface */ NULL,
-       /*.application_interface */ &java_application_interface,
-       /*.api_interface */ NULL,
-       /*.file_interface */ NULL,
-       /*.speech_interface */ NULL,
-       /*.directory_interface */ NULL
-};
-
 static switch_status_t load_config(JavaVMOption **javaOptions, int *optionCount)
 {
     switch_xml_t cfg, xml;
@@ -259,9 +236,11 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_java_load)
     switch_status_t status;
     JavaVMOption *options = NULL;
     int optionCount = 0;
+       switch_application_interface_t *app_interface;
+
+       *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+       SWITCH_ADD_APP(app_interface, "java", NULL, NULL, java_function, NULL, SAF_SUPPORT_NOMEDIA);
 
-    /* connect my internal structure to the blank pointer passed to me */
-    *module_interface = &java_module_interface;
     switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Java Framework Loading...\n");
 
     if (javaVM != NULL)