Skip to content
Snippets Groups Projects
Commit 58cb21a5 authored by Eric Slenk's avatar Eric Slenk
Browse files

Import StructuresSnapshotService.

parent 0544099b
Branches
Tags
No related merge requests found
...@@ -4,7 +4,7 @@ apply plugin: 'war' ...@@ -4,7 +4,7 @@ apply plugin: 'war'
apply plugin: 'eclipse' apply plugin: 'eclipse'
sourceCompatibility = '1.8' sourceCompatibility = '1.8'
version = '0.1.0-1' version = '0.1.0-3'
repositories { repositories {
...@@ -14,7 +14,7 @@ repositories { ...@@ -14,7 +14,7 @@ repositories {
} }
dependencies { dependencies {
compile fileTree(dir: 'src/main/resources/libs', include: '*.jar') compile fileTree(dir: "${getFelixDirPath()}/load", include: '*.jar')
compile (group: 'com.dotcms', name: 'dotcms', version: '3.3.2'){ compile (group: 'com.dotcms', name: 'dotcms', version: '3.3.2'){
transitive = true transitive = true
} }
......
package edu.msu.anr.osgi.structuralintegrity.viewtool; package edu.msu.anr.osgi.structuralintegrity.viewtool;
import com.dotcms.repackage.org.osgi.framework.BundleContext; import com.dotcms.repackage.org.osgi.framework.BundleContext;
import com.dotcms.repackage.org.osgi.util.tracker.ServiceTracker;
import com.dotmarketing.osgi.GenericBundleActivator; import com.dotmarketing.osgi.GenericBundleActivator;
import com.dotmarketing.util.Logger;
import edu.msu.anr.osgi.structuralintegrity.service.StructuresSnapshotService;
public class Activator extends GenericBundleActivator { public class Activator extends GenericBundleActivator {
private ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker;
@Override @Override
public void start ( BundleContext bundleContext ) throws Exception { public void start ( BundleContext bundleContext ) throws Exception {
//Initializing services... //Initializing services...
initializeServices( bundleContext ); initializeServices( bundleContext );
// Create a ServiceTracker for the StructuresSnapshotService
try {
structuresSnapshotServiceTracker = new ServiceTracker<>(
bundleContext,
StructuresSnapshotService.class.getName(),
null
);
} catch (Exception e) {
Logger.error(this, e.getMessage());
throw e;
}
//Registering the ViewTool service //Registering the ViewTool service
registerViewToolService( bundleContext, new StructuresSnapshotServiceToolInfo() ); registerViewToolService( bundleContext, new StructuresSnapshotServiceToolInfo() );
} }
...@@ -18,6 +36,7 @@ public class Activator extends GenericBundleActivator { ...@@ -18,6 +36,7 @@ public class Activator extends GenericBundleActivator {
@Override @Override
public void stop ( BundleContext bundleContext ) throws Exception { public void stop ( BundleContext bundleContext ) throws Exception {
unregisterViewToolServices(); unregisterViewToolServices();
structuresSnapshotServiceTracker.close();
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment