Created
December 13, 2021 12:00
-
-
Save stormworm29/c5608454df10aed05d91e42a4d97d10f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mysite.core.config; | |
import java.util.Objects; | |
import org.apache.commons.lang3.StringUtils; | |
import org.osgi.service.component.annotations.Activate; | |
import org.osgi.service.component.annotations.Component; | |
import org.osgi.service.metatype.annotations.Designate; | |
/** | |
* OSGi client service provides configuration. | |
*/ | |
@Component(name="com.mysite.core.config.OSGIClient", service = OSGIClient.class,immediate = true) | |
@Designate(ocd = OSGIClientConfiguration.class) | |
public class OSGIClientImpl implements OSGIClient{ | |
private OSGIClientConfiguration configuration; | |
@Activate | |
protected void activate(OSGIClientConfiguration configuration) { | |
this.configuration = configuration; | |
} | |
@Override | |
public String execute() { | |
String config = configuration.getConfig(); | |
if(Objects.isNull(config)) | |
config = StringUtils.EMPTY; | |
return config; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment