sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r612077 - /incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java
Date Tue, 15 Jan 2008 11:02:07 GMT
Author: cziegeler
Date: Tue Jan 15 03:01:54 2008
New Revision: 612077

URL: http://svn.apache.org/viewvc?rev=612077&view=rev
Log:
Make Activator easier subclassable.

Modified:
    incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java

Modified: incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java?rev=612077&r1=612076&r2=612077&view=diff
==============================================================================
--- incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java
(original)
+++ incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java
Tue Jan 15 03:01:54 2008
@@ -40,9 +40,7 @@
 public class Activator implements BundleActivator, ServiceListener {
 
     /** default log */
-    private static final Logger log = LoggerFactory.getLogger(Activator.class);
-
-    public static final String CLIENT_REPOSITORY_FACTORY_PID = SlingClientRepository.class.getName();
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
 
     /**
      * The name of the configuration property naming the Sling Context for which
@@ -65,6 +63,14 @@
     // the name of the default sling context
     private String slingContext;
 
+    /**
+     * Return the PID for the configuration.
+     * @return
+     */
+    protected String getClientRepositoryFactoryPID() {
+        return SlingClientRepository.class.getName();
+    }
+
     public void start(BundleContext context) {
 
         this.bundleContext = context;
@@ -126,12 +132,12 @@
             // find a configuration for theses properties...
             Configuration[] cfgs = ca.listConfigurations("("
                 + ConfigurationAdmin.SERVICE_FACTORYPID + "="
-                + CLIENT_REPOSITORY_FACTORY_PID + ")");
+                + this.getClientRepositoryFactoryPID() + ")");
             if (cfgs != null && cfgs.length > 0) {
                 log.info(
                     "verifyConfiguration: {} Configurations available for {}, nothing to
do",
                     new Object[] { new Integer(cfgs.length),
-                        CLIENT_REPOSITORY_FACTORY_PID });
+                        this.getClientRepositoryFactoryPID() });
                 return;
             }
 
@@ -144,7 +150,7 @@
                 "com.day.util.jndi.provider.MemoryInitialContextFactory");
 
             // create the factory and set the properties
-            Configuration config = ca.createFactoryConfiguration(CLIENT_REPOSITORY_FACTORY_PID);
+            Configuration config = ca.createFactoryConfiguration(this.getClientRepositoryFactoryPID());
             config.update(props);
 
             log.debug("verifyConfiguration: Created configuration {} for {}",



Mime
View raw message