Dark Planet Development Platform

Get Dark Planet Development Platform at SourceForge.net. Fast, secure and Free Open Source software downloads

Quick Start 1: A DPS Application Using the Stub Reference Implementations

Technically, you can run DPS without any API implementations but that's not very interesting. This tutorial shows you how to setup DPS using the stub API implementations, which is only marginally more interesting. Many applications will not require implementations for all the APIs. The stub implementations are an easy way to make sure all the APIs are at least implemented and return something useful (in this case, an UnsupportedOperationException) if someone tries to use an unimplemented part of the API. One you get the stub configuration working, you can replace the stubs with more useful reference implementations (or write your own). If you haven't already, read the pre-requisites tutorial to make sure your Eclipse environment is set up properly.

To get started with the stub implementations, download or checkout the following bundles:

Extract each of these bundles as an Eclipse project. For the "helloworld" bundle, it's best if you extract as a source bundle so you can modify the code as we do in later tutorials.

You can test your installation as follows: In Eclipse, select Run->Run Configurations... You should see "RunHelloWorld" under the "OSGi Framework" section. Select "RunHelloWorld" and click "Run". If all goes well, you should see something like this in the OSGi console:

    EveData registered
    EveDatabase registered
    EveServer registered
    PersistenceFactory registered
    EveMarketData registered
    HelloWorld started!
    IEveDataModel = org.dps.core.impl.model.stub.EveDataModelStub@3b5e234c
    IEveDatabase = org.dps.core.impl.database.stub.EveDatabaseStub@215f7107
    IEveServerRequest = org.dps.core.impl.server.stub.EveServerStub@f593af
    IEvePersistenceFactory = org.dps.core.impl.persist.stub.EvePersistenceFactoryStub@7ab2c6a6
    IEveMarketData = org.dps.core.impl.market.stub.EveMarketStub@236527f
    HelloWorld stopped!

If you see this, then you've successfully run the "Hello, World!" application using the DPS stubs. Here's what's happening under the covers:

The "Hello, World!" application is a useful tool for making sure you're pulling in proper dependencies. Note that you can include the org.dps.app.helloworld bundle any time you like in one of your own applications. OSGi will start the bundle, just like any other bundle, once all of its dependencies have been met.

The "RunHelloWorld" launcher is also a good template to use for your own projects. Some other things you might want to add to this launcher (you can do this by selecting Run->l;Run Configurations... to pull up the launcher editor, or just edit the xml directly):

Now what?

The next step is to replace the stub implementations with something more interesting. See the tutorials section for a few examples of adding in the reference implementations.