Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Enabled Felix Web Console to administer indexer provisioning. Neat\!
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Feb 4, 2014
1 parent d37b603 commit a1bf97d
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 10 deletions.
39 changes: 35 additions & 4 deletions fcrepo-jms-indexer-runtime/pom.xml
Expand Up @@ -24,7 +24,6 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
Expand Down Expand Up @@ -64,7 +63,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
Expand Down Expand Up @@ -153,6 +152,38 @@
<artifactId>jackson-mapper-asl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.webconsole</artifactId>
<version>4.2.0</version>
<type>bundle</type>
<scope>provided</scope>
</dependency>
<!-- supports Felix web console -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.bundles</groupId>
<artifactId>json</artifactId>
<version>20090211_1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr</artifactId>
<version>1.8.0</version>
<type>bundle</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>1.9.6</version>
<scope>provided</scope>
</dependency>
</dependencies>

<repositories>
Expand Down Expand Up @@ -193,8 +224,8 @@
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- we use the provided scope to indicate material to be packaged with -->
<includeScope>provided</includeScope>
<!-- we use the provided scope to indicate material to be packaged with but not
baked into the artifact -->
<outputDirectory>${project.build.directory}/bundle</outputDirectory>
</configuration>
</execution>
Expand Down
Expand Up @@ -19,7 +19,6 @@

package org.fcrepo.indexer.runtime;

import static com.google.common.collect.ImmutableMap.of;
import static java.lang.Runtime.getRuntime;
import static java.lang.System.exit;
import static java.lang.System.getProperty;
Expand All @@ -32,6 +31,7 @@
import static org.osgi.framework.FrameworkEvent.WAIT_TIMEDOUT;
import static org.slf4j.LoggerFactory.getLogger;

import java.util.HashMap;
import java.util.Map;

import org.osgi.framework.BundleException;
Expand Down Expand Up @@ -70,13 +70,20 @@ public Main() {
}

/**
* @return Parsed conf from System properties
* @return Parsed configuration from System properties
*/
public static Map<String, String> getConfig() {
return of(FRAMEWORK_STORAGE, getProperty(INDEXER_HOME_PROP_NAME,
"indexer"), AUTO_DEPLOY_DIR_PROPERY, getProperty(
AUTODEPLOY_DIR_PROP_NAME, "bundle"),
AUTO_DEPLOY_ACTION_PROPERY, "install,update,start,uninstall");
final Map<String, String> config = new HashMap<>();
final String indexerHome =
getProperty(INDEXER_HOME_PROP_NAME, "indexer");
config.put(FRAMEWORK_STORAGE, indexerHome);
LOGGER.info("Using indexer home: {}", indexerHome);
final String autoDeployDir =
getProperty(AUTODEPLOY_DIR_PROP_NAME, "bundle");
config.put(AUTO_DEPLOY_DIR_PROPERY, autoDeployDir);
LOGGER.info("Using auto-deploy directory: {}", autoDeployDir);
config.put(AUTO_DEPLOY_ACTION_PROPERY, "install,update,start,uninstall");
return config;
}

/**
Expand Down
22 changes: 22 additions & 0 deletions fcrepo-jms-indexer-runtime/src/main/resources/logback.xml
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%p %d{HH:mm:ss.SSS} \(%c{0}\) %m%n</pattern>
</encoder>
</appender>

<logger name="org.fcrepo.indexer" additivity="false" level="DEBUG">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.fcrepo" additivity="false" level="INFO">
<appender-ref ref="STDOUT"/>
</logger>
<logger name="org.apache.felix" additivity="false" level="DEBUG">
<appender-ref ref="STDOUT"/>
</logger>
<root additivity="false" level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>

0 comments on commit a1bf97d

Please sign in to comment.