You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Aled Sage <al...@gmail.com> on 2017/10/09 10:49:10 UTC
Re: Deprecating `@Catalog` annotation?
Hi all,
I've finally deprecated this - see
https://github.com/apache/brooklyn-server/pull/857.
---
However, I haven't changed the use of `--jar` in `ItemLister`: that will
still look for Java classes that implement Entity etc and/or classes
annotated with `@Catalog`; it is run via the non-karaf CLI.
It should really look for a `catalog.bom` in the jar, and should re-use
as much code as possible from `BrooklynCatalog` and `BrooklynTypeRegistry`.
I think that would involve a re-think / re-write. We could achieve the
same functionality by querying the catalog of a running Brooklyn's
catalog, rather than as a separate offline tool.
I suggest we ignore the existing `ItemLister` for now, and deprecate it
at the same time as we deprecate the classic (non-karaf) mode of Brooklyn.
Aled
On 15/09/2017 15:33, Thomas Bouron wrote:
> +1
>
> On Fri, 15 Sep 2017 at 15:04 Richard Downer <ri...@apache.org> wrote:
>
>> +1
>>
>> On 15 September 2017 at 14:12, Aled Sage <al...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> I'd like to deprecate the `@Catalog` annotation [1], and the support for
>>> `scanFromAnnotations` [2].
>>>
>>> Previously, we annotated some entity/policy Java classes with catalog
>>> information, such as descriptions and icon urls. However, we've moved to
>>> using .bom files as the way to define catalog items. Therefore the
>>> `@Catalog` is not normally used.
>>>
>>> It is also supported/used by the `./brooklyn list-objects` CLI, to scan
>>> jars [3]. It find the annotated entities etc, gets the catalog metadata,
>>> and writes that out in json format. However, I don't think that's what we
>>> want to do moving forward. We should focus on getting the metadata from
>> the
>>> .bom files, which is how things should be defined for the catalog.
>>>
>>> Any objections to deprecating these?
>>>
>>> Aled
>>>
>>> [1] https://github.com/apache/brooklyn-server/blob/master/api/
>>> src/main/java/org/apache/brooklyn/api/catalog/Catalog.java
>>> [2] https://github.com/apache/brooklyn-server/blob/master/core/
>>> src/main/java/org/apache/brooklyn/core/catalog/internal/
>>> CatalogClasspathDo.java#L199-L209
>>> [3] https://github.com/apache/brooklyn-server/blob/master/server
>>> -cli/src/main/java/org/apache/brooklyn/cli/ItemLister.java#L88-L94
>>>
>>>