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

Sergey Beryozkin commented on ARIES-1121:
-----------------------------------------

Few comments on the proposed service interface:

{code:java}
public interface BlueprintExtenderService {
    BlueprintContainer createContainer(Bundle bundle);

    BlueprintContainer createContainer(Bundle bundle, List<Object> 
blueprintPaths);

    BlueprintContainer getContainer(Bundle bundle);

    void destroyContainer(Bundle bundle, BlueprintContainer container);
}
{code}

I don't think it needs to become more complex, but I reckon it may not be quite 
as minimalistic as it can be.

Specifically, "createContainer(Bundle bundle)" method is likely to be redundant 
in most cases, because if the bundle has Blueprint metadata then the extender 
has already created a context and thus "getContainer(Bundle bundle)" is enough. 
That said, having this method probably won't harm.

Next, "destroyContainer(Bundle bundle, BlueprintContainer container)" - 
probably is redundant as well, because the extender is listening on the bundles 
so it can remove a container itself. Again, may be keeping won't harm - may be 
doing a pro-active clean up can make sense in some cases. The 2nd parameter in 
this method is redundant for sure, but I thought the caller should not have a 
too easy way to destroy a container for a given bundle.

The thing I've been thinking about: this service interface can be moved to its 
own module, if really needed, so that only those applications that need this 
service will install this module. That can be easily done but I wonder it it 
will be pushing it a bit too far. 




> Introduce BlueprintExtenderService to simplify managing BlueprintContainers 
> from the code
> -----------------------------------------------------------------------------------------
>
>                 Key: ARIES-1121
>                 URL: https://issues.apache.org/jira/browse/ARIES-1121
>             Project: Aries
>          Issue Type: Improvement
>          Components: Blueprint
>            Reporter: Sergey Beryozkin
>            Assignee: Sergey Beryozkin
>         Attachments: aries1121.txt
>
>
> It is not easy to create BlueprintContainers from the code, with 
> BlueprintExtender being the main piece of code dealing with the containers.
> Proposal: Introduce  BlueprintExtenderService which will make it 
> straght-forward for interested consumers to create and use 
> BlueprintContainers.
> The patch for the community review is to follow. Another JIRA supporting a 
> specific use case will be opened shortly too



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to