Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ApplicationConfiguration DS example(configure method never executed when running as a component.)
ApplicationConfiguration DS example [message #1060972] Wed, 29 May 2013 11:29 Go to next message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
Hi,

First of all, my apologies for all the spam here. I am really trying to figure out things on my own first, but every now and again you hit this wall that is just too high.

One the last steps I am working on is dropping the Activator, and creating a DS component for my service. That seems straightforward if you read the documentation. However, for some reason, most likely because I doing something wrong, it doesn't work.

I have implemented my definition similar to the sample definition below but the configure method is never called.

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
  <implementation class="com.example.SimpleConfiguration"/>
  <service>
     <provide interface="org.eclipse.rwt.application.ApplicationConfiguration"/>
  </service>
  <property name="contextName" type="String" value="example"/>
</scr:component>


When I add activator and deactivator method, they are hit when I define them in the component. This indicates to me that the DS bundle is doing it's work. The configure() method is never called though.

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
  <implementation class="com.example.SimpleConfiguration enabled="true" immediate="true" name="com.example.test" activate="activate" deactivate="deactivate"/>
  <service>
     <provide interface="org.eclipse.rwt.application.ApplicationConfiguration"/>
  </service>
  <property name="contextName" type="String" value="example"/>
</scr:component>


Obviously I am still missing a piece of the puzzle. I have spent numerous hours searching the web for a hint or a complete example, to no avail.

So, as always, any help is greatly appreciated.

Kind Regards,

Erwin


Re: ApplicationConfiguration DS example [message #1061005 is a reply to message #1060972] Wed, 29 May 2013 13:38 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Erwin,
just use New Project Wizard and create a project based on "RAP Hello
World" template. The generated project uses DS.
[1]
http://www.eclipse.org/rap/developers-guide/devguide.php?topic=hello-world.html&version=2.0
Best,
Ivan

On 5/29/2013 2:29 PM, Erwin Hogeweg wrote:
> Hi,
>
> First of all, my apologies for all the spam here. I am really trying
> to figure out things on my own first, but every now and again you hit
> this wall that is just too high.
>
> One the last steps I am working on is dropping the Activator, and
> creating a DS component for my service. That seems straightforward if
> you read the documentation. However, for some reason, most likely
> because I doing something wrong, it doesn't work.
>
> I have implemented my definition similar to the sample definition
> below but the configure method is never called.
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
> <implementation class="com.example.SimpleConfiguration"/>
> <service>
> <provide
> interface="org.eclipse.rwt.application.ApplicationConfiguration"/>
> </service>
> <property name="contextName" type="String" value="example"/>
> </scr:component>
>
> When I add activator and deactivator method, they are hit when I
> define them in the component. This indicates to me that the DS bundle
> is doing it's work. The configure() method is never called though.
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
> <implementation class="com.example.SimpleConfiguration enabled="true"
> immediate="true" name="com.example.test" activate="activate"
> deactivate="deactivate"/>
> <service>
> <provide
> interface="org.eclipse.rwt.application.ApplicationConfiguration"/>
> </service>
> <property name="contextName" type="String" value="example"/>
> </scr:component>
>
> Obviously I am still missing a piece of the puzzle. I have spent
> numerous hours searching the web for a hint or a complete example, to
> no avail.
>
> So, as always, any help is greatly appreciated.
>
> Kind Regards,
>
> Erwin
>
>
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: ApplicationConfiguration DS example [message #1061013 is a reply to message #1060972] Wed, 29 May 2013 13:46 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Erwin,

it seems that you're still using RAP 1.5. If you're experimenting with
RAP, it's probably better to start with RAP 2.0 or 2.1, since there are
a lot of changes between 1.x and 2.x.

If you're unsure if your ApplicationConfiguration is properly registered
as a service, you can check the Equinox console:

osgi> services *ApplicationConfiguration
{org.eclipse.rap.rwt.application.ApplicationConfiguration}={component.name=org.eclipse.rap.demo.controls,
component.id=0, service.id=66}
"Registered by bundle:" org.eclipse.rap.demo.controls_2.1.0.qualifier
[16]
"Bundles using service"
org.eclipse.rap.rwt.osgi_2.1.0.qualifier [7]

Here's a code example for a simple project that uses DS:

https://github.com/ralfstx/rap-helpers/tree/master/example.rwt.simple.ds


Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: ApplicationConfiguration DS example [message #1061068 is a reply to message #1061013] Wed, 29 May 2013 18:39 Go to previous message
Erwin Hogeweg is currently offline Erwin HogewegFriend
Messages: 37
Registered: July 2009
Member
Ralf,

I wondered why you said this:

Quote:
it seems that you're still using RAP 1.5.


... because I am using 2.0! So I checked out your example, and it looked the same as my code, at least, that't what I though. until I spotted the typo in the ApplicationConfiguration package name in the component definition... inserted the ".rap", and everything fell magically in place.

I must have copied that from a 1.5 sample project and forgot to update to the new package names.

I am rolling again, thanks for your help.

Kind Regards,

Erwin
Previous Topic:white screen when waiting for response
Next Topic:Toolbar height
Goto Forum:
  


Current Time: Sat Nov 27 00:50:54 GMT 2021

Powered by FUDForum. Page generated in 0.07180 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top