Skip to content

InstallingDsp

Marcello de Sales edited this page Dec 18, 2009 · 1 revision

Pre-requirements

  • [http://www.java.net Java 5.x] or newer;
  • [http://www.eclipse.org] Eclipse 3.x] or newer;
  • [http://www.knopflerfish.org Knopflerfish 2.1.1] or newer;

Checking out DSP from the repository

First, you need to check out the newest version of DSP that is under trunk. At this point of writing, revision r42 is the first working [DspReleases release of DSP 0.1]. Follow the link for more information about each of the releases.

1. Create a new project on Eclipse ==

You will create a new project by importing from SVN repository. Right-click on the package explorer and choose "Import"; At this point, choose the option "SVN -> Checkout Projects from SVN", and enter the following SVN repository path.

https://netbeams.googlecode.com/svn/trunk/versions/v2	

Follow the instructions to create a new Project with the name you want, or just use Eclipse's suggestion. Confirm all the other screens and wait Eclipse check all the files out of the repository.

2. Updating the Java Build Paths and Needed Libraries

The next step is necessary to identify the source code paths and the needed library to make the source code compile while developing on Eclipse. This is an independent task from the ones from ANT, which automatically selects the needed library.

Right-click on the name of the created project and click on "Properties". That will open a dialog screen with four tabs: You need to update the Source and Libraries.

As it opens on the Source tab, click on Add folder button. A new dialog screen will ask about which directories you want to select. Navigate through the following one:

   /apps/osgi-bundles/dsp/

For each directory on the dsp directory, expand it and select the src directory. That should be done to the following:

  • DSPFramework/src
  • DSPPlatform/src
  • ...
  • ...

When you click in the button Ok, the list of the source files are going to be updated with the ones you just selected.

The next items to be added are the libraries. Click on the tab Libraries and then click in the button Add Jars.... At this point, you should see all the libraries under the thirdparty directory, which is used by the build system to compile and package the OSGi bundles.

   /thirdparty/libraries

Select the following ones:

  • Knopflerfish/2.1.x/framework
  • jdom/jdom.jar
  • apache/log4j-1.2.15.jar
  • apache/xerces.jar
  • apache/xml-apis.jar

If you try to compile and you can't find classes, just refer to one of the jars under the directory thirdparty.

Clicking in the button Ok on the main dialog, your Package Explorer view will be updated with the list of source filtered by bundles and on each of the by packages.

3. Running the build systems using Apache ANT

It's time to generate some code automatically. Now, open the Apache Ant view by click on "Windows -> Show View -> Ant". This might open a blank view on the Eclipse Workspace. Located it and click on the first icon (+ant).

When the dialog opens, navigate to each of the projects under the each of the bundle projects as before and locate the file build.xml for each of the project. After you click in the button Ok, the Ant view is updated with the following builds:

|| Name on Ant View || Project File || Description || || DSP Core || DSPFramework/build.xml || Used for setting up environment || || DSP Demo - Stock Consumer || DSPPlatform/build.xml || Stock consumer for the demo || || DSP Demo - Stock Data || DSPStockData/build.xml || Stock data representation for the demo || || DSP Demo - Stock Producer || DSPStockConsumer/build.xml || Stock producer for the demo || || DSP Framework || DSPFramework/build.xml || DSP Framework Bundle || || DSP Platform || DSPPlatform/build.xml || DPS Platform Bundle ||

You need to specify some environment variables yourself on the DSP Core file. So, right-click on that and choose to open the file using the Ant Editor. When the file is opened in the Workspace, locate and update the following code snippet with the information of your system:

	<!-- DEVELOPMENT CONSTANT NECESSARY: KNOPFLERFISH_HOME -->
    <property name="KNOPFLERFISH.HOME" location="/home/marcello/development/workspaces/opensource/knopflerfish2.1.0/knopflerfish.org" />
	<!-- DEVELOPMENT CONSTANT NECESSARY: DSP_HOME -->
	<property name="DSP.HOME" value="/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General" />
	<!-- DEVELOPMENT CONSTANT OPTIONAL: DSP.KNOPFLERFISH.EXEC 
	   The name of the script to execute knopflerfish with support  to DSP, Log4J, etc. -->
	<property name="DSP.KNOPFLERFISH.EXEC" value="start-knopflerfish-for-dsp" />

|| Property name || Description || || KNOPFLERFISH.HOME || The home directory where you first installed Knopflerfish || || DSP.HOME || The home directory where you checked out the DSP from the subversion repository || || DSP.KNOPFLERFISH.EXEC || The optional name of the script used to start knopflerfish with support to Log4J. ||

When you've updated this file and saved, just double-click on each of them on the Ant View at the following order:

DSP Core - Should create runtime directories for the demo and deployment of DSP.

Buildfile: /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/build.xml
     [echo] CORE.DIR=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/
     [echo] DSP.BUNDLES=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/apps/osgi-bundles
     [echo] FRAMEWORK=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/apps/osgi-bundles/DSPFramework
     [echo] PLATFORM=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/apps/osgi-bundles/DSPPlatform
     [echo] THIRDPARTY=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/thirdparty
     [echo] DSP.RUNTIME=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime
     [echo] DSP.VERSION=0.1
     [echo] imported.basedir=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2
     [echo] running.file=/home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/build.xml
setup:
    [mkdir] Created dir: /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime
    [mkdir] Created dir: /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime/demos/stocks
    [mkdir] Created dir: /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime/deployment
     [copy] Copying 1 file to /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime/deployment
     [move] Moving 1 file to /home/marcello/development/workspaces/opensource/knopflerfish2.1.0/knopflerfish.org/osgi
BUILD SUCCESSFUL
Total time: 287 milliseconds

DSPFramework - Generates the Bundle of the DSP Framework

init:
compile:
jar:
      [jar] Building jar: /home/marcello/development/workspaces/sfsu/netBEAMS2 OSGi General/versions/v2/runtime/DSPFramework-0.1.jar
all:
BUILD SUCCESSFUL
Total time: 508 milliseconds

The same for the remaining files build files:

DSPPlatform,

DSP Demo - Stock Data,

DSP Demo - Stock Producer,

DSP Demo - Stock Consumer

They must run without problems. They will create the following directory structure:

|| Directory under v2 directory || Description || || runtime || Where the main DSP framework bundles are going to be placed. They will be used on Knopflerfish or any other OSGi framework|| || runtime/deployment/ || Where the demos will be located ||

The execution of the build.xml files will generate the bundle jar in the correct place, together with its current version. NOTE THAT THIS DIRECTORY CAN'T BE COMMITTED TO THE REPOSITORY. IT IS JUST FOR RUNTIME PURPOSES

As a result, here are the list of files generated:

  • /v2/runtime/DSPFramework-0.1.jar: The main framework bundle;
  • /v2/runtime/DSPPlatform-0.1.jar: The main platform bundle;
  • /v2/runtime/matcher_config_xml: configuration for the matcher.
  • /v2/runtime/deployment: The bundles to be used by the DSP platform are created under the deployment directory
  • /v2/runtime/deployment/DSPStockConsumer-0.1.jar: The main consumer bundle;
  • /v2/runtime/deployment/DSPStockProducer-0.1.jar: The main producer bundle;
  • /v2/runtime/deployment/DSPStockData-0.1.jar: The main data bundle;
  • /v2/runtime/deployment/config.xml: configuration on the loading of the demo.

An execution script is created under the KNOPFLERFLISH_HONE/osgi/ directory, as per the value of the environment variable DSP.KNOPFLERFISH.EXEC you configured before.

At this point, you have set up DSP into your machine using Knopflerfish. Execute the following script (substitute the values by the ones you configured):

   cd KNOPFLERFLISH_HONE/osgi/
   ./DSP.KNOPFLERFISH.EXEC