00001 /* mini 00002 * 00003 * This program is distributed under the GNU General Public License, version 2. 00004 * A copy of this license is included with this source. 00005 * 00006 * Copyright 2004-2006, Toni Thomsson <toni@tonjac.org> 00007 */ 00008 00015 #ifndef zz_nt_webservice_h 00016 #define zz_nt_webservice_h 00017 00018 #include <zz_nt_service.h> 00019 #include <zz_access_log.h> 00020 #include <zz_mini_webserver.h> 00021 #include <zz_web_config.h> 00022 #include <zz_db_pool.h> 00023 #include <zz_session_handler.h> 00024 #include <jni.h> 00025 00026 #define WEB_SVC_NAME "Mini application server" 00027 #define WEB_SVC_DESCRIPTION "tonjac.org Mini application server" 00028 00029 typedef jint (JNICALL *JNICREATEPROC)(JavaVM **, void **, void *); 00030 typedef jint (JNICALL *JNIDESTROYPROC)(JavaVM *); 00031 00032 class CzzNtWebService : public CzzNTService 00033 { 00034 public: 00035 00036 //* Construction 00037 CzzNtWebService( const CzzString& home ); 00038 CzzNtWebService( const CzzString& home, const CzzString& name, const CzzString& descr ); 00039 virtual ~CzzNtWebService(); 00040 00041 // When service starts 00042 virtual void OnStart( int argc, char** argv ); 00043 virtual void OnStop( void ); 00044 00045 static CzzString m_Home; 00046 00047 static int start( int argc, char** argv ); 00048 static int start( int argc, char** argv, const char* name, const char* descr ); 00049 00050 static CzzDbPool* getPool( void ); 00051 static CzzSessionHandler* getSessionHandler( void ); 00052 00053 protected: 00054 private: 00055 00056 void StartJobs( void ); 00057 00058 CzzMiniWebserver* m_Server; 00059 CzzAccessLog* m_AccessLog; 00060 CzzWebConfig* m_Config; 00061 static CzzDbPool* m_Pool; 00062 static CzzSessionHandler* m_SessionHandler; 00063 00064 void updateRegistry( void ); 00065 00066 HINSTANCE m_JvmDll; 00067 JavaVM* m_JvmInstance; 00068 JNIEnv* m_JvmEnv; 00069 }; 00070 00071 #endif // zz_nt_webservice_h
1.4.6-NO