ETCL_FilterFactory.cpp

Go to the documentation of this file.
00001 // $Id: ETCL_FilterFactory.cpp 77001 2007-02-12 07:54:49Z johnnyw $
00002 
00003 #include "orbsvcs/Notify/ETCL_FilterFactory.h"
00004 
00005 ACE_RCSID(Notify, TAO_Notify_ETCL_FilterFactory, "$Id: ETCL_FilterFactory.cpp 77001 2007-02-12 07:54:49Z johnnyw $")
00006 
00007 #include "orbsvcs/Notify/ETCL_Filter.h"
00008 
00009 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00010 
00011 TAO_Notify_ETCL_FilterFactory::TAO_Notify_ETCL_FilterFactory (void)
00012 {
00013 }
00014 
00015 TAO_Notify_ETCL_FilterFactory::~TAO_Notify_ETCL_FilterFactory ()
00016 {
00017 }
00018 
00019 CosNotifyFilter::FilterFactory_ptr
00020 TAO_Notify_ETCL_FilterFactory::create (PortableServer::POA_var& filter_poa)
00021 {
00022   this->filter_poa_ = filter_poa; // save the filter poa.
00023 
00024   PortableServer::ServantBase_var servant_var (this);
00025 
00026   return _this ();
00027 }
00028 
00029 CosNotifyFilter::Filter_ptr
00030 TAO_Notify_ETCL_FilterFactory::create_filter (const char *constraint_grammar)
00031 {
00032   // @@: change to "ExTCL" later.
00033   if (ACE_OS::strcmp (constraint_grammar, "TCL") != 0 &&
00034       ACE_OS::strcmp (constraint_grammar, "ETCL") != 0 &&
00035       ACE_OS::strcmp (constraint_grammar, "EXTENDED_TCL") != 0)
00036     throw CosNotifyFilter::InvalidGrammar ();
00037 
00038 
00039   // Create the RefCounted servant.
00040   TAO_Notify_ETCL_Filter* filter = 0;
00041 
00042   ACE_NEW_THROW_EX (filter,
00043                     TAO_Notify_ETCL_Filter (),
00044                     CORBA::NO_MEMORY ());
00045 
00046   PortableServer::ServantBase_var filter_var (filter);
00047 
00048   PortableServer::ObjectId_var oid =
00049     this->filter_poa_->activate_object (filter);
00050 
00051   CORBA::Object_var obj =
00052     this->filter_poa_->id_to_reference (oid.in ());
00053 
00054   return CosNotifyFilter::Filter::_narrow (obj.in ());
00055 }
00056 
00057 CosNotifyFilter::MappingFilter_ptr
00058 TAO_Notify_ETCL_FilterFactory::create_mapping_filter (const char * /*constraint_grammar*/,
00059                                                   const CORBA::Any & /*default_value*/
00060                                                   )
00061 {
00062   throw CORBA::NO_IMPLEMENT ();
00063 }
00064 
00065 TAO_END_VERSIONED_NAMESPACE_DECL
00066 
00067 ACE_FACTORY_DEFINE (TAO_Notify_Serv, TAO_Notify_ETCL_FilterFactory)

Generated on Sun Jan 27 15:39:54 2008 for TAO_CosNotification by doxygen 1.3.6