[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Looking for a working example for services

Roy is correct.

So you bundle has to be started (you don't need a BundleActivator though).

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=135885 for some 
discussion on making DS work better with Eclipse-LazyStart.

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@xxxxxxxxxx
Office: +1 407 849 9117 Mobile: +1 386 848 3788



Roy Paterson/Austin/IBM@IBMUS 
Sent by: equinox-dev-bounces@xxxxxxxxxxx
2006-05-12 02:00 PM
Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>


To
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>
cc
equinox-dev@xxxxxxxxxxx, equinox-dev-bounces@xxxxxxxxxxx
Subject
Re: [equinox-dev] Looking for a working example for services






You are confusing the service-component lifecycle with the bundle
lifecycle.  This is understandable - it's confusing!

The service-component lifecycle exists completely within the bundle's
lifecycle.   Like this:

Bundle - INSTALLED
Bundle - RESOLVED
Bundle - ACTIVE

      Service Component - ACTIVATED
      Service Component - DEACTIVATED

Bundle - STOPPED

The state you see in the OSGi console is the Bundle State.  Declarative
Services will not change your bundle state in any way.  SCR (The
Declarative Services runtime) will only act on the Service Components in
your bundle after the bundle has been put in the active state.

So start your bundle!

Regards,
Roy Paterson

-----------------------------------------
Roy Paterson
IBM Pervasive Computing
Austin, TX
Phone: (512) 838-8898



 
             "Cameron Ross" 
             <cross@symboticwa 
             re.com>                                                    To 

             Sent by:                  <equinox-dev@xxxxxxxxxxx> 
             equinox-dev-bounc                                          cc 

             es@xxxxxxxxxxx 
                                                                   Subject 

                                       [equinox-dev] Looking for a working 

             05/12/2006 12:56          example for services 
             PM 
 
 
             Please respond to 
                  Equinox 
                development 
               mailing list 
             <equinox-dev@ecli 
                 pse.org> 
 
 




Hello,

I'm creating an OSGi component using equinox declarative services.  The
osgi console indicates that my Activator only makes it into the "RESOLVED"
state.  However, page 281 of the OSGi Service Platform Service Compendium
for R4, states that an "immediate component is activated as soon as its
dependencies are satisfied".  It appears to me that my component should be
an "immediate component" and I would, therefore, expect it to move into 
the
"ACTIVE" state.  My component description and activator class follow:

<component name="example.activator">
    <implementation class="example.Activator"/>
</component>

public class Activator {
    public Activator() {
    }

    protected void activate(ComponentContext context) {
        System.out.println("Activator.activate()");
    }

    protected void deactivate(ComponentContext context) {
        System.out.println("Activator.deactivate()");
    }
}


Any help is very much appreciated.

Cameron Ross.
 _______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev


_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev