brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Corbett (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-58) Mechanism for entities to be automatically imported into the catalog
Date Fri, 19 Sep 2014 15:34:33 GMT

    [ https://issues.apache.org/jira/browse/BROOKLYN-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14140746#comment-14140746
] 

Sam Corbett commented on BROOKLYN-58:
-------------------------------------

I think all of the mechanisms necessary for this are already in place, but they are invoked
in a confusing and undesirable manner.

If Brooklyn cannot load whatever you have configured as your catalog.xml file (e.g. no such
file exists) then it will look for classes annotated {{@Catalog}} on your classpath by setting
the catalogue dto to:
{code}
CatalogDto.newDefaultLocalScanningDto(CatalogClasspathDo.CatalogScanningModes.ANNOTATIONS)
{code}
This automatically fills the catalogue with every annotated entity included with Brooklyn.

Otherwise, Brooklyn can load your catalog.xml file.
* If the file does not contain a {{<classpath>}} element or has an element with {{scan="none"}}
then nothing is scanned.
* If the file contains a {{<classpath scan="annotations">}} element all the {{<entry>}}
child element URLs will be scanned for {{@Catalog}} annotations.
* If the file contains a {{<classpath scan="types">}} element all the {{<entry>}}
child element URLs will be scanned for matches with a combination of heuristics like subclass
of Entity.class or Application.class.

In this second case, when a catalog.xml file is loaded, there is no way to get Brooklyn to
also scan the local classpath.

> Mechanism for entities to be automatically imported into the catalog
> --------------------------------------------------------------------
>
>                 Key: BROOKLYN-58
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-58
>             Project: Brooklyn
>          Issue Type: Sub-task
>    Affects Versions: 0.7.0-M1
>            Reporter: Richard Downer
>             Fix For: 0.7.0
>
>
> Devise a mechanism that allows catalog entries (including - and preferably - utilising
YAML blueprints) to be defined in source code and automatically importing into the catalog.
> Potential mechanisms include the ServiceLoader mechanism, annotation processing, doclets,
etc. A runtime mechanism may be preferable as this would also collect catalog entries that
the user has added to the dropins directory.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message