Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Sample Component with DS annotations
package blog.techrevel.component.impl;
import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Deactivate;
@Component(name = "Sample Component", property = { "testProperty=Hello" })
public class SampleComponentImpl {
private static final Logger LOGGER = LoggerFactory.getLogger(SampleComponentImpl.class);
protected void activate(ComponentContext componentContext) {"Registering: " + componentContext.getProperties().get("testProperty").toString());
protected void deactivate(ComponentContext componentContext) {"Deregistering: " + componentContext.getProperties().get("testProperty").toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.