org.apache.sling.installer.provider.jcr.impl
Class JcrInstaller

java.lang.Object
  extended by org.apache.sling.installer.provider.jcr.impl.JcrInstaller
All Implemented Interfaces:
javax.jcr.observation.EventListener

public class JcrInstaller
extends Object
implements javax.jcr.observation.EventListener

Main class of jcrinstall, runs as a service, observes the repository for changes in folders having names that match configurable regular expressions, and registers resources found in those folders with the OSGi installer for installation.


Field Summary
static int COUNTERS_COUNT
           
static int DEFAULT_FOLDER_MAX_DEPTH
           
static String DEFAULT_FOLDER_NAME_REGEXP
          Default regexp for watched folders
static String[] DEFAULT_SEARCH_PATH
           
static String FOLDER_NAME_REGEXP_PROPERTY
          ComponentContext property that overrides the folder name regexp
static String PROP_INSTALL_FOLDER_MAX_DEPTH
          Configurable max.
static String PROP_SEARCH_PATH
          Configurable search path, with per-path priorities.
static int RUN_LOOP_COUNTER
           
static long RUN_LOOP_DELAY_MSEC
           
static int SCAN_FOLDERS_COUNTER
           
static int UPDATE_FOLDERS_LIST_COUNTER
           
static String URL_SCHEME
           
 
Constructor Summary
JcrInstaller()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext context)
          Activate this component.
protected  void deactivate(org.osgi.service.component.ComponentContext context)
          Deactivate this component
protected  Object getPropertyValue(org.osgi.service.component.ComponentContext ctx, String name)
          Get a property value from the component context or bundle context
 void onEvent(javax.jcr.observation.EventIterator it)
           
 void runOneCycle()
          Run periodic scans of our watched folders, and watch for folders creations/deletions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RUN_LOOP_DELAY_MSEC

public static final long RUN_LOOP_DELAY_MSEC
See Also:
Constant Field Values

URL_SCHEME

public static final String URL_SCHEME
See Also:
Constant Field Values

SCAN_FOLDERS_COUNTER

public static final int SCAN_FOLDERS_COUNTER
See Also:
Constant Field Values

UPDATE_FOLDERS_LIST_COUNTER

public static final int UPDATE_FOLDERS_LIST_COUNTER
See Also:
Constant Field Values

RUN_LOOP_COUNTER

public static final int RUN_LOOP_COUNTER
See Also:
Constant Field Values

COUNTERS_COUNT

public static final int COUNTERS_COUNT
See Also:
Constant Field Values

DEFAULT_FOLDER_NAME_REGEXP

public static final String DEFAULT_FOLDER_NAME_REGEXP
Default regexp for watched folders

See Also:
Constant Field Values

FOLDER_NAME_REGEXP_PROPERTY

public static final String FOLDER_NAME_REGEXP_PROPERTY
ComponentContext property that overrides the folder name regexp

See Also:
Constant Field Values

PROP_INSTALL_FOLDER_MAX_DEPTH

public static final String PROP_INSTALL_FOLDER_MAX_DEPTH
Configurable max. path depth for watched folders

See Also:
Constant Field Values

PROP_SEARCH_PATH

public static final String PROP_SEARCH_PATH
Configurable search path, with per-path priorities. We could get it from the ResourceResolver, but introducing a dependency on this just to get those values is too much for this module that's meant to bootstrap other services.

See Also:
Constant Field Values

DEFAULT_SEARCH_PATH

public static final String[] DEFAULT_SEARCH_PATH

DEFAULT_FOLDER_MAX_DEPTH

public static final int DEFAULT_FOLDER_MAX_DEPTH
See Also:
Constant Field Values
Constructor Detail

JcrInstaller

public JcrInstaller()
Method Detail

activate

protected void activate(org.osgi.service.component.ComponentContext context)
Activate this component.


deactivate

protected void deactivate(org.osgi.service.component.ComponentContext context)
Deactivate this component


getPropertyValue

protected Object getPropertyValue(org.osgi.service.component.ComponentContext ctx,
                                  String name)
Get a property value from the component context or bundle context


onEvent

public void onEvent(javax.jcr.observation.EventIterator it)
Specified by:
onEvent in interface javax.jcr.observation.EventListener

runOneCycle

public void runOneCycle()
Run periodic scans of our watched folders, and watch for folders creations/deletions



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