public class ContentLoaderService extends Object implements org.osgi.framework.SynchronousBundleListener, BundleHelper
ContentLoaderService is the service
providing the following functionality:
| Modifier and Type | Field and Description |
|---|---|
static String |
BUNDLE_CONTENT_NODE |
static String |
PROPERTY_CONTENT_LOADED |
static String |
PROPERTY_CONTENT_LOADED_AT |
static String |
PROPERTY_UNINSTALL_PATHS |
protected org.apache.sling.settings.SlingSettingsService |
settingsService
Sling settings service.
|
| Constructor and Description |
|---|
ContentLoaderService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.framework.BundleContext bundleContext)
Activates this component, called by SCR before registering as a service
|
void |
bundleChanged(org.osgi.framework.BundleEvent event)
Loads and unloads any content provided by the bundle whose state
changed.
|
void |
contentIsUninstalled(javax.jcr.Session session,
org.osgi.framework.Bundle bundle) |
void |
createRepositoryPath(javax.jcr.Session writerSession,
String repositoryPath) |
protected void |
deactivate(org.osgi.framework.BundleContext bundleContext)
Deactivates this component, called by SCR to take out of service
|
Map<String,Object> |
getBundleContentInfo(javax.jcr.Session session,
org.osgi.framework.Bundle bundle,
boolean create)
Return the bundle content info and make an exclusive lock.
|
String |
getMimeType(String name)
Returns the MIME type from the MimeTypeService for the given name
|
protected org.apache.sling.jcr.api.SlingRepository |
getRepository()
Returns the JCR repository used by this service.
|
javax.jcr.Session |
getSession()
Returns an administrative session to the default workspace.
|
javax.jcr.Session |
getSession(String workspace)
Returns an administrative session for the named workspace.
|
void |
unlockBundleContentInfo(javax.jcr.Session session,
org.osgi.framework.Bundle bundle,
boolean contentLoaded,
List<String> createdNodes) |
public static final String PROPERTY_CONTENT_LOADED
public static final String PROPERTY_CONTENT_LOADED_AT
public static final String PROPERTY_UNINSTALL_PATHS
public static final String BUNDLE_CONTENT_NODE
protected org.apache.sling.settings.SlingSettingsService settingsService
public void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerevent - The BundleEvent representing the bundle state
change.public String getMimeType(String name)
getMimeType in interface ContentHelpername - the name of the file to get the mimeType forpublic void createRepositoryPath(javax.jcr.Session writerSession,
String repositoryPath)
throws javax.jcr.RepositoryException
createRepositoryPath in interface BundleHelperjavax.jcr.RepositoryExceptionprotected void activate(org.osgi.framework.BundleContext bundleContext)
protected void deactivate(org.osgi.framework.BundleContext bundleContext)
protected org.apache.sling.jcr.api.SlingRepository getRepository()
public javax.jcr.Session getSession()
throws javax.jcr.RepositoryException
getSession in interface BundleHelperjavax.jcr.RepositoryExceptionpublic javax.jcr.Session getSession(String workspace) throws javax.jcr.RepositoryException
getSession in interface BundleHelperjavax.jcr.RepositoryExceptionpublic Map<String,Object> getBundleContentInfo(javax.jcr.Session session, org.osgi.framework.Bundle bundle, boolean create) throws javax.jcr.RepositoryException
getBundleContentInfo in interface BundleHelpersession - bundle - javax.jcr.RepositoryExceptionpublic void unlockBundleContentInfo(javax.jcr.Session session,
org.osgi.framework.Bundle bundle,
boolean contentLoaded,
List<String> createdNodes)
throws javax.jcr.RepositoryException
unlockBundleContentInfo in interface BundleHelperjavax.jcr.RepositoryExceptionpublic void contentIsUninstalled(javax.jcr.Session session,
org.osgi.framework.Bundle bundle)
contentIsUninstalled in interface BundleHelperCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.