[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] How to use DS?


John Wells (Aziz)
jwells@xxxxxxxxxxxxx

So I see that DS was added as source to Equinox 13 days ago.  But I do
not understand how to use it.  There does not seem to be an associated
bundle to download and try out.  (And in fact the specification almost
seems to indicate that DS must be part of the framework itself anyway -
though it never directly says it).

I have downloaded the Thu, 22 Dec 2005 framework and bundle jars (This
is build N20051222-0010).  There doesn't seem to be any bundles in that
set of bundles that exports the org.osgi.service.component package.  So,
I'm guessing that I am missing a bundle somewhere.  In order to get DS
what do I need to do?  Do I need to build it myself (please tell me this
isn't true, I have had incredible problems figuring out how to build
these things from the repo for some reason).

Here is what I have in my manifest:

Service-Component: OSGI-INF/components.xml

Here is what is in my components.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<scr:component
  xmlns:scr="http://www.osgi.org/xmlns/scr/v1.0.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://www.osgi.org/xmlns/scr/v1.0.0 scr.xsd "
  name="com.bea.comp.dummy"
  immediate="true">
  <implementation class="com.bea.comp.Dummy"/>
  <service>
    <provide interface="com.bea.com.Dummy" />
  </service>
</scr:component>

Dummy does nothing but do System.out in the constructor, activator and
deactivator:

package com.bea.comp;

import org.osgi.service.component.ComponentContext;

public class Dummy {
  public Dummy() {
    System.out.println("Dummy null constructor called");
  }
  
  protected void activate(ComponentContext ctxt) {
    System.out.println("Dummy component activate called");
  }
  
  protected void deactivate(ComponentContext ctxt) {
    System.out.println("Dummy component deactivate called");
  } 
}

Someone tell me how to make this work?

John Wells (Aziz)
jwells@xxxxxxxxxxxxx