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

Javadoc all the things.

parent 6ad4772e
No related branches found
No related tags found
No related merge requests found
...@@ -7,10 +7,24 @@ import com.dotmarketing.util.Logger; ...@@ -7,10 +7,24 @@ import com.dotmarketing.util.Logger;
import edu.msu.anr.osgi.structuralintegrity.service.StructuresSnapshotService; import edu.msu.anr.osgi.structuralintegrity.service.StructuresSnapshotService;
/**
* Activates this OSGi bundle.
*/
public class Activator extends GenericBundleActivator { public class Activator extends GenericBundleActivator {
/** ServiceTracker for the {@link StructuresSnapshotService}. */
private ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker; private ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker;
/**
* Starts the OSGi bundle.
* <p>
* Creates the service tracker for the {@link StructuresSnapshotService} and instantiates and registers the
* {@link StructuresSnapshotServiceTool}.
* </p>
* @param bundleContext The OSGi bundle context object.
* @throws Exception If the {@link StructuresSnapshotService} service tracker cannot be instantiated or opened.
*/
@Override @Override
public void start ( BundleContext bundleContext ) throws Exception { public void start ( BundleContext bundleContext ) throws Exception {
...@@ -34,6 +48,15 @@ public class Activator extends GenericBundleActivator { ...@@ -34,6 +48,15 @@ public class Activator extends GenericBundleActivator {
registerViewToolService( bundleContext, new StructuresSnapshotServiceToolInfo(structuresSnapshotServiceTracker) ); registerViewToolService( bundleContext, new StructuresSnapshotServiceToolInfo(structuresSnapshotServiceTracker) );
} }
/**
* Stops the OSGi bundle.
* <p>
* Unregisters the {@link StructuresSnapshotServiceTool} and closes the {@link StructuresSnapshotService}
* service tracker.
* </p>
* @param bundleContext The OSGi bundle context object.
* @throws Exception If the service viewtool cannot be unregistered or the service tracker cannot be closed.
*/
@Override @Override
public void stop ( BundleContext bundleContext ) throws Exception { public void stop ( BundleContext bundleContext ) throws Exception {
unregisterViewToolServices(); unregisterViewToolServices();
......
...@@ -6,29 +6,59 @@ import org.apache.velocity.tools.view.servlet.ServletToolInfo; ...@@ -6,29 +6,59 @@ import org.apache.velocity.tools.view.servlet.ServletToolInfo;
import edu.msu.anr.osgi.structuralintegrity.service.StructuresSnapshotService; import edu.msu.anr.osgi.structuralintegrity.service.StructuresSnapshotService;
/**
* Provides metadata for and instantiates the {@link StructuresSnapshotServiceTool}.
*/
class StructuresSnapshotServiceToolInfo extends ServletToolInfo { class StructuresSnapshotServiceToolInfo extends ServletToolInfo {
/** ServiceTracker for the {@link StructuresSnapshotService}. */
private final ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker; private final ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker;
/**
* Instantiates this info class and sets the service tracker field.
* @param structuresSnapshotServiceTracker The {@link StructuresSnapshotService} service tracker. The tracker
* should be opened before being passed to this constructor.
*/
StructuresSnapshotServiceToolInfo(ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker) { StructuresSnapshotServiceToolInfo(ServiceTracker<StructuresSnapshotService, StructuresSnapshotService> structuresSnapshotServiceTracker) {
this.structuresSnapshotServiceTracker = structuresSnapshotServiceTracker; this.structuresSnapshotServiceTracker = structuresSnapshotServiceTracker;
} }
/**
* Gets the key to which the {@link StructuresSnapshotServiceTool} will be mapped in Velocity.
* @return The Velocity key for the {@link StructuresSnapshotServiceTool}.
*/
@Override @Override
public String getKey () { public String getKey () {
return "structuresSnapshotService"; return "structuresSnapshotService";
} }
/**
* Gets the Velocity scope in which the {@link StructuresSnapshotServiceTool} will be available.
* @return The Velocity scope in which the {@link StructuresSnapshotServiceTool} will be available.
*/
@Override @Override
public String getScope () { public String getScope () {
return ViewContext.APPLICATION; return ViewContext.APPLICATION;
} }
/**
* Gets the name of the viewtool class.
* @return The {@link StructuresSnapshotServiceTool} class name.
*/
@Override @Override
public String getClassname () { public String getClassname () {
return StructuresSnapshotServiceTool.class.getName(); return StructuresSnapshotServiceTool.class.getName();
} }
/**
* Gets an instance of the {@link StructuresSnapshotServiceTool}.
* <p>
* Instantiates a {@link StructuresSnapshotServiceTool} with the {@link StructuresSnapshotService} service
* tracker, passes it the Velocity init data, and sets its Velocity scope.
* </p>
* @param initData Data used to initialize the viewtool.
* @return An initialized instance of the {@link StructuresSnapshotServiceTool}.
*/
@Override @Override
public Object getInstance ( Object initData ) { public Object getInstance ( Object initData ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment