brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreaturli <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Pluggable YAML parsers
Date Mon, 27 Jul 2015 15:10:48 GMT
Github user andreaturli commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/760#discussion_r35546633
  
    --- Diff: core/src/main/java/brooklyn/management/internal/EntityManagementUtils.java ---
    @@ -82,55 +79,36 @@
             return app;
         }
     
    -    /** convenience for accessing camp */
    -    public static Maybe<CampPlatform> getCampPlatform(ManagementContext mgmt) {
    -        return BrooklynServerConfig.getCampPlatform(mgmt);
    -    }
    -    
         /** as {@link #createApplication(ManagementContext, EntitySpec)} but for a YAML spec
*/
         public static <T extends Application> T createUnstarted(ManagementContext mgmt,
String yaml) {
    -        AssemblyTemplate at = getCampPlatform(mgmt).get().pdp().registerDeploymentPlan(
new StringReader(yaml) );
    -        return createUnstarted(mgmt, at);
    +        EntitySpec<T> spec = createEntitySpec(mgmt, yaml);
    +        return createUnstarted(mgmt, spec);
         }
         
    -    /** as {@link #createApplication(ManagementContext, EntitySpec)} but for an assembly
template */
    -    @SuppressWarnings("unchecked")
    -    public static <T extends Application> T createUnstarted(ManagementContext mgmt,
AssemblyTemplate at) {
    -        CampPlatform camp = getCampPlatform(mgmt).get();
    -        AssemblyTemplateInstantiator instantiator;
    -        try {
    -            instantiator = at.getInstantiator().newInstance();
    -        } catch (Exception e) {
    -            throw Exceptions.propagate(e);
    +    public static <T extends Application> EntitySpec<T> createEntitySpec(ManagementContext
mgmt, String yaml) {
    +        Collection<String> types = new ArrayList<String>();
    +        for(PlanToSpecTransformer c : PlanToSpecFactory.all(mgmt)) {
    --- End diff --
    
    [minor] add trailing space after for


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message