Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1017#discussion_r44536000
--- Diff:
api/src/main/java/org/apache/brooklyn/api/typereg/BrooklynTypeRegistry.java ---
@@ -45,24 +45,25 @@
/** @return The item matching the given given
* {@link RegisteredType#getSymbolicName() symbolicName}
* and optionally {@link RegisteredType#getVersion()},
- * filtered for the optionally supplied {@link
RegisteredTypeConstraint},
+ * filtered for the optionally supplied {@link
RegisteredTypeLoadingContext},
* taking the best version if the version is null or a default marker,
* returning null if no matches are found. */
- RegisteredType get(String symbolicName, String version, @Nullable
RegisteredTypeConstraint constraint);
- /** as {@link #get(String, String, RegisteredTypeConstraint)} with no
constraints */
+ RegisteredType get(String symbolicName, String version, @Nullable
RegisteredTypeLoadingContext constraint);
+ /** as {@link #get(String, String, RegisteredTypeLoadingContext)} with
no constraints */
RegisteredType get(String symbolicName, String version);
- /** as {@link #get(String, String, RegisteredTypeConstraint)} but
allows <code>"name:version"</code>
+ /** as {@link #get(String, String, RegisteredTypeLoadingContext)} but
allows <code>"name:version"</code>
* (the {@link RegisteredType#getId()}) in addition to the unversioned
name,
* using a default marker if no version can be inferred */
- RegisteredType get(String symbolicNameWithOptionalVersion, @Nullable
RegisteredTypeConstraint constraint);
- /** as {@link #get(String, RegisteredTypeConstraint)} but with no
constraints */
+ RegisteredType get(String symbolicNameWithOptionalVersion, @Nullable
RegisteredTypeLoadingContext constraint);
+ /** as {@link #get(String, RegisteredTypeLoadingContext)} but with no
constraints */
RegisteredType get(String symbolicNameWithOptionalVersion);
// NB the seemingly more correct generics <T,SpecT extends
AbstractBrooklynObjectSpec<T,SpecT>>
// cause compile errors, not in Eclipse, but in maven (?)
- <SpecT extends AbstractBrooklynObjectSpec<?,?>> SpecT
createSpec(RegisteredType type, @Nullable RegisteredTypeConstraint
optionalConstraint, Class<SpecT> optionalSpecSuperType);
+ <SpecT extends AbstractBrooklynObjectSpec<?,?>> SpecT
createSpec(RegisteredType type, @Nullable RegisteredTypeLoadingContext
optionalConstraint, Class<SpecT> optionalSpecSuperType);
+ <SpecT extends AbstractBrooklynObjectSpec<?,?>> SpecT
createSpecFromPlan(String planFormat, Object planData, @Nullable
RegisteredTypeLoadingContext optionalConstraint, Class<SpecT>
optionalSpecSuperType);
- // TODO when we support beans
-// <T> T createBean(RegisteredType type, @Nullable
RegisteredTypeConstraint optionalConstraint, Class<T> optionalResultSuperType);
+ <T> T createBean(RegisteredType type, @Nullable
RegisteredTypeLoadingContext optionalConstraint, Class<T>
optionalResultSuperType);
+ <T> T createBeanFromPlan(String planFormat, Object planData, @Nullable
RegisteredTypeLoadingContext optionalConstraint, Class<T>
optionalBeanSuperType);
--- End diff --
I'd say that all the `createXXX` methods don't belong to the registry.
Makes more sense if another piece of code does this, having a reference to the
registry. Even `createSpec` on the CI was out of place for me, but as a single
method was a 'don't bother' case.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---