Last active
December 25, 2015 16:19
-
-
Save joemaffia/7004497 to your computer and use it in GitHub Desktop.
Adobe CQ OSGi service using SCR annotations.
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.company.cq.services; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Properties; | |
import org.apache.felix.scr.annotations.Property; | |
import org.apache.felix.scr.annotations.Service; | |
import org.osgi.framework.Constants; | |
/** | |
* Example OSGi service using SCR annotations. | |
*/ | |
@Component(immediate = true, metatype = true) | |
@Service(GoodbyeWorldService.class) | |
@Properties({ | |
@Property(name = Constants.SERVICE_VENDOR, value = "CQ Blueprints"), | |
@Property(name = Constants.SERVICE_DESCRIPTION, value = "Provides a friendly farewell.") | |
}) | |
public class GoodbyeWorldService { | |
public String getMessage(String name) { | |
return String.format("Goodbye %s!", name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment