本文整理匯總了Python中Acspy.Util.ACSCorba.getPOARoot方法的典型用法代碼示例。如果您正苦於以下問題:Python ACSCorba.getPOARoot方法的具體用法?Python ACSCorba.getPOARoot怎麽用?Python ACSCorba.getPOARoot使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Acspy.Util.ACSCorba
的用法示例。
在下文中一共展示了ACSCorba.getPOARoot方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: configCORBA
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [as 別名]
def configCORBA(self): # pragma: NO COVER
'''
configCORBA is a helper method responsible for initializing the ORB,
POAs, etc.
Parameters: None
Return: None
Raises: ???
'''
#Create the Container's POA
try:
cont_policies = [] #CORBA.PolicyList
cont_policies.append(ACSCorba.getPOARoot().create_id_assignment_policy(PortableServer.USER_ID))
cont_policies.append(ACSCorba.getPOARoot().create_lifespan_policy(PortableServer.PERSISTENT))
cont_policies.append(ACSCorba.getPOARoot().create_request_processing_policy(PortableServer.USE_ACTIVE_OBJECT_MAP_ONLY))
cont_policies.append(ACSCorba.getPOARoot().create_servant_retention_policy(PortableServer.RETAIN))
self.containerPOA = ACSCorba.getPOARoot().create_POA("ContainerPOA", ACSCorba.getPOAManager(), cont_policies)
for policy in cont_policies:
policy.destroy()
except Exception, e:
self.logger.logWarning("Unable to create the container's POA - " + str(e))
print_exc()
raise CouldntCreateObjectExImpl()
示例2: test_init_fault
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [as 別名]
def test_init_fault(self, getorbmock):
def raiser(*args):
raise Exception("Boom!")
orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
orbmock.resolve_initial_references.side_effect = raiser
getorbmock.return_value = orbmock
self.assertEqual(True, ACSCorba.getPOARoot() is None)
示例3:
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [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()
示例4: test_ok
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [as 別名]
def test_ok(self, getorbmock):
orbmock = mock.Mock(spec=ACSCorba.CORBA.ORB)
getorbmock.return_value = orbmock
self.assertEqual(False, ACSCorba.getPOARoot() is None)
示例5: test_root_exists
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [as 別名]
def test_root_exists(self):
ACSCorba.POA_ROOT = 'foo'
self.assertEqual('foo', ACSCorba.getPOARoot())
示例6: str
# 需要導入模塊: from Acspy.Util import ACSCorba [as 別名]
# 或者: from Acspy.Util.ACSCorba import getPOARoot [as 別名]
cont_policies = [] #CORBA.PolicyList
cont_policies.append(ACSCorba.getPOARoot().create_id_assignment_policy(PortableServer.USER_ID))
cont_policies.append(ACSCorba.getPOARoot().create_lifespan_policy(PortableServer.PERSISTENT))
cont_policies.append(ACSCorba.getPOARoot().create_request_processing_policy(PortableServer.USE_ACTIVE_OBJECT_MAP_ONLY))
cont_policies.append(ACSCorba.getPOARoot().create_servant_retention_policy(PortableServer.RETAIN))
self.containerPOA = ACSCorba.getPOARoot().create_POA("ContainerPOA", ACSCorba.getPOAManager(), cont_policies)
for policy in cont_policies:
policy.destroy()
except Exception, e:
self.logger.logWarning("Unable to create the container's POA - " + str(e))
print_exc()
raise CouldntCreateObjectExImpl()
#Create the Components POA
try:
self.compPolicies.append(ACSCorba.getPOARoot().create_id_assignment_policy(PortableServer.USER_ID))
self.compPolicies.append(ACSCorba.getPOARoot().create_lifespan_policy(PortableServer.PERSISTENT))
self.compPolicies.append(ACSCorba.getPOARoot().create_request_processing_policy(PortableServer.USE_SERVANT_MANAGER))
self.compPolicies.append(ACSCorba.getPOARoot().create_servant_retention_policy(PortableServer.RETAIN))
self.componentPOA = ACSCorba.getPOARoot().create_POA("ComponentPOA", ACSCorba.getPOAManager(), self.compPolicies)
except Exception, e:
self.logger.logWarning("Unable to create the components' POA - " + str(e))
print_exc()
raise CouldntCreateObjectExImpl()
#Create the Offshoot Policies
try:
self.offShootPolicies.append(ACSCorba.getPOARoot().create_id_assignment_policy(PortableServer.SYSTEM_ID))
self.offShootPolicies.append(ACSCorba.getPOARoot().create_lifespan_policy(PortableServer.TRANSIENT))
self.offShootPolicies.append(ACSCorba.getPOARoot().create_request_processing_policy(PortableServer.USE_ACTIVE_OBJECT_MAP_ONLY))
self.offShootPolicies.append(ACSCorba.getPOARoot().create_servant_retention_policy(PortableServer.RETAIN))