Krys Malak | 24 Jul 15:47

NXRuntime Demo

Hi,
 
I'm trying to get the Runtime demo at https://svn.nuxeo.org/nuxeo/demo/NXRuntime running, but i happend to have some problems and the documentation didn't really help. Hope someone here has some answerrs.
 
 
First of all: the HelloWorldComponent implements Component which has to override the methods activate(ComponentContext context) and deactivate(ComponentContext context), which are never used. In opposite to the ones with the RuntimeContext as Parameter... But I included both so this works, even if it seems strange to me, but it works somehow.
 
 
Now I have two real problems:
 
Object[] messages = extension.getContributions(); does lead to an empty array and i never get to the loop:
 
        for (Object message : messages) {
            HelloMessage msg = (HelloMessage)message;
            this.messages.add(msg);
            System.out.println("Registering message: " + msg.getMessage());
        }
 
since it is empty and no extension can be registered.
 
Both the component and the HelloWorldextension of HelloWorld are registred as components are activated correctly. I just can't acces the contributions thus the real extension and I don't understand why.
 
 
 
Second Problem is the access from outside:
 
In the HelloWorldService:
 
        HelloComponent hc =  (HelloComponent)NXRuntime.getRuntime()
            .getComponent("org.nuxeo.runtime.demo.HelloComponent");
 
I can't used this, because NXRuntime is deprecated, ok so i read, that i have to use Framework.getRuntime(). instead. But this only gives me a null Pointer Exception so I can't access the components when i'm not inside the RuntimeContext...
 
 
 
I am running Jboss 4.05 with the NXRuntime.sar deployed. The only corrections i made to the original example involed the two necessary methods in HelloComponent due to its abstract superclass Component and I changed the NXRuntime to Framwork inside the Jboss Demo.
 
That's it.
 
Hope you can find some time to help me with these issues.
 
 
Cheers,
Krys
 
_______________________________________________
ECM mailing list
ECM@...
http://lists.nuxeo.com/mailman/listinfo/ecm
Bogdan Stefanescu | 24 Jul 18:31

Re: NXRuntime Demo

Hi Krys,

These examples are quite old - they were not updated from a long time - 
this is why they doesn't works with latest runtime versions.

I will fix them and let you known when done.

Bogdan

Krys Malak wrote:
> Hi,
>  
> I'm trying to get the Runtime demo at 
> https://svn.nuxeo.org/nuxeo/demo/NXRuntime running, but i happend to 
> have some problems and the documentation didn't really help. Hope 
> someone here has some answerrs.
>  
>  
> First of all: the HelloWorldComponent implements Component which has 
> to override the methods activate(ComponentContext context) and 
> deactivate(ComponentContext context), which are never used. In 
> opposite to the ones with the RuntimeContext as Parameter... But I 
> included both so this works, even if it seems strange to me, but it 
> works somehow.
>
>  
>  
> Now I have two real problems:
>  
> Object[] messages = extension.getContributions(); does lead to an 
> empty array and i never get to the loop:
>  
>         for (Object message : messages) {
>             HelloMessage msg = (HelloMessage)message;
>             this.messages.add(msg);
>             System.out.println("Registering message: " + 
> msg.getMessage());
>         }
>  
> since it is empty and no extension can be registered.
>  
> Both the component and the HelloWorldextension of HelloWorld are 
> registred as components are activated correctly. I just can't acces 
> the contributions thus the real extension and I don't understand why.
>  
>  
>  
> Second Problem is the access from outside:
>  
> In the HelloWorldService:
>  
>         HelloComponent hc =  (HelloComponent)NXRuntime.getRuntime()
>             .getComponent("org.nuxeo.runtime.demo.HelloComponent");
>  
> I can't used this, because NXRuntime is deprecated, ok so i read, that 
> i have to use Framework.getRuntime(). instead. But this only gives me 
> a null Pointer Exception so I can't access the components when i'm not 
> inside the RuntimeContext...
>  
>  
>  
> I am running Jboss 4.05 with the NXRuntime.sar deployed. The only 
> corrections i made to the original example involed the two necessary 
> methods in HelloComponent due to its abstract superclass Component and 
> I changed the NXRuntime to Framwork inside the Jboss Demo.
>  
> That's it.
>  
> Hope you can find some time to help me with these issues.
>  
>  
> Cheers,
> Krys
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> ECM mailing list
> ECM@...
> http://lists.nuxeo.com/mailman/listinfo/ecm
>   

Gmane