You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2008/01/15 12:02:07 UTC
svn commit: r612077 -
/incubator/sling/trunk/jcr/jackrabbit-client/src/main/java/org/apache/sling/jcr/jackrabbit/client/Activator.java
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 {}",