Hi Rajika,

Thanks for the pointers.
In the feature-manager we are using p2 sdk, calling the p2-api under the
hood.

For eg: to add and load a repository following code is used by us.

IMetadataRepositoryManager metadataRepositoryManager =
ServiceHolder.getMetadataRepositoryManager();
IArtifactRepositoryManager artifactRepositoryManager =
ServiceHolder.getArtifactRepositoryManager();

            //adding metadata and artifact repositories
            metadataRepositoryManager.addRepository(location);
            artifactRepositoryManager.addRepository(location);
            //Loading the metadata repository
            metadataRepositoryManager.loadRepository(location, new
NullProgressMonitor());
            metadataRepositoryManager.setRepositoryProperty(location,
IRepository.PROP_NICKNAME, nickName);

            //Loading the artifact repository
            artifactRepositoryManager.loadRepository(location, new
NullProgressMonitor());
            artifactRepositoryManager.setRepositoryProperty(location,
IRepository.PROP_NICKNAME, nickName);

First we need to clarify how p2-works under the hood when loading a
repository from a given location.
Ideally it should just index the feature list by reading the the
repository's content.xml and artifacts.xml at this point without loading
all the features to the memory ( I believe this is what you are also
suggesting).
I will discuss this with p2-dev also and see how we can improve our feature
manager based on that.

Thanks,
Dileepa

On Mon, Sep 10, 2012 at 4:12 PM, Rajika Kumarasiri <[email protected]> wrote:

> I meant the consumer task should do the feature installation
> asynchronously.
>
> Rajika
>
>
> On Mon, Sep 10, 2012 at 3:54 PM, Rajika Kumarasiri <[email protected]>wrote:
>
>> If you have not done already, here how it should be done.
>>
>> There should be an instance of blocking queue instance which keeps track
>> of requested features to install. There should be a producer task which
>> drop next requested feature list to install into the blocking queue. There
>> should be a consumer task will remove items from the blocking queue. For
>> producing and consuming use
>> http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html#put<http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html#put%28E%29>
>>  and
>> http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html#take()
>>  so
>> that your  consumer and producer task will not kill the CPU.
>>
>> Since Feature manager will not use frequently this model may not make
>> sense much, but I think it will be useful when our p2 feature repository
>> starts to grow.
>>
>> Hope this helps.
>>
>> Rajika
>>
>> On Mon, Sep 10, 2012 at 2:47 PM, Dileepa Jayakody <[email protected]>wrote:
>>
>>> Hi Rajika,
>>>
>>> Is the repository you are adding a local-repository or a remote
>>> repository?
>>>
>>> Thanks,
>>> Dileepa
>>>
>>> On Mon, Sep 10, 2012 at 2:44 PM, Rajika Kumarasiri <[email protected]>wrote:
>>>
>>>> I just tried to add the feature repository of 4.0.1 into a AS (built
>>>> from 4.0.1 branch) and it seems it just take too much time.
>>>>
>>>> I still can see the message "Adding repository.." and it just there.
>>>>
>>>> This need to improve. We just need to load the list features (just
>>>> names) and install any selected features asynchronously.
>>>>
>>>> It seems this loads the whole features into memory.
>>>>
>>>> Rajika
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> Dileepa Jayakody,
>>> Software Engineer, WSO2 Inc.
>>> Lean . Enterprise . Middleware
>>>
>>> Mobile : +94777-857616
>>>
>>>
>>
>


-- 
Dileepa Jayakody,
Software Engineer, WSO2 Inc.
Lean . Enterprise . Middleware

Mobile : +94777-857616
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to