diff options
author | Brent Eagles <brent@zeroc.com> | 2007-06-19 10:34:13 -0230 |
---|---|---|
committer | Brent Eagles <brent@zeroc.com> | 2007-06-19 10:34:13 -0230 |
commit | 9552b9d764d4d156784f991b4b4d0697fea5d737 (patch) | |
tree | 5710cc7782cc0b79bfa74679047d8899e26b5452 | |
parent | For bug 1597. Removing generation of C# and Java Property classes used in Pro... (diff) | |
download | ice-9552b9d764d4d156784f991b4b4d0697fea5d737.tar.bz2 ice-9552b9d764d4d156784f991b4b4d0697fea5d737.tar.xz ice-9552b9d764d4d156784f991b4b4d0697fea5d737.zip |
* Modified makeprops.py to allow property classes to contain
deprecated properties.
* Fixed a bug in handling properties that were simply deprecated
through the deprecated attribute (as opposed to through the
deprecatedBy attribute)
-rwxr-xr-x | cpp/config/PropertyNames.xml | 109 | ||||
-rw-r--r-- | cpp/config/makeprops.py | 78 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/PropertyNames.h | 2 | ||||
-rw-r--r-- | cs/src/Ice/PropertyNames.cs | 2 | ||||
-rw-r--r-- | java/src/IceInternal/PropertyNames.java | 2 |
6 files changed, 92 insertions, 103 deletions
diff --git a/cpp/config/PropertyNames.xml b/cpp/config/PropertyNames.xml index ae1ca09ec9d..aab0d6b636c 100755 --- a/cpp/config/PropertyNames.xml +++ b/cpp/config/PropertyNames.xml @@ -145,35 +145,35 @@ generated from the section label. --> <properties> - <propertyClass name="proxy" type="expand"> - <suffix value="EndpointSelection" /> - <suffix value="ConnectionCached" /> - <suffix value="PreferSecure" /> - <suffix value="LocatorCacheTimeout" /> - <suffix value="Locator" /> - <suffix value="Router" /> - <suffix value="CollocationOptimization" /> - <suffix value="ThreadPerConnection" /> - </propertyClass> - - <propertyClass name="threadpool" type="placeholder"> - <suffix value="Size" /> - <suffix value="SizeMax" /> - <suffix value="SizeWarn" /> - <suffix value="StackSize" /> - </propertyClass> - - <propertyClass name="objectadapter" type="placeholder"> - <suffix value="AdapterId" /> - <suffix value="Endpoints" /> - <suffix value="Locator" /> - <suffix value="PublishedEndpoints" /> - <suffix value="ReplicaGroupdId" /> - <suffix value="Router" /> - <suffix value="ThreadPerConnection" /> - <suffix value="ThreadPerConnection.StackSize" /> - <suffix value="ThreadPool" class="threadpool" /> - </propertyClass> + <class name="proxy" prefix-only="false"> + <suffix name="EndpointSelection" /> + <suffix name="ConnectionCached" /> + <suffix name="PreferSecure" /> + <suffix name="LocatorCacheTimeout" /> + <suffix name="Locator" /> + <suffix name="Router" /> + <suffix name="CollocationOptimization" /> + <suffix name="ThreadPerConnection" /> + </class> + + <class name="threadpool" prefix-only="true"> + <suffix name="Size" /> + <suffix name="SizeMax" /> + <suffix name="SizeWarn" /> + <suffix name="StackSize" /> + </class> + + <class name="objectadapter" prefix-only="true"> + <suffix name="AdapterId" /> + <suffix name="Endpoints" /> + <suffix name="Locator" /> + <suffix name="PublishedEndpoints" /> + <suffix name="ReplicaGroupdId" /> + <suffix name="Router" /> + <suffix name="ThreadPerConnection" /> + <suffix name="ThreadPerConnection.StackSize" /> + <suffix name="ThreadPool" class="threadpool" /> + </class> <section name="Ice"> <property name="ACM.Client" /> @@ -185,12 +185,13 @@ generated from the section label. <property name="Default.CollocationOptimization" /> <property name="Default.EndpointSelection" /> <property name="Default.Host" /> - <property name="Default.Locator" propertyClass="proxy"/> + <property name="Default.Locator" class="proxy"/> <property name="Default.LocatorCacheTimeout" /> <property name="Default.Package" /> <property name="Default.PreferSecure" /> <property name="Default.Protocol" /> - <property name="Default.Router" propertyClass="proxy" /> + <property name="Default.Router" class="proxy" + deprecated="false" /> <property name="GC.Interval" /> <property name="ImplicitContext" /> <property name="InitPlugins" /> @@ -216,8 +217,8 @@ generated from the section label. <property name="StdOut" /> <property name="ThreadPerConnection" /> <property name="ThreadPerConnection.StackSize" /> - <property name="ThreadPool.Client" propertyClass="threadpool"/> - <property name="ThreadPool.Server" propertyClass="threadpool"/> + <property name="ThreadPool.Client" class="threadpool"/> + <property name="ThreadPool.Server" class="threadpool"/> <property name="Trace.GC" /> <property name="Trace.Location" /> <property name="Trace.Network" /> @@ -252,7 +253,7 @@ generated from the section label. <property name="ServiceManager.Router" /> <property name="ServiceManager.ThreadPerConnection" /> <property name="ServiceManager.ThreadPerConnection.StackSize" /> - <property name="ServiceManager.ThreadPool" propertyClass="threadpool" /> + <property name="ServiceManager.ThreadPool" class="threadpool" /> <property name="UseSharedCommunicator.[any]" /> <property name="InheritProperties" /> </section> @@ -286,37 +287,37 @@ generated from the section label. <property name="Node.Router" /> <property name="Node.ThreadPerConnection" /> <property name="Node.ThreadPerConnection.StackSize" /> - <property name="Node.ThreadPool" propertyClass="threadpool" /> + <property name="Node.ThreadPool" class="threadpool" /> <property name="Node.Trace.Activator" /> <property name="Node.Trace.Adapter" /> <property name="Node.Trace.Patch" /> <property name="Node.Trace.Replica" /> <property name="Node.Trace.Server" /> <property name="Node.UserAccounts" /> - <property name="Node.UserAccountMapper" propertyClass="proxy"/> + <property name="Node.UserAccountMapper" class="proxy"/> <property name="Node.WaitTime" /> <property name="Registry.AdminCryptPasswords" /> <property name="Registry.AdminPermissionsVerifier" - propertyClass="proxy" /> + class="proxy" /> <property name="Registry.AdminSSLPermissionsVerifier" - propertyClass="proxy" /> - <property name="Registry.Client" propertyClass="objectadapter" /> + class="proxy" /> + <property name="Registry.Client" class="objectadapter" /> <property name="Registry.CryptPasswords" /> <property name="Registry.Data" /> <property name="Registry.DefaultTemplates" /> <property name="Registry.DynamicRegistration" /> - <property name="Registry.Internal" propertyClass="objectadapter" /> + <property name="Registry.Internal" class="objectadapter" /> <property name="Registry.NodeSessionTimeout" /> <property name="Registry.PermissionsVerifier" - propertyClass="proxy"/> + class="proxy"/> <property name="Registry.ReplicaName" /> <property name="Registry.ReplicaSessionTimeout" /> - <property name="Registry.Server" propertyClass="objectadapter"/> + <property name="Registry.Server" class="objectadapter"/> <property name="Registry.SessionManager" - propertyClass="objectadapter"/> + class="objectadapter"/> <property name="Registry.SessionTimeout" /> <property name="Registry.SSLPermissionsVerifier" - propertyClass="proxy"/> + class="proxy"/> <property name="Registry.Trace.Application" /> <property name="Registry.Trace.Adapter" /> <property name="Registry.Trace.Locator" /> @@ -330,8 +331,8 @@ generated from the section label. </section> <section name="IcePatch2"> - <property propertyClass="objectadapter" /> - <property name="Admin" propertyClass="objectadapter" /> + <property class="objectadapter" /> + <property name="Admin" class="objectadapter" /> <property name="ChunkSize" /> <property name="Directory" /> <property name="InstanceName" /> @@ -380,11 +381,11 @@ generated from the section label. <section name="IceStorm"> <property name="Flush.Timeout" /> <property name="InstanceName" /> - <property name="Publish" propertyClass="objectadapter" /> + <property name="Publish" class="objectadapter" /> <property name="Publish.RegisterProcess" /> - <property name="TopicManager" propertyClass="objectadapter" /> - <property name="TopicManager.Proxy" propertyClass="proxy" /> - <property name="SubscriberPool" propertyClass="threadpool" /> + <property name="TopicManager" class="objectadapter" /> + <property name="TopicManager.Proxy" class="proxy" /> + <property name="SubscriberPool" class="threadpool" /> <property name="Trace.Flush" /> <property name="Trace.Subscriber" /> <property name="Trace.SubscriberPool" /> @@ -422,9 +423,9 @@ generated from the section label. <property name="Filter.Identity.Accept" /> <property name="CryptPasswords" /> <property name="InstanceName" /> - <property name="PermissionsVerifier" propertyClass="proxy"/> + <property name="PermissionsVerifier" class="proxy"/> <property name="ReturnClientProxy" /> - <property name="SSLPermissionsVerifier" propertyClass="proxy"/> + <property name="SSLPermissionsVerifier" class="proxy"/> <property name="RoutingTable.MaxSize" /> <property name="Server.AlwaysBatch" /> <property name="Server.Buffered" /> @@ -435,8 +436,8 @@ generated from the section label. <property name="Server.SleepTime" /> <property name="Server.Trace.Override" /> <property name="Server.Trace.Request" /> - <property name="SessionManager" propertyClass="proxy"/> - <property name="SSLSessionManager" propertyClass="proxy"/> + <property name="SessionManager" class="proxy"/> + <property name="SSLSessionManager" class="proxy"/> <property name="SessionTimeout" /> <property name="Trace.RoutingTable" /> <property name="Trace.Session" /> diff --git a/cpp/config/makeprops.py b/cpp/config/makeprops.py index 9fc80a7c705..6b8fcc834fb 100644 --- a/cpp/config/makeprops.py +++ b/cpp/config/makeprops.py @@ -125,59 +125,44 @@ def progError(msg): print >> sys.stderr, progname + ": " + msg # -# Currently the processing of PropertyNames.def is going to take place +# Currently the processing of PropertyNames.xml is going to take place # in two parts. One is using DOM to extract the property 'classes' such # as 'proxy', 'objectadapter', etc. The other part uses SAX to create # the language mapping source code. # class PropertyClass: - def __init__(self, type, suffixes, nestedClasses): - self.type = type - self.suffixes = suffixes - self.nestedClasses = nestedClasses + def __init__(self, prefixOnly , childProperties): + self.prefixOnly = prefixOnly + self.childProperties = childProperties + + def getChildren(self): + return self.childProperties + + def isPrefixOnly(self): + return self.prefixOnly def __repr__(self): - return repr((repr(self.type), repr(self.suffixes), - repr(self.nestedClasses))) - -def expandClassLists(classTree, list): - expansion = [] - for nc in list: - if nc[0] == None: - expansion.extend(classTree[nc[1]].suffixes) - else: - for s in classTree[nc[1]].suffixes: - expansion.append("%s.%s" % (nc[0], s)) - expansion.extend(expandClassLists(classTree, classTree[nc[1]].nestedClasses)) - return expansion + return repr((repr(self.preifxOnly), repr(self.childProperties))) def initPropertyClasses(filename): doc = parse(filename) - propertyClassNodes = doc.getElementsByTagName('propertyClass') - propertyClassTree = {} + propertyClassNodes = doc.getElementsByTagName("class") + global propertyClasses + propertyClasses = {} for n in propertyClassNodes: className = n.attributes["name"].nodeValue - classType = n.attributes["type"].nodeValue - classValues = [] - nestedClasses = [] + classType = n.attributes["prefix-only"].nodeValue + properties = [] for a in n.childNodes: - if a.localName == "suffix": - if a.attributes.has_key("value"): - if a.attributes.has_key("class"): - nestedClasses.append((a.attributes["value"].nodeValue, a.attributes["class"].nodeValue)) - else: - classValues.append(a.attributes["value"].nodeValue) - propertyClassTree[className] = PropertyClass(classType, classValues, nestedClasses) + if a.localName == "suffix" and a.hasAttributes(): + """Convert minidom maps to hashtables """ + attmap = {} + for i in range(0, a.attributes.length): + attmap[a.attributes.item(i).name] = a.attributes.item(i).value + properties.append(attmap) - # - # resolve and expand nested property classes. - # - global propertyClasses - for k in propertyClassTree.keys(): - pc = propertyClassTree[k] - pc.suffixes.extend(expandClassLists(propertyClassTree, pc.nestedClasses)) - propertyClasses[k] = (pc.type, pc.suffixes) + propertyClasses[className] = PropertyClass(classType.lower() == "true", properties) # # SAX part. @@ -276,14 +261,17 @@ class PropertyHandler(ContentHandler): elif name == "property": propertyName = attrs.get("name", None) - if attrs.has_key("propertyClass"): - c = propertyClasses[attrs["propertyClass"]] - for p in c[1]: + if attrs.has_key("class"): + c = propertyClasses[attrs["class"]] + for p in c.getChildren(): if propertyName == None: - self.startElement(name, { 'name': "%s" % p}) + self.startElement(name, p) else: - self.startElement(name, { 'name': "%s.%s" % (propertyName, p)}) - if c[0] == "placeholder": + t = dict(p) + t['name'] = "%s.%s" % (propertyName, p['name']) + self.startElement(name, t) + if c.isPrefixOnly(): + print propertyName, "(", attrs["class"], ") is prefix only" return # @@ -549,7 +537,7 @@ class MultiHandler(PropertyHandler): def handleDeprecated(self, propertyName): for f in self.handlers: - f.handleDeprecated(sectionName, cmdLine) + f.handleDeprecated(propertyName) def handleDeprecatedWithReplacement(self, propertyName, deprecatedBy): for f in self.handlers: diff --git a/cpp/src/Ice/PropertyNames.cpp b/cpp/src/Ice/PropertyNames.cpp index 863bfe7c706..e8659d4d904 100644 --- a/cpp/src/Ice/PropertyNames.cpp +++ b/cpp/src/Ice/PropertyNames.cpp @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Jun 14 16:20:35 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Jun 19 10:11:20 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cpp/src/Ice/PropertyNames.h b/cpp/src/Ice/PropertyNames.h index 4d65cc40911..7af3de09f6d 100644 --- a/cpp/src/Ice/PropertyNames.h +++ b/cpp/src/Ice/PropertyNames.h @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Jun 14 16:20:35 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Jun 19 10:11:20 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/cs/src/Ice/PropertyNames.cs b/cs/src/Ice/PropertyNames.cs index cf30eadd1e9..acd3f28db70 100644 --- a/cs/src/Ice/PropertyNames.cs +++ b/cs/src/Ice/PropertyNames.cs @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Jun 14 16:20:35 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Jun 19 10:11:20 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! diff --git a/java/src/IceInternal/PropertyNames.java b/java/src/IceInternal/PropertyNames.java index 0d39a9a554d..bf277107184 100644 --- a/java/src/IceInternal/PropertyNames.java +++ b/java/src/IceInternal/PropertyNames.java @@ -7,7 +7,7 @@ // // ********************************************************************** // -// Generated by makeprops.py from file ../config/PropertyNames.xml, Thu Jun 14 16:20:35 2007 +// Generated by makeprops.py from file ../config/PropertyNames.xml, Tue Jun 19 10:11:20 2007 // IMPORTANT: Do not edit this file -- any edits made here will be lost! |