@Component(
label = "Service name",
description = "Service description",
metatype = true,
immediate = false)
@Properties({
@Property(
label = "Vendor",
name = Constants.SERVICE_VENDOR,
value = "Customer",
propertyPrivate = true
)
})
@Service
public class SampleServiceImpl implements SampleService {
private final Logger log =
LoggerFactory.getLogger(this.getClass());
/**
* OSGi Properties *
*/
private static final boolean DEFAULT_SAMPLE = false;
private boolean enabled = DEFAULT_SAMPLE;
@Property(label = "Prop name",
description = "Prop description",
boolValue = DEFAULT_SAMPLE)
public static final String PROP_SAMPLE = "prop.sample";
...
@Activate
protected void activate(final Map<String, String> config) { }
@Deactivate
protected void deactivate(final Map<String, String> config) { }
}
Saturday, 6 September 2014
OSGi Service Declaration
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment