[asterisk-scf-commits] asterisk-scf/examples.git branch "decorator" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jul 6 14:13:36 CDT 2011


branch "decorator" has been updated
       via  cddde515cfbbaa02fc4553f67ad0e395e7c76673 (commit)
      from  b80ac76f409ebd0a871985396d60113eefab2079 (commit)

Summary of changes:
 Session_Decorator.py |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit cddde515cfbbaa02fc4553f67ad0e395e7c76673
Author: Mark Michelson <mmichelson at digium.com>
Date:   Wed Jul 6 14:13:31 2011 -0500

    Address review feedback from CR-ASTSCF-115

diff --git a/Session_Decorator.py b/Session_Decorator.py
index a561315..de200cd 100755
--- a/Session_Decorator.py
+++ b/Session_Decorator.py
@@ -23,7 +23,7 @@ Ice.loadSlice("-I" + Ice.getSliceDir() + " -I" + os.environ["ASTSCF_HOME"] + " -
 
 import AsteriskSCF.SessionCommunications.V1
 
-# This is a decorator for the Session class. The idea for it is that
+# This is a decorator for the Session interface. The idea for it is that
 # It contains within it a "real" session of some sort. We can add our
 # own augmentations around the "real" session's methods to do things
 # we'd like. In this example, all we do is print messages to indicate
@@ -147,13 +147,10 @@ class SessionDecoratorHook(AsteriskSCF.SessionCommunications.ExtensionPoints.V1.
     def __init__(self, adapter):
         self.adapter = adapter
     def decorateSession(self, realSession, current = None):
-        # XXX When is it appropriate to remove the decorator from the adapter?
-        print "The proxy for the real session is " + realSession.ice_getIdentity().name
         decorator = SessionDecorator(realSession, self.adapter)
         decoratorPrx = AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(self.adapter.addWithUUID(decorator))
         decorator.setProxy(decoratorPrx.ice_getIdentity())
         result = AsteriskSCF.System.Hook.V1.HookResult(AsteriskSCF.System.Hook.V1.HookStatus.Succeeded, "cool")
-        print "The proxy we're going to send to AsteriskSCF is " + decoratorPrx.ice_getIdentity().name
         return (result, AsteriskSCF.SessionCommunications.V1.SessionPrx.uncheckedCast(decoratorPrx))
 
 class DecoratorApp(Ice.Application):
@@ -260,6 +257,11 @@ class DecoratorApp(Ice.Application):
 app = DecoratorApp()
 initData = Ice.InitializationData()
 initData.properties = Ice.createProperties()
+# We specify thread pool sizes > 1 here in case the
+# Ice runtime requires multiple threads in order to
+# execute. This may actually not be necessary here, but
+# if any AMI calls were added, the client thread pool
+# size would definitely need to be greater than 1.
 initData.properties.setProperty("Ice.ThreadPool.Client.Size", "5")
 initData.properties.setProperty("Ice.ThreadPool.Server.Size", "5")
 sys.exit(app.main(sys.argv, None, initData))

-----------------------------------------------------------------------


-- 
asterisk-scf/examples.git



More information about the asterisk-scf-commits mailing list