SolarNode Development Process Guide
This guide details some general points about developing with the SolarNode code within the SolarNode Eclipse development environment. It assumes you have set up your Eclipse workspace as described on SolarNode Development Guide and you are familiar with the general configuration methods as described on SolarNode Development Configuration Guide.
Configuring an OSGi Framework run configuration
To launch and debug the SolarNode application within Eclipse, you need to create an OSGi Framework run configuration. This only needs to be configured once. To do this, go to the Run > Run Configurations... dialog and right-click on the OSGi Framework type and choose New.
In the options are for the new run configuration, name the configuration something like SolarNetwork?.
Then on the Bundles tab you will want to leave all listed bundles selected, but change is the start level of the following two bundles:
- Change org.eclipse.equinox.cm to 1.
- Change org.ops4j.pax.configmanager to 2.
Changing the start level of these two bundles will ensure that custom application configuration properties (described here) are loaded first when the application starts.
On the Arguments tab, change the Working directory to be ${workspace_loc:solarnetwork-osgi-target}.
On the Settings tab, change the Execution environment to Java-SE 1.6 and enable the Clear the configuration area before launching option.
Running or debugging
To run or debug the application after setting up the run configuration, simply use the Run > Run Configurations... menu, select the SolarNetwork? run configuration, and click the Run button. Similarly to debug, use the Run > Debug Configurations... menu.
Eclipse will launch the OSGi platform in the background, and attach the OSGi console to the Eclipse Console view. After a short while, assuming all went well, you should lines similar to the following in the Console:
Feb-08 22:00:28 INFO org.springframework.scheduling.quartz.SchedulerFactoryBean - Starting Quartz Scheduler now, after delay of 60 seconds Feb-08 22:00:28 INFO org.quartz.core.QuartzScheduler - Scheduler Solar Node_$_NON_CLUSTERED started.
And after this the application will start running any configured jobs.
Interacting with OSGi
You can interact with OSGi using standard OSGi commands on the console. If you don't see the osgi> prompt, click on the conolse and hit the enter key.
You can issue any standard OSGi command supported by Equinox, such as ss for a listing of installed bundles or refresh to reload an active bundle.
Shutting down OSGi
To cleanly shut down the OSGi framework once launched, use the Console to issue the shutdown command, followed by the exit command.
Attachments
-
osgi-run-configuration.png
(44.6 KB) - added by msqr
2 years ago.
SolarNetwork? OSGi Framework run configuration
-
osgi-run-configuration-args.png
(35.2 KB) - added by msqr
2 years ago.
SolarNetwork? OSGi Framework run configuration arguments
-
osgi-run-configuration-settings.png
(36.9 KB) - added by msqr
2 years ago.
SolarNetwork? OSGi Framework run configuration settings
-
osgi-prompt.png
(9.4 KB) - added by msqr
2 years ago.
OSGi prompt



