当前位置: 首页>>代码示例>>Python>>正文


Python ACSCorba.getManager方法代码示例

本文整理汇总了Python中Acspy.Util.ACSCorba.getManager方法的典型用法代码示例。如果您正苦于以下问题:Python ACSCorba.getManager方法的具体用法?Python ACSCorba.getManager怎么用?Python ACSCorba.getManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acspy.Util.ACSCorba的用法示例。


在下文中一共展示了ACSCorba.getManager方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: shutdown

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
    def shutdown(self, action):
        '''
        Shutdown the Container.

        Normally invoked via CORBA but can also "self terminate" so to speak.

        Parameters:
        - action is an encrypted value that tells the container what action to take

        oneway void shutdown (in unsigned long action)
        '''
        action = (action >> 8) & 0xFF

        if (action == ACTIVATOR_EXIT) or (action == ACTIVATOR_REBOOT) or (action == ACTIVATOR_RELOAD):

            self.logger.logTrace("Shutting down container: " + self.name)

            #Logout from manager
            ACSCorba.getManager().logout(self.token.h)

            if (action == ACTIVATOR_REBOOT) or (action == ACTIVATOR_RELOAD):
                print "Container.shutdown(): Action may not work correctly...-", str(action)
                self.__init__(self.name)
            else:
                #tell the main thread of execution to stop
                self.running = 0
                Log.stopPeriodicFlush()
        else:
            self.logger.logWarning("Unable to process 'shutdown' request at this time: " + str(action))
        
        # Close the alarm interface factory
        Acsalarmpy.AlarmSystemInterfaceFactory.done()
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: test_ok

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
 def test_ok(self, getorbmock, nilmock, corbalocmock):
     nilmock.return_value = False
     objmock = mock.Mock(spec=ACSCorba.CORBA.Object)
     orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
     orbmock.string_to_object.return_value = objmock
     getorbmock.return_value = orbmock
     self.assertEqual(False, ACSCorba.getManager() is None)
开发者ID:,项目名称:,代码行数:9,代码来源:

示例3: test_orb_fault

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
    def test_orb_fault(self, getorbmock, corbalocmock):
        def raiser(*args):
            raise Exception("Boom!")

        orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
        orbmock.string_to_object.side_effect = raiser
        getorbmock.return_value = orbmock
        self.assertEqual(True, ACSCorba.getManager() is None)
开发者ID:,项目名称:,代码行数:10,代码来源:

示例4: test_obj_fault

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
    def test_obj_fault(self, getorbmock, nilmock, corbalocmock):
        def raiser(*args):
            raise Exception("Boom!")

        nilmock.return_value = False
        objmock = mock.Mock(spec=ACSCorba.CORBA.Object)
        objmock._non_existent.side_effect = raiser
        orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
        orbmock.string_to_object.return_value = objmock
        getorbmock.return_value = orbmock
        self.assertEqual(True, ACSCorba.getManager() is None)
开发者ID:,项目名称:,代码行数:13,代码来源:

示例5:

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
# MA 02111-1307  USA
#
# @(#) $Id: acspyTestAcsCORBA.py,v 1.1.1.1 2012/03/07 17:41:01 acaproni Exp $
###############################################################################
'''
Tests CORBA access.
'''
from Acspy.Util import ACSCorba
###############################################################################
if __name__ == '__main__':
    print 'Manager corbaloc: %s' % ACSCorba.getManagerCorbaloc()
    print 'ORB: %s' % ACSCorba.getORB()
    print 'POA ROOT: %s' % ACSCorba.getPOARoot()
    print 'POA Manager: %s' % ACSCorba.getPOAManager()
    print 'Manager: %s' % ACSCorba.getManager()
    print 'Client: %s' % ACSCorba.getClient()
    print 'Log: %s' % ACSCorba.log()
    print 'LogFactory: %s' % ACSCorba.logFactory()
    print 'NotifyEventChannelFactory: %s' % ACSCorba.notifyEventChannelFactory()
    print 'ArchivingChannel: %s' % ACSCorba.archivingChannel()
    print 'LoggingChannel: %s' % ACSCorba.loggingChannel()
    print 'InterfaceRepository: %s' % ACSCorba.interfaceRepository()
    print 'CDB: %s' % ACSCorba.cdb()
    print 'ACSLogSvc: %s' % ACSCorba.acsLogSvc()
    print 'NameService: %s' % ACSCorba.nameService()
开发者ID:,项目名称:,代码行数:32,代码来源:

示例6: test_orb_no_object

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
 def test_orb_no_object(self, corbalocmock, getorbmock):
     orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
     orbmock.string_to_object.return_value = None
     getorbmock.return_value = orbmock
     self.assertEqual(True, ACSCorba.getManager() is None)
开发者ID:,项目名称:,代码行数:7,代码来源:

示例7: test_manager_exists

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
 def test_manager_exists(self):
     ACSCorba.MGR_REF = 'foo'
     self.assertEqual('foo', ACSCorba.getManager())
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8: __init__

# 需要导入模块: from Acspy.Util import ACSCorba [as 别名]
# 或者: from Acspy.Util.ACSCorba import getManager [as 别名]
    def __init__ (self, name):
        '''
        Constructor.

        Initializes member variables and CORBA

        Parameters: name is the stringified name of this container.

        Raises: ???
        '''

        print maci.Container.ContainerStatusStartupBeginMsg
        #Member variables
        self.isReady = Event()
        self.running = 1  #As long as this is true, container is not shutdown
        self.name = name  #Container Name
        self.canRecover = True  #Whether this container is capable of recovery
        self.components = {}  #A dict where components are referenced by name
        self.compHandles = {}  #A dict where comp names are referenced by handles
        self.shutdownHandles = []
        self.containerPOA = None  #POA to activate this container
        self.componentPOA = None  #POA to create POAs for components
        self.compPolicies = []  #Policy[] for components
        self.offShootPolicies = []  #Policy[] for offshoots
        self.corbaRef = None  #reference to this object's CORBA reference
        self.logger = Log.getLogger(name) # Container's logger
        self.client_type = maci.CONTAINER_TYPE
        self.cdbContainerInfo = {}
        self.autoLoadPackages = []
        #dictionary which maps package names to the number of active components
        #using said package
        self.compModuleCount = {}
        
        # Initialize the alarm factory
        Acsalarmpy.AlarmSystemInterfaceFactory.init(ACSCorba.getManager())
        # The alarm source
        self.alarmSource = None
        
        # The interface to receive notification from the LogThrottle 
        # for sending alarms
        self.clta=ContainerLogThrottleAlarmer(self)

        #Configure CORBA
        print maci.Container.ContainerStatusORBInitBeginMsg
        self.configCORBA()
        print maci.Container.ContainerStatusORBInitEndMsg

        #call superclass constructor
        print maci.Container.ContainerStatusMgrInitBeginMsg
        BaseClient.__init__(self, self.name)
        print maci.Container.ContainerStatusMgrInitEndMsg

        self.logger.logTrace('CORBA configured for Container: ' + self.name)

        self.cdbAccess = CDBaccess()

        self.logger.logTrace('Starting Container: ' + self.name)

        #get info from the CDB
        self.getCDBInfo()
        self.refresh_logging_config()
        self.configureComponentLogger(name)

        #Run everything
        self.logger.logInfo('Container ' + self.name + ' waiting for requests')
        self.isReady.set()
        print maci.Container.ContainerStatusStartupEndMsg
        sys.stdout.flush()
开发者ID:,项目名称:,代码行数:70,代码来源:


注:本文中的Acspy.Util.ACSCorba.getManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。