org.apache.sling.jcr.contentloader.internal
Class ContentLoaderService

java.lang.Object
  extended by org.apache.sling.jcr.contentloader.internal.ContentLoaderService
All Implemented Interfaces:
java.util.EventListener, JcrContentHelper, org.osgi.framework.BundleListener, org.osgi.framework.SynchronousBundleListener

@Properties(value={@Property(name="service.vendor",value="The Apache Software Foundation"),@Property(name="service.description",value="Apache Sling Content Loader Implementation")})
public class ContentLoaderService
extends java.lang.Object
implements org.osgi.framework.SynchronousBundleListener, JcrContentHelper

The ContentLoaderService is the service providing the following functionality:


Field Summary
static java.lang.String BUNDLE_CONTENT_NODE
           
static java.lang.String PROPERTY_CONTENT_LOADED
           
static java.lang.String PROPERTY_CONTENT_LOADED_AT
           
static java.lang.String PROPERTY_UNINSTALL_PATHS
           
protected  org.apache.sling.engine.SlingSettingsService settingsService
          Sling settings service.
 
Constructor Summary
ContentLoaderService()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
          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)
           
protected  void createRepositoryPath(javax.jcr.Session writerSession, java.lang.String repositoryPath)
           
protected  void deactivate(org.osgi.service.component.ComponentContext componentContext)
          Deativates this component, called by SCR to take out of service
 java.util.Map<java.lang.String,java.lang.Object> getBundleContentInfo(javax.jcr.Session session, org.osgi.framework.Bundle bundle, boolean create)
          Return the bundle content info and make an exclusive lock.
 java.lang.String getMimeType(java.lang.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.
 void unlockBundleContentInfo(javax.jcr.Session session, org.osgi.framework.Bundle bundle, boolean contentLoaded, java.util.List<java.lang.String> createdNodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_CONTENT_LOADED

public static final java.lang.String PROPERTY_CONTENT_LOADED
See Also:
Constant Field Values

PROPERTY_CONTENT_LOADED_AT

public static final java.lang.String PROPERTY_CONTENT_LOADED_AT
See Also:
Constant Field Values

PROPERTY_UNINSTALL_PATHS

public static final java.lang.String PROPERTY_UNINSTALL_PATHS
See Also:
Constant Field Values

BUNDLE_CONTENT_NODE

public static final java.lang.String BUNDLE_CONTENT_NODE
See Also:
Constant Field Values

settingsService

@Reference
protected org.apache.sling.engine.SlingSettingsService settingsService
Sling settings service.

Constructor Detail

ContentLoaderService

public ContentLoaderService()
Method Detail

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Loads and unloads any content provided by the bundle whose state changed. If the bundle has been started, the content is loaded. If the bundle is about to stop, the content are unloaded.

Specified by:
bundleChanged in interface org.osgi.framework.BundleListener
Parameters:
event - The BundleEvent representing the bundle state change.

getMimeType

public java.lang.String getMimeType(java.lang.String name)
Returns the MIME type from the MimeTypeService for the given name

Specified by:
getMimeType in interface JcrContentHelper
Parameters:
name - the name of the file to get the mimeType for

createRepositoryPath

protected void createRepositoryPath(javax.jcr.Session writerSession,
                                    java.lang.String repositoryPath)
                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)
Activates this component, called by SCR before registering as a service


deactivate

protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
Deativates this component, called by SCR to take out of service


getRepository

protected org.apache.sling.jcr.api.SlingRepository getRepository()
Returns the JCR repository used by this service.


getBundleContentInfo

public java.util.Map<java.lang.String,java.lang.Object> getBundleContentInfo(javax.jcr.Session session,
                                                                             org.osgi.framework.Bundle bundle,
                                                                             boolean create)
                                                                      throws javax.jcr.RepositoryException
Return the bundle content info and make an exclusive lock.

Parameters:
session -
bundle -
Returns:
The map of bundle content info or null.
Throws:
javax.jcr.RepositoryException

unlockBundleContentInfo

public void unlockBundleContentInfo(javax.jcr.Session session,
                                    org.osgi.framework.Bundle bundle,
                                    boolean contentLoaded,
                                    java.util.List<java.lang.String> createdNodes)
                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

contentIsUninstalled

public void contentIsUninstalled(javax.jcr.Session session,
                                 org.osgi.framework.Bundle bundle)


Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.