summaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-10-01 13:59:35 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-10-01 13:59:35 +0200
commit16097dda02938e83a490cfb518c60f50ea4c605c (patch)
treeb61492a54139577e34a39917551398e78125126f /jdisc_core
parentecffdfce4d6d8758bb722b2c13c002f34d780cab (diff)
Nonfunctional changes only
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/application/OsgiFramework.java57
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/core/FelixFramework.java21
2 files changed, 39 insertions, 39 deletions
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/application/OsgiFramework.java b/jdisc_core/src/main/java/com/yahoo/jdisc/application/OsgiFramework.java
index 5abc95cc610..f5346a21a4f 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/application/OsgiFramework.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/application/OsgiFramework.java
@@ -8,9 +8,9 @@ import org.osgi.framework.BundleException;
import java.util.List;
/**
- * <p>This is an abstraction of the OSGi framework that hides the actual implementation details. If you need access to
+ * This is an abstraction of the OSGi framework that hides the actual implementation details. If you need access to
* this interface, simply inject it into your Application. In most cases, however, you are better of injecting a
- * {@link BundleInstaller} since that provides common convenience methods.</p>
+ * {@link BundleInstaller} since that provides common convenience methods.
*
* @author Simon Thoresen Hult
*/
@@ -24,7 +24,7 @@ public interface OsgiFramework {
* argument.</p>
*
* <p><b>NOTE:</b> When this method installs more than one bundle, <em>AND</em> one of those bundles throw an
- * exception during installation, the bundles installed prior to throwing the expcetion will remain installed. To
+ * exception during installation, the bundles installed prior to throwing the exception will remain installed. To
* enable the caller to recover from such a situation, this method wraps any thrown exception within a {@link
* BundleInstallationException} that contains the list of successfully installed bundles.</p>
*
@@ -32,67 +32,66 @@ public interface OsgiFramework {
* case of an exception), but that can not be implemented thread-safely since an <code>Application</code> may choose to
* install bundles concurrently through any available <code>BundleContext</code>.</p>
*
- * @param bundleLocation The location identifier of the bundle to install.
- * @return The list of Bundle objects installed, the object at index 0 matches the given location.
- * @throws BundleInstallationException If the input stream cannot be read, or the installation of a bundle failed,
+ * @param bundleLocation the location identifier of the bundle to install
+ * @return the list of Bundle objects installed, the object at index 0 matches the given location
+ * @throws BundleInstallationException if the input stream cannot be read, or the installation of a bundle failed,
* or the caller does not have the appropriate permissions, or the system {@link
- * BundleContext} is no longer valid.
+ * BundleContext} is no longer valid
*/
List<Bundle> installBundle(String bundleLocation) throws BundleException;
/**
- * <p>Starts the given {@link Bundle}s. The parameter <code>privileged</code> tells the framework whether or not
+ * Starts the given {@link Bundle}s. The parameter <code>privileged</code> tells the framework whether or not
* privileges are available, and is checked against the {@link OsgiHeader#PRIVILEGED_ACTIVATOR} header of each
- * Bundle being started. Any bundle that is a fragment is silently ignored.</p>
+ * Bundle being started. Any bundle that is a fragment is silently ignored.
*
- * @param bundles The bundles to start.
- * @param privileged Whether or not privileges are available.
- * @throws BundleException If a bundle could not be started. This could be because a code dependency could not
+ * @param bundles the bundles to start
+ * @param privileged whether or not privileges are available
+ * @throws BundleException if a bundle could not be started. This could be because a code dependency could not
* be resolved or the specified BundleActivator could not be loaded or threw an
* exception.
- * @throws SecurityException If the caller does not have the appropriate permissions.
- * @throws IllegalStateException If this bundle has been uninstalled or this bundle tries to change its own state.
+ * @throws SecurityException if the caller does not have the appropriate permissions
+ * @throws IllegalStateException if this bundle has been uninstalled or this bundle tries to change its own state
*/
void startBundles(List<Bundle> bundles, boolean privileged) throws BundleException;
/**
- * <p>This method <em>synchronously</em> refreshes all bundles currently loaded. Once this method returns, the
- * class loaders of all bundles will reflect on the current set of loaded bundles.</p>
+ * Synchronously refresh all bundles currently loaded. Once this method returns, the
+ * class loaders of all bundles will reflect on the current set of loaded bundles.
*/
void refreshPackages();
/**
- * <p>Returns the BundleContext of this framework's system bundle. The returned BundleContext can be used by the
+ * Returns the BundleContext of this framework's system bundle. The returned BundleContext can be used by the
* caller to act on behalf of this bundle. This method may return <code>null</code> if it has no valid
- * BundleContext.</p>
+ * BundleContext.
*
- * @return A <code>BundleContext</code> for the system bundle, or <code>null</code>.
- * @throws SecurityException If the caller does not have the appropriate permissions.
+ * @return a <code>BundleContext</code> for the system bundle, or <code>null</code>
+ * @throws SecurityException if the caller does not have the appropriate permissions
*/
BundleContext bundleContext();
/**
- * <p>Returns an iterable collection of all installed bundles. This method returns a list of all bundles installed
+ * Returns an iterable collection of all installed bundles. This method returns a list of all bundles installed
* in the OSGi environment at the time of the call to this method. However, since the OsgiFramework is a very
- * dynamic environment, bundles can be installed or uninstalled at anytime.</p>
+ * dynamic environment, bundles can be installed or uninstalled at anytime.
*
- * @return An iterable collection of Bundle objects, one object per installed bundle.
+ * @return an iterable collection of Bundle objects, one object per installed bundle
*/
List<Bundle> bundles();
/**
- * <p>This method starts the framework instance. Before this method is called, any call to {@link
- * #installBundle(String)} or {@link #bundles()} will generate a {@link NullPointerException}.</p>
+ * This method starts the framework instance. Before this method is called, any call to {@link
+ * #installBundle(String)} or {@link #bundles()} will generate a {@link NullPointerException}.
*
- * @throws BundleException If any error occurs.
+ * @throws BundleException if any error occurs
*/
void start() throws BundleException;
/**
- * <p>This method <em>synchronously</em> shuts down the framework. It must be called at the end of a session in
- * order to shutdown all active bundles.</p>
+ * Synchronously shut down the framework. It must be called at the end of a session to shutdown all active bundles.
*
- * @throws BundleException If any error occurs.
+ * @throws BundleException if any error occurs
*/
void stop() throws BundleException;
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/FelixFramework.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/FelixFramework.java
index 7de4a9273bd..96fc0c91d2d 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/FelixFramework.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/FelixFramework.java
@@ -117,19 +117,19 @@ public class FelixFramework implements OsgiFramework {
wiring.refreshBundles(null,
event -> {
switch (event.getType()) {
- case FrameworkEvent.PACKAGES_REFRESHED:
- latch.countDown();
- break;
- case FrameworkEvent.ERROR:
- log.log(Level.SEVERE, "ERROR FrameworkEvent received.", event.getThrowable());
- break;
+ case FrameworkEvent.PACKAGES_REFRESHED:
+ latch.countDown();
+ break;
+ case FrameworkEvent.ERROR:
+ log.log(Level.SEVERE, "ERROR FrameworkEvent received.", event.getThrowable());
+ break;
}
});
try {
long TIMEOUT_SECONDS = 60L;
- if (!latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
+ if ( ! latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS)) {
log.warning("No PACKAGES_REFRESHED FrameworkEvent received within " + TIMEOUT_SECONDS +
- " seconds of calling FrameworkWiring.refreshBundles()");
+ " seconds of calling FrameworkWiring.refreshBundles()");
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
@@ -176,9 +176,10 @@ public class FelixFramework implements OsgiFramework {
deleteDirContents(child);
boolean deleted = child.delete();
if (! deleted)
- throw new RuntimeException(
- "Could not delete file '" + child.getAbsolutePath() +"'. Please check file permissions!");
+ throw new RuntimeException("Could not delete file '" + child.getAbsolutePath() +
+ "'. Please check file permissions!");
}
}
}
+
}