Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable nested proxy properties #2952

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions config/PropertyNames.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
<property name="PreferSecure" languages="all" />
<property name="LocatorCacheTimeout" languages="all" />
<property name="InvocationTimeout" languages="all" />
<!-- TODO: set class="Proxy" once all languages support class props -->
<property name="Locator" languages="all" />
<!-- TODO: set class="Proxy" once all languages support class props -->
<property name="Router" languages="all" />
<property name="Locator" languages="all" class="Proxy"/>
<property name="Router" languages="all" class="Proxy"/>
<property name="CollocationOptimized" languages="cpp,csharp,java" />
<property name="Context.[any]" languages="all" />
</class>
Expand Down Expand Up @@ -406,7 +404,7 @@
<property name="Node.Multicast" class="ObjectAdapter" languages="cpp" />
<property name="Node.Multicast.Enabled" default="1" languages="cpp" />
<property name="Node.RetryCount" default="6" languages="cpp" />
<property name="Node.RetryDelay" default="500" languages="cpp" />
<property name="Node.RetryDelay" default="500" languages="cpp" />
<property name="Node.RetryMultiplier" default="2" languages="cpp" />
<property name="Node.Server" class="ObjectAdapter" languages="cpp" />
<property name="Node.Server.Enabled" default="1" languages="cpp" />
Expand Down
8 changes: 5 additions & 3 deletions config/makeprops.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,12 @@ def writePropertyArray(self, propertyArray):
if propertyArray.properties
else ""
)

# We assign the properties to the property array after creating it so that we can reference the array
# in the properties themselves
self.srcFile.write(f"""\
PropertyNames.{name}Props = new PropertyArray("{name}", {prefixOnly}, [{properties}
]);
PropertyNames.{name}Props = new PropertyArray("{name}", {prefixOnly});
PropertyNames.{name}Props.properties = [{properties}
];

""")

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/Ice/PropertyNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const Property ProxyPropsData[] =
Property{"PreferSecure", "", false, false, nullptr},
Property{"LocatorCacheTimeout", "", false, false, nullptr},
Property{"InvocationTimeout", "", false, false, nullptr},
Property{"Locator", "", false, false, nullptr},
Property{"Router", "", false, false, nullptr},
Property{"Locator", "", false, false, &PropertyNames::ProxyProps},
Property{"Router", "", false, false, &PropertyNames::ProxyProps},
Property{"CollocationOptimized", "", false, false, nullptr},
Property{"Context.*", "", true, false, nullptr}
};
Expand Down
4 changes: 2 additions & 2 deletions csharp/src/Ice/Internal/PropertyNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ internal sealed class PropertyNames
new(pattern: @"PreferSecure", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"LocatorCacheTimeout", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"InvocationTimeout", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"Locator", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"Router", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"Locator", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: ProxyProps),
new(pattern: @"Router", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: ProxyProps),
new(pattern: @"CollocationOptimized", usesRegex: false, defaultValue: "", deprecated: false, propertyArray: null),
new(pattern: @"^Context\.[^\s]+$", usesRegex: true, defaultValue: "", deprecated: false, propertyArray: null)
]);
Expand Down
4 changes: 2 additions & 2 deletions java/src/Ice/src/main/java/com/zeroc/Ice/PropertyNames.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ final class PropertyNames
new Property("PreferSecure", false, "", false, null),
new Property("LocatorCacheTimeout", false, "", false, null),
new Property("InvocationTimeout", false, "", false, null),
new Property("Locator", false, "", false, null),
new Property("Router", false, "", false, null),
new Property("Locator", false, "", false, PropertyNames.ProxyProps),
new Property("Router", false, "", false, PropertyNames.ProxyProps),
new Property("CollocationOptimized", false, "", false, null),
new Property("Context\\.[^\\s]+", true, "", false, null)
});
Expand Down
104 changes: 62 additions & 42 deletions js/src/Ice/PropertyNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,45 @@
import { Property, PropertyArray } from "./Property.js";
export const PropertyNames = {};

PropertyNames.ProxyProps = new PropertyArray("Proxy", false, [
PropertyNames.ProxyProps = new PropertyArray("Proxy", false);
PropertyNames.ProxyProps.properties = [
new Property("EndpointSelection", false, "", false, null),
new Property("ConnectionCached", false, "", false, null),
new Property("PreferSecure", false, "", false, null),
new Property("LocatorCacheTimeout", false, "", false, null),
new Property("InvocationTimeout", false, "", false, null),
new Property("Locator", false, "", false, null),
new Property("Router", false, "", false, null),
new Property("Locator", false, "", false, PropertyNames.ProxyProps),
new Property("Router", false, "", false, PropertyNames.ProxyProps),
new Property(/^Context\../, true, "", false, null)
]);
];

PropertyNames.ConnectionProps = new PropertyArray("Connection", true, [
PropertyNames.ConnectionProps = new PropertyArray("Connection", true);
PropertyNames.ConnectionProps.properties = [
new Property("CloseTimeout", false, "10", false, null),
new Property("ConnectTimeout", false, "10", false, null),
new Property("EnableIdleCheck", false, "1", false, null),
new Property("IdleTimeout", false, "60", false, null),
new Property("InactivityTimeout", false, "300", false, null)
]);
];

PropertyNames.ThreadPoolProps = new PropertyArray("ThreadPool", true, [
]);
PropertyNames.ThreadPoolProps = new PropertyArray("ThreadPool", true);
PropertyNames.ThreadPoolProps.properties = [
];

PropertyNames.ObjectAdapterProps = new PropertyArray("ObjectAdapter", true, [
PropertyNames.ObjectAdapterProps = new PropertyArray("ObjectAdapter", true);
PropertyNames.ObjectAdapterProps.properties = [
new Property("PublishedEndpoints", false, "", false, null),
new Property("Router", false, "", false, PropertyNames.ProxyProps),
new Property("ProxyOptions", false, "", false, null),
new Property("MessageSizeMax", false, "", false, null)
]);
];

PropertyNames.LMDBProps = new PropertyArray("LMDB", true, [
]);
PropertyNames.LMDBProps = new PropertyArray("LMDB", true);
PropertyNames.LMDBProps.properties = [
];

PropertyNames.IceProps = new PropertyArray("Ice", false, [
PropertyNames.IceProps = new PropertyArray("Ice", false);
PropertyNames.IceProps.properties = [
new Property("BackgroundLocatorCacheUpdates", false, "0", false, null),
new Property("BatchAutoFlush", false, "", true, null),
new Property("BatchAutoFlushSize", false, "1024", false, null),
Expand Down Expand Up @@ -71,49 +77,63 @@ PropertyNames.IceProps = new PropertyArray("Ice", false, [
new Property("Warn.Dispatch", false, "1", false, null),
new Property("Warn.Endpoints", false, "1", false, null),
new Property("Warn.UnusedProperties", false, "0", false, null)
]);
];

PropertyNames.IceMXProps = new PropertyArray("IceMX", false, [
]);
PropertyNames.IceMXProps = new PropertyArray("IceMX", false);
PropertyNames.IceMXProps.properties = [
];

PropertyNames.IceDiscoveryProps = new PropertyArray("IceDiscovery", false, [
]);
PropertyNames.IceDiscoveryProps = new PropertyArray("IceDiscovery", false);
PropertyNames.IceDiscoveryProps.properties = [
];

PropertyNames.IceLocatorDiscoveryProps = new PropertyArray("IceLocatorDiscovery", false, [
]);
PropertyNames.IceLocatorDiscoveryProps = new PropertyArray("IceLocatorDiscovery", false);
PropertyNames.IceLocatorDiscoveryProps.properties = [
];

PropertyNames.IceBoxProps = new PropertyArray("IceBox", false, [
]);
PropertyNames.IceBoxProps = new PropertyArray("IceBox", false);
PropertyNames.IceBoxProps.properties = [
];

PropertyNames.IceBoxAdminProps = new PropertyArray("IceBoxAdmin", false, [
]);
PropertyNames.IceBoxAdminProps = new PropertyArray("IceBoxAdmin", false);
PropertyNames.IceBoxAdminProps.properties = [
];

PropertyNames.IceBridgeProps = new PropertyArray("IceBridge", false, [
]);
PropertyNames.IceBridgeProps = new PropertyArray("IceBridge", false);
PropertyNames.IceBridgeProps.properties = [
];

PropertyNames.IceGridAdminProps = new PropertyArray("IceGridAdmin", false, [
]);
PropertyNames.IceGridAdminProps = new PropertyArray("IceGridAdmin", false);
PropertyNames.IceGridAdminProps.properties = [
];

PropertyNames.IceGridProps = new PropertyArray("IceGrid", false, [
]);
PropertyNames.IceGridProps = new PropertyArray("IceGrid", false);
PropertyNames.IceGridProps.properties = [
];

PropertyNames.IceSSLProps = new PropertyArray("IceSSL", false, [
]);
PropertyNames.IceSSLProps = new PropertyArray("IceSSL", false);
PropertyNames.IceSSLProps.properties = [
];

PropertyNames.IceStormProps = new PropertyArray("IceStorm", false, [
]);
PropertyNames.IceStormProps = new PropertyArray("IceStorm", false);
PropertyNames.IceStormProps.properties = [
];

PropertyNames.IceStormAdminProps = new PropertyArray("IceStormAdmin", false, [
]);
PropertyNames.IceStormAdminProps = new PropertyArray("IceStormAdmin", false);
PropertyNames.IceStormAdminProps.properties = [
];

PropertyNames.IceBTProps = new PropertyArray("IceBT", false, [
]);
PropertyNames.IceBTProps = new PropertyArray("IceBT", false);
PropertyNames.IceBTProps.properties = [
];

PropertyNames.Glacier2Props = new PropertyArray("Glacier2", false, [
]);
PropertyNames.Glacier2Props = new PropertyArray("Glacier2", false);
PropertyNames.Glacier2Props.properties = [
];

PropertyNames.DataStormProps = new PropertyArray("DataStorm", false, [
]);
PropertyNames.DataStormProps = new PropertyArray("DataStorm", false);
PropertyNames.DataStormProps.properties = [
];

PropertyNames.validProps = [
PropertyNames.IceProps,
Expand Down
Loading