Package com.adobe.acs.commons.util
Class ResourceServiceManager
java.lang.Object
javax.management.StandardMBean
com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
com.adobe.acs.commons.util.ResourceServiceManager
- All Implemented Interfaces:
ResourceServiceManagerMBean,DynamicMBean,MBeanRegistration,org.osgi.service.event.EventHandler
public abstract class ResourceServiceManager
extends com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
implements ResourceServiceManagerMBean, org.osgi.service.event.EventHandler
Base class for services to extend which want to manage other services based
on repository configurations.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(org.osgi.service.component.ComponentContext context) voiddeactivate(org.osgi.service.component.ComponentContext context) org.osgi.framework.BundleContextprotected abstract org.apache.sling.api.resource.ResourceResolverGet a resource resolver to access the Sling Repository.abstract StringGet the root path for the instance of the ResourceServiceManager, the configuration should be cq:Page children of the resource at this path.voidhandleEvent(org.osgi.service.event.Event event) protected abstract booleanisServiceUpdated(org.apache.sling.api.resource.Resource config, org.osgi.framework.ServiceReference reference) Checks whether or not the specified ServiceReference is up to date with the configuration resource.voidprotected abstract org.osgi.framework.ServiceRegistrationregisterServiceObject(org.apache.sling.api.resource.Resource config, Hashtable<String, Object> props) Register the service with the OSGi Container based on the configuration.Methods inherited from class com.adobe.granite.jmx.annotation.AnnotatedStandardMBean
getAnnotation, getConstructor, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getMethod, getParamAnnotation, getParamAnnotation, getParameterName, getParameterName, getReadMethod, getWriteMethodMethods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
Field Details
-
SERVICE_OWNER_KEY
- See Also:
-
CONFIGURATION_ID_KEY
- See Also:
-
-
Constructor Details
-
ResourceServiceManager
- Throws:
NotCompliantMBeanException
-
-
Method Details
-
activate
@Activate public void activate(org.osgi.service.component.ComponentContext context) throws org.apache.sling.api.resource.LoginException - Throws:
org.apache.sling.api.resource.LoginException
-
deactivate
@Deactivate public void deactivate(org.osgi.service.component.ComponentContext context) throws org.apache.sling.api.resource.LoginException - Throws:
org.apache.sling.api.resource.LoginException
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext() -
getRegisteredConfigurations
- Specified by:
getRegisteredConfigurationsin interfaceResourceServiceManagerMBean
-
getRegisteredServices
-
getResourceResolver
protected abstract org.apache.sling.api.resource.ResourceResolver getResourceResolver()Get a resource resolver to access the Sling Repository.- Returns:
- the resource resolver
-
getRootPath
Get the root path for the instance of the ResourceServiceManager, the configuration should be cq:Page children of the resource at this path.- Returns:
- the configuration root
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) - Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler
-
isServiceUpdated
protected abstract boolean isServiceUpdated(org.apache.sling.api.resource.Resource config, org.osgi.framework.ServiceReference reference) Checks whether or not the specified ServiceReference is up to date with the configuration resource.- Parameters:
config- the configuration resourcereference- the service reference to check- Returns:
- true if the ServiceReference is up to date with the resource, false otherwise
-
refreshCache
public void refreshCache()- Specified by:
refreshCachein interfaceResourceServiceManagerMBean
-
registerServiceObject
protected abstract org.osgi.framework.ServiceRegistration registerServiceObject(org.apache.sling.api.resource.Resource config, Hashtable<String, Object> props) Register the service with the OSGi Container based on the configuration.- Parameters:
config- the configuration resourceprops- the default properties- Returns:
- the ServiceRegistration from registering the service
-