1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

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:

  1. Change org.eclipse.equinox.cm to 1.
  2. 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.

SolarNetwork OSGi Framework run configuration

On the Arguments tab, change the Working directory to be ${workspace_loc:solarnetwork-osgi-target}.

SolarNetwork OSGi Framework run configuration arguments

On the Settings tab, change the Execution environment to Java-SE 1.6 and enable the Clear the configuration area before launching option.

SolarNetwork OSGi Framework run configuration settings

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.

OSGi prompt

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