Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CorbaManager.h

Go to the documentation of this file.
00001 /***************** <Tweek heading BEGIN do not edit this line> ****************
00002  * Tweek
00003  *
00004  * -----------------------------------------------------------------
00005  * File:          $RCSfile: CorbaManager.h,v $
00006  * Date modified: $Date: 2003/02/26 16:01:02 $
00007  * Version:       $Revision: 1.24 $
00008  * -----------------------------------------------------------------
00009  ***************** <Tweek heading END do not edit this line> *****************/
00010 
00011 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00012  *
00013  * VR Juggler is (C) Copyright 1998-2003 by Iowa State University
00014  *
00015  * Original Authors:
00016  *   Allen Bierbaum, Christopher Just,
00017  *   Patrick Hartling, Kevin Meinert,
00018  *   Carolina Cruz-Neira, Albert Baker
00019  *
00020  * This library is free software; you can redistribute it and/or
00021  * modify it under the terms of the GNU Library General Public
00022  * License as published by the Free Software Foundation; either
00023  * version 2 of the License, or (at your option) any later version.
00024  *
00025  * This library is distributed in the hope that it will be useful,
00026  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00027  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00028  * Library General Public License for more details.
00029  *
00030  * You should have received a copy of the GNU Library General Public
00031  * License along with this library; if not, write to the
00032  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00033  * Boston, MA 02111-1307, USA.
00034  *
00035  *************** <auto-copyright.pl END do not edit this line> ***************/
00036 
00037 #ifndef _TWEEK_CORBA_MANAGER_H_
00038 #define _TWEEK_CORBA_MANAGER_H_
00039 
00040 #include <tweek/tweekConfig.h>
00041 
00042 #include <stdlib.h>
00043 #include <string>
00044 #include TWEEK_INCLUDE_CORBA_H
00045 #include <vpr/Thread/Thread.h>
00046 #include <vpr/Util/ReturnStatus.h>
00047 
00048 #include <tweek/CORBA/SubjectManagerImpl.h>
00049 
00050 
00051 namespace tweek
00052 {
00053 
00054 class BeanDeliverySubjectImpl;
00055 
00056 class TWEEK_CLASS_API CorbaManager
00057 {
00058 public:
00062    CorbaManager();
00063 
00074    ~CorbaManager()
00075    {
00076       shutdown();
00077 
00078       if ( mOrbThread != NULL )
00079       {
00080          delete mOrbThread;
00081          mOrbThread = NULL;
00082          delete mOrbFunctor;
00083          mOrbFunctor = NULL;
00084       }
00085    }
00086 
00115    vpr::ReturnStatus init(const std::string& localId, int& argc, char** argv,
00116                           const std::string& nsHost = std::string(""),
00117                           const vpr::Uint16& nsPort = vpr::Uint16(2809),
00118                           const std::string& iiopVersion = std::string("1.0"));
00119 
00130    void shutdown(bool wait_for_completion = true);
00131 
00139    bool isValid() const
00140    {
00141       return ! (CORBA::is_nil(mORB) || CORBA::is_nil(mRootPOA));
00142    }
00143 
00147    vpr::ReturnStatus createSubjectManager();
00148 
00159    vpr::ReturnStatus destroySubjectManager();
00160 
00165    tweek::SubjectManagerImpl* getSubjectManager() const
00166    {
00167       return mSubjectManager;
00168    }
00169 
00170    const PortableServer::POA_var& getRootPOA() const
00171    {
00172       return mRootPOA;
00173    }
00174 
00175    const PortableServer::POA_var& getChildPOA() const
00176    {
00177       return mChildPOA;
00178    }
00179 
00180    BeanDeliverySubjectImpl* getBeanDeliverySubject() const
00181    {
00182       return mBeanDeliverySubject;
00183    }
00184 
00189    void run();
00190 
00191 private:
00192    vpr::ReturnStatus createChildPOA(const std::string& local_id);
00193 
00194    std::string mAppName;
00195 
00196    vpr::ThreadRunFunctor<tweek::CorbaManager>* mOrbFunctor;
00197    vpr::Thread* mOrbThread;
00198 
00199    CORBA::ORB_var mORB;
00200    PortableServer::POA_var mRootPOA;
00201    PortableServer::POA_var mChildPOA;
00202    CosNaming::NamingContext_var mRootContext;
00203    CosNaming::NamingContext_var mLocalContext;
00204 
00205    tweek::SubjectManagerImpl*   mSubjectManager;
00206    PortableServer::ObjectId_var mSubjectManagerId;
00207    CosNaming::Name              mSubjectManagerName;
00208 
00209    BeanDeliverySubjectImpl* mBeanDeliverySubject;
00210 
00212    static const std::string DELIVERY_SUBJECT_NAME;
00213 };
00214 
00215 } // End of tweek namespace
00216 
00217 #endif /* _TWEEK_CORBA_MANAGER_H_ */

Generated on Sun May 2 14:41:03 2004 for Tweek by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002