Skip to content

Instantly share code, notes, and snippets.

@stormworm29
Last active December 13, 2021 14:29
Show Gist options
  • Save stormworm29/72ada2568a547610b1b31514582f1ad8 to your computer and use it in GitHub Desktop.
Save stormworm29/72ada2568a547610b1b31514582f1ad8 to your computer and use it in GitHub Desktop.
package com.mysite.core.config;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import javax.annotation.PostConstruct;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
@Model(adaptables = Resource.class)
public class OSGIModel {
@OSGiService
private OSGIClient OsgiClient;
private String osgiConfig;
public void postConstruct() throws Exception {
this.osgiConfig = OsgiClient.execute();
}
public String getOsgiconfig() {
return osgiConfig;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment