mirror of https://github.com/Icinga/icinga2.git
Removed miniapp demo application
This commit is contained in:
parent
4f1c10f529
commit
15a5c3d233
|
@ -6,8 +6,7 @@ SUBDIRS = ltdl \
|
||||||
jsonrpc \
|
jsonrpc \
|
||||||
configfilecomponent \
|
configfilecomponent \
|
||||||
configrpccomponent \
|
configrpccomponent \
|
||||||
icinga \
|
icinga
|
||||||
miniapp
|
|
||||||
|
|
||||||
icinga2docdir = ${prefix}/doc/icinga2
|
icinga2docdir = ${prefix}/doc/icinga2
|
||||||
icinga2doc_DATA = \
|
icinga2doc_DATA = \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
dnl Created by Anjuta application wizard.
|
dnl Created by Anjuta application wizard.
|
||||||
|
|
||||||
AC_INIT(icinga2, 0.1)
|
AC_INIT(icinga, 2.0)
|
||||||
|
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
||||||
|
@ -31,6 +31,5 @@ configfilecomponent/Makefile
|
||||||
configrpccomponent/Makefile
|
configrpccomponent/Makefile
|
||||||
icinga/Makefile
|
icinga/Makefile
|
||||||
jsonrpc/Makefile
|
jsonrpc/Makefile
|
||||||
miniapp/Makefile
|
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
## Process this file with automake to produce Makefile.in
|
|
||||||
|
|
||||||
|
|
||||||
bin_PROGRAMS = \
|
|
||||||
miniapp
|
|
||||||
|
|
||||||
miniapp_SOURCES = \
|
|
||||||
miniapp.cpp
|
|
||||||
|
|
||||||
miniapp_CXXFLAGS = -I${top_srcdir}/base \
|
|
||||||
-I${top_srcdir}/jsonrpc
|
|
||||||
|
|
||||||
miniapp_LDFLAGS = $(top_builddir)/base/libbase.a \
|
|
||||||
$(top_builddir)/jsonrpc/libjsonrpc.a -lltdl
|
|
|
@ -1,77 +0,0 @@
|
||||||
#include <cstdio>
|
|
||||||
#include <iostream>
|
|
||||||
#include <i2-base.h>
|
|
||||||
#include <i2-jsonrpc.h>
|
|
||||||
|
|
||||||
using namespace icinga;
|
|
||||||
|
|
||||||
using std::cout;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
namespace icinga
|
|
||||||
{
|
|
||||||
|
|
||||||
class MyApplication : public Application
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
ConfigHive::RefType m_Hive;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef shared_ptr<MyApplication> RefType;
|
|
||||||
typedef weak_ptr<MyApplication> WeakRefType;
|
|
||||||
|
|
||||||
int Main(const vector<string>& args)
|
|
||||||
{
|
|
||||||
LoadComponent("configcomponent");
|
|
||||||
|
|
||||||
m_Hive = new_object<ConfigHive>();
|
|
||||||
|
|
||||||
/*ConfigFileSerializer::RefType cfs = new_object<ConfigFileSerializer>();
|
|
||||||
cfs->SetFilename("test.conf");
|
|
||||||
cfs->Deserialize(m_Hive);
|
|
||||||
|
|
||||||
ConfigObject::RefType netconfig = m_Hive->GetObject("netconfig");
|
|
||||||
|
|
||||||
JsonRpcServer::RefType ts = new_object<JsonRpcServer>();
|
|
||||||
ts->MakeSocket();
|
|
||||||
ts->Bind(netconfig->GetPropertyInteger("port", 7777));
|
|
||||||
ts->Listen();
|
|
||||||
|
|
||||||
ConnectionManager::RefType cm = new_object<ConnectionManager>();
|
|
||||||
cm->RegisterMethod("HelloWorld", bind_weak(&MyApplication::HelloWorld, shared_from_this()));
|
|
||||||
cm->RegisterServer(ts);
|
|
||||||
|
|
||||||
ConfigRpcServiceModule::RefType rsm = new_object<ConfigRpcServiceModule>();
|
|
||||||
rsm->SetHive(m_Hive);
|
|
||||||
rsm->SetConfigSource(true);
|
|
||||||
cm->RegisterServiceModule(rsm);*/
|
|
||||||
|
|
||||||
RunEventLoop();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int HelloWorld(NewMessageEventArgs::RefType nea)
|
|
||||||
{
|
|
||||||
JsonRpcClient::RefType client = static_pointer_cast<JsonRpcClient>(nea->Source);
|
|
||||||
JsonRpcMessage::RefType msg = nea->Message;
|
|
||||||
|
|
||||||
JsonRpcMessage::RefType response = new_object<JsonRpcMessage>();
|
|
||||||
response->SetVersion("2.0");
|
|
||||||
response->SetID(msg->GetID());
|
|
||||||
cJSON *result = response->GetResult();
|
|
||||||
cJSON_AddStringToObject(result, "greeting", "Hello World!");
|
|
||||||
client->SendMessage(response);
|
|
||||||
|
|
||||||
ConfigObject::RefType co = new_object<ConfigObject>();
|
|
||||||
co->SetName("foo");
|
|
||||||
co->SetType("moo");
|
|
||||||
m_Hive->AddObject(co);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
SET_START_CLASS(icinga::MyApplication);
|
|
|
@ -1,89 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>{7CEA8AB1-3327-4644-9D38-B639A8F3341E}</ProjectGuid>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<RootNamespace>icinga</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<LinkIncremental>true</LinkIncremental>
|
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
|
||||||
<IncludePath>$(ProjectDir)\..\base;$(ProjectDir)\..\jsonrpc;$(ProjectDir)\..\config;$(IncludePath)</IncludePath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<LinkIncremental>false</LinkIncremental>
|
|
||||||
<LibraryPath>$(OutDir);$(LibraryPath)</LibraryPath>
|
|
||||||
<IncludePath>$(ProjectDir)\..\base;$(ProjectDir)\..\jsonrpc;$(ProjectDir)\..\config;$(IncludePath)</IncludePath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<Optimization>Disabled</Optimization>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<AdditionalDependencies>base.lib;jsonrpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
<Profile>true</Profile>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<PrecompiledHeader>
|
|
||||||
</PrecompiledHeader>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
|
||||||
<OptimizeReferences>true</OptimizeReferences>
|
|
||||||
<AdditionalDependencies>base.lib;jsonrpc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="miniapp.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
Loading…
Reference in New Issue