Click here to Skip to main content
15,884,472 members
Articles / Programming Languages / C++

Remote SOF - An OSGI-like modularization framework for C++ supporting distributed software modules

Rate me:
Please Sign up or sign in to vote.
4.58/5 (8 votes)
13 Jul 2009BSD10 min read 31.3K   15  
The article describes the usage of a modularization framework called Remote SOF supporting distributed software modules.
#include "sof/framework/Global.h"
#include "sof/framework/remote/corba/CORBAHelper.h"
#include "sof/framework/remote/corba/RemoteSOFLauncher.h"

#ifdef WIN
#include "sof/instantiation/win/WinDllCreator.h"
#endif

#include "sof/instantiation/NullCreator.h"
#include "sof/util/threading/SingleThreaded.h"

using namespace std;
using namespace sof::framework;
using namespace sof::framework::remote;
using namespace sof::framework::remote::corba;

#ifdef WIN
using namespace sof::instantiation::win;
#endif

int main( int argc, char **argv)
{	
	Logger::LogLevel logLevel = Logger::LogLevel::DEBUG;
	vector<string> args;

	for ( int i=0; i<argc; i++ )
	{
		string arg(argv[i]);
		args.push_back( arg );
		
		if ( arg == "-nolog" )
		{
			logLevel = Logger::LogLevel::NOLOG;
		}
		else if ( arg == "-errorlog" )
		{
			logLevel = Logger::LogLevel::ERROR_;
		}
		else if ( arg == "-debuglog" )
		{
			logLevel = Logger::LogLevel::DEBUG;
		}		
	}

	CORBAHelper corbaHelper( args );
	corbaHelper.start();

	#ifdef WIN
		RemoteSOFLauncher<SingleThreaded,WinDllCreator> launcher( corbaHelper );
	#else
		RemoteSOFLauncher<SingleThreaded,NullCreator> launcher( corbaHelper );
	#endif
	
	launcher.setLogLevel( logLevel );

	BundleConfiguration bundle1( "bundle2", "BundleActivator2" );
	vector<BundleConfiguration> configuration;
	configuration.push_back( bundle1 );

	launcher.start( configuration );

	launcher.startAdministrationBundle();
	
	return 0;    
}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Software Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions