Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Creating and starting non e4 model bundle
Creating and starting non e4 model bundle [message #1759147] Thu, 06 April 2017 15:54 Go to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
I need a bundle that provides communication between a remote computer over the internet and processes running on the machine using EventBus or EventBroker.

I can't use MAddon because they must exit after subscribing to topic(s).

I'm not sure where in the MANIFEST.MF editor you can add a bundle or/and class that is activated at application startup. I also don't know what the code would look like (a Main or Start method?)

At the bottom of section 5.1.1 (Service Layer/Essentials) in osgi.core-4.3.0.pdf they state

Persistent Identifier Provide a means for bundles to track services across Framework restarts.

I'm very interested in that because I would like my bundle to span restrarts. Any examples of how osgi services work that I could look at?

I'd also appreciate any links that you think would be useful to me.



Re: Creating and starting non e4 model bundle [message #1759277 is a reply to message #1759147] Sun, 09 April 2017 22:53 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
I've added an org.eclipse.core.runtime.applications extension with ID "comm" and with a class that implements IApplication. I also added "-application=comm" to the Program arguments section in the Arguments tab in run configurations. Both the Framework and Command-line arguments in the log have "-application=comm" at the end of their lines.

I tried 3 ways to confirm that the application plug-in starts: println(), eventBroker.post and finally a break-point in the class. All failed.

Any suggestions? I'd also like to confirm that If I did manage to get the application to run, it would share the same framework as my product (eg. share the event bus)?
Re: Creating and starting non e4 model bundle [message #1759362 is a reply to message #1759277] Mon, 10 April 2017 15:41 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
I forgot to mention that I'm running on a target platform built with the e(fx)clipse runtime only.
Re: Creating and starting non e4 model bundle [message #1759388 is a reply to message #1759362] Tue, 11 April 2017 07:56 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6363
Registered: July 2009
Senior Member
Why does an MAddon has to exit after subscribing? MAddons are there from the start until the tear down of the application
Re: Creating and starting non e4 model bundle [message #1759552 is a reply to message #1759388] Wed, 12 April 2017 23:10 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
No Message Body
Re: Creating and starting non e4 model bundle [message #1759553 is a reply to message #1759552] Wed, 12 April 2017 23:13 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
1. If MyAddon does not exit the application is never rendered.
2. The MinMaxAddon method exits after subscribing.
Re: Creating and starting non e4 model bundle [message #1759601 is a reply to message #1759553] Thu, 13 April 2017 17:46 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
Oops. I just realized that MyAddon and MinMaxAddon are constructors not methods, so of course they have to exit. So is the answer to start a thread or bundle in MyAddon? What would the code look like?
Re: Creating and starting non e4 model bundle [message #1759619 is a reply to message #1759601] Thu, 13 April 2017 22:28 Go to previous message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 40
Registered: September 2015
Member
I apologize for taking up some of your time because of my lack of knowledge and at the same time appreciate your help. I added this code to my constructor

final class MyAddonThread extends Thread{
	public void run() {
		System.out.println(eventBroker);
	}
}
(new MyAddonThread()).start();




Previous Topic:Eclipse 4 on ARM?
Next Topic:How to change default height of ListSelectionDialog
Goto Forum:
  


Current Time: Sat Nov 18 06:31:15 GMT 2017

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

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