Click here to Skip to main content
15,886,518 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.
#ifndef CORBA_REGISTRY_OBSERVER_IMPL_H
#define CORBA_REGISTRY_OBSERVER_IMPL_H

#include "sof/framework/IRegistry.h"
#include "sof/util/logging/Logger.h"
#include "sof/util/logging/LoggerFactory.h"

#include "../generated/CORBAObjects.h"

#include "../CORBAHelper.h"

namespace sof { namespace framework { namespace remote { namespace corba { namespace registry {

using namespace std;

using namespace sof::framework;
using namespace sof::util::logging;
using namespace sof::framework::remote::corba::generated;
using namespace sof::framework::remote::corba;

/**
 * Each SOF process activates a CORBA object of implementation type <code>CORBARegistryObserverImpl</code> in order
 * to be informed by the registry process about registered and unregistered services and service listeners.
 *
 * @author magr74
 */
class CORBARegistryObserverImpl : virtual public POA_sof::framework::remote::corba::generated::CORBARegistryObserver
{
	private:
		
		/**
		 * The logger instance.
		 */
		static Logger& logger;
		
		/**
		 * The registry object holding the information of registered services
		 * and service listeners of each SOF process.
		 */
		IRegistry& registry;

		/**
		 * Helper class providing an interface for CORBA related calls.
		 */
		CORBAHelper& corbaHelper;

	public:
		
		/**
		 * Creates instances of class <code>CORBARegistryObserverImpl</code>.
		 *
		 * @param registry
		 *			The registry instance.
		 *
		 * @param corbaHelper
		 *			The CORBA helper class.
		 */
		CORBARegistryObserverImpl( IRegistry& registry, CORBAHelper& corbaHelper );

		/**
		 * Destroys objects of type <code>CORBARegistryObserverImpl</code>.
		 */
		virtual ~CORBARegistryObserverImpl();

		/**
		 * Alive method call.
		 * TODO: remove this call.
		 */
		virtual void ping();

		/**
		 * Registers a service.
		 *
		 * @param bundleName
		 *			The name of the bundle which registers the service.
		 *
		 * @param serviceName
		 *			The name of the registered service instance.
		 *
		 * @param service
		 *			The CORBA service object.
		 *
		 * @param props
		 *			The properties object which describes the service instance.
		 */
		virtual void registerService( const char* bundleName, const char* serviceName, 
			CORBAService_ptr service,
			const CORBAServiceProps& props );

		/**
		 * Registers a service listener.
		 *
		 * @param bundleName
		 *			The name of the bundle which registers the service listener.
		 *
		 * @param serviceName
		 *			The name of the registered service instance the listener listens for.
		 *
		 * @param listener
		 *			The CORBA service listener object.
		 */
		virtual void registerServiceListener( const char* bundleName, const char* serviceName, 
			CORBAServiceListener_ptr listener );

		/**
		 * Unregisters a service.
		 *
		 * @param bundleName
		 *			The name of the bundle which registered the service.
		 *
		 * @param serviceName
		 *			The name of the service instance which is unregistered.
		 *
		 * @param service
		 *			The CORBA service object which is unregistered.
		 *
		 * @param props
		 *			The properties object which describes the service instance.
		 */
		virtual void unregisterService( const char* bundleName, const char* serviceName, 
			CORBAService_ptr service,
			const CORBAServiceProps& props );

		/**
		 * Unregisters a service listener.
		 *
		 * @param bundleName
		 *			The name of the bundle which registered the service listener
		 *
		 * @param serviceName
		 *			The name of the service instance the service listener listens for.
		 *
		 * @param listener
		 *			The CORBA service listener object.
		 */
		virtual void unregisterServiceListener( const char* bundleName, const char* serviceName, 
			CORBAServiceListener_ptr listener );

};

}}}}}
#endif

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