karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Nodet <gno...@gmail.com>
Subject Re: svn commit: r1038942 - in /karaf/trunk: features/core/src/main/java/org/apache/karaf/features/internal/ jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/ main/src/main/java/org/apache/karaf/main/ shell/obr/src/main/java/org/apache/ka
Date Thu, 25 Nov 2010 09:06:51 GMT
On Thu, Nov 25, 2010 at 08:43,  <jbonofre@apache.org> wrote:
> Author: jbonofre
> Date: Thu Nov 25 07:43:45 2010
> New Revision: 1038942
>
> URL: http://svn.apache.org/viewvc?rev=1038942&view=rev
> Log:
> [KARAF-299] Miscellaneous cleanup and minor fixes.
>
> Modified:
>    karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
>    karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
>    karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java
>    karaf/trunk/shell/obr/src/main/java/org/apache/karaf/shell/obr/FindCommand.java
>    karaf/trunk/webconsole/admin/src/main/java/org/apache/karaf/webconsole/admin/AdminPlugin.java
>    karaf/trunk/webconsole/admin/src/main/resources/res/ui/admin.js
>    karaf/trunk/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Terminal.java
>
> Modified: karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
(original)
> +++ karaf/trunk/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
Thu Nov 25 07:43:45 2010
> @@ -16,42 +16,12 @@
>  */
>  package org.apache.karaf.features.internal;
>
> -import java.io.BufferedInputStream;
> -import java.io.File;
> -import java.io.FileInputStream;
> -import java.io.FileOutputStream;
> -import java.io.IOException;
> -import java.io.InputStream;
> -import java.io.OutputStream;
> -import java.net.URI;
> -import java.net.URISyntaxException;
> -import java.net.URL;
> -import java.util.*;
> -import java.util.concurrent.CopyOnWriteArrayList;
> -import java.util.jar.JarInputStream;
> -import java.util.jar.Manifest;
> -import java.util.regex.Matcher;
> -import java.util.regex.Pattern;
> -
> -import org.apache.felix.utils.version.VersionTable;
> -import org.apache.karaf.features.BundleInfo;
> -import org.apache.karaf.features.Feature;
> -import org.apache.karaf.features.FeatureEvent;
> -import org.apache.karaf.features.FeaturesListener;
> -import org.apache.karaf.features.FeaturesService;
> -import org.apache.karaf.features.Repository;
> -import org.apache.karaf.features.RepositoryEvent;
>  import org.apache.felix.utils.manifest.Clause;
>  import org.apache.felix.utils.manifest.Parser;
>  import org.apache.felix.utils.version.VersionRange;
> -import org.apache.karaf.features.Resolver;
> -import org.osgi.framework.Bundle;
> -import org.osgi.framework.BundleContext;
> -import org.osgi.framework.BundleException;
> -import org.osgi.framework.Constants;
> -import org.osgi.framework.FrameworkUtil;
> -import org.osgi.framework.InvalidSyntaxException;
> -import org.osgi.framework.Version;
> +import org.apache.felix.utils.version.VersionTable;
> +import org.apache.karaf.features.*;
> +import org.osgi.framework.*;
>  import org.osgi.service.cm.Configuration;
>  import org.osgi.service.cm.ConfigurationAdmin;
>  import org.osgi.service.packageadmin.PackageAdmin;
> @@ -60,6 +30,17 @@ import org.osgi.util.tracker.ServiceTrac
>  import org.slf4j.Logger;
>  import org.slf4j.LoggerFactory;
>
> +import java.io.*;
> +import java.net.URI;
> +import java.net.URISyntaxException;
> +import java.net.URL;
> +import java.util.*;
> +import java.util.concurrent.CopyOnWriteArrayList;
> +import java.util.jar.JarInputStream;
> +import java.util.jar.Manifest;
> +import java.util.regex.Matcher;
> +import java.util.regex.Pattern;
> +
>  import static java.lang.String.format;
>
>  /**
> @@ -307,11 +288,6 @@ public class FeaturesServiceImpl impleme
>                                try {
>                                    b.start();
>                                } catch (BundleException be) {
> -                                   String[] msgdata = new String[]{
> -                                       b.getLocation(),
> -                                       getFeaturesContainingBundleList(b),
> -                                       be.getMessage()
> -                                   };
>                                    String msg = format("Could not start
bundle %s in feature(s) %s: %s", b.getLocation(), getFeaturesContainingBundleList(b), be.getMessage());
>                                    throw new Exception(msg, be);
>                                }
> @@ -859,7 +835,6 @@ public class FeaturesServiceImpl impleme
>
>     protected Configuration findExistingConfiguration(ConfigurationAdmin configurationAdmin,
>                                                       String
pid, String factoryPid) throws IOException, InvalidSyntaxException {
> -        String key = (factoryPid == null ? pid : pid + "-" + factoryPid);
>         String filter;
>         if (factoryPid == null) {
>             filter = "(" + Constants.SERVICE_PID + "=" + pid + ")";
> @@ -1074,7 +1049,7 @@ public class FeaturesServiceImpl impleme
>         Set<Feature> features = new HashSet<Feature>();
>         for (Map<String, Feature> featureMap : this.getFeatures().values())
{
>             for (Feature f : featureMap.values()) {
> -                if (f.getBundles().contains(bundle.getLocation())) {
> +                if (f.getBundles().contains(bundle)) {
>                     features.add(f);
>                 }
>             }
>

It seems f.getBundles() is of type List<BundleInfo> and bundle is of
type Bundle, so I'm not sure this call will be any better than the
previous one (which is agree was wrong too).

> Modified: karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
(original)
> +++ karaf/trunk/jaas/modules/src/main/java/org/apache/karaf/jaas/modules/jdbc/JDBCBackingEngine.java
Thu Nov 25 07:43:45 2010
> @@ -32,7 +32,7 @@ import java.util.ArrayList;
>  import java.util.List;
>
>  /**
> - * @author iocanel
> + * @author iocanel, jbonofre
>  */
>  public class JDBCBackingEngine implements BackingEngine {
>
> @@ -189,7 +189,7 @@ public class JDBCBackingEngine implement
>                 listUserStatement = connection.prepareStatement(selectUsersStatement);
>                 usersResultSet = listUserStatement.executeQuery();
>                 while (!usersResultSet.next()) {
> -                    String username = usersResultSet.getString(0);
> +                    String username = usersResultSet.getString("USERNAME");
>                     users.add(new UserPrincipal(username));
>                 }
>             } catch (SQLException e) {
>
> Modified: karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java (original)
> +++ karaf/trunk/main/src/main/java/org/apache/karaf/main/Main.java Thu Nov 25 07:43:45
2010
> @@ -778,7 +778,6 @@ public class Main {
>                                f = new File(karafHome, location);
>                         } else {
>                                f = new File(karafBase, location);
> -                               f = new File(karafHome, location);
>                         }
>                         if (f.exists() && f.isDirectory()) {
>                             bundleDirs.add(f);
>
> Modified: karaf/trunk/shell/obr/src/main/java/org/apache/karaf/shell/obr/FindCommand.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/shell/obr/src/main/java/org/apache/karaf/shell/obr/FindCommand.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/shell/obr/src/main/java/org/apache/karaf/shell/obr/FindCommand.java (original)
> +++ karaf/trunk/shell/obr/src/main/java/org/apache/karaf/shell/obr/FindCommand.java Thu
Nov 25 07:43:45 2010
> @@ -16,22 +16,18 @@
>  */
>  package org.apache.karaf.shell.obr;
>
> -import java.io.PrintStream;
> -import java.lang.reflect.Array;
> -import java.util.ArrayList;
> -import java.util.Iterator;
> -import java.util.List;
> -import java.util.Map;
> -
>  import org.apache.felix.bundlerepository.Capability;
> -import org.apache.felix.bundlerepository.Repository;
>  import org.apache.felix.bundlerepository.RepositoryAdmin;
>  import org.apache.felix.bundlerepository.Requirement;
>  import org.apache.felix.bundlerepository.Resource;
>  import org.apache.felix.gogo.commands.Argument;
>  import org.apache.felix.gogo.commands.Command;
> -import org.osgi.framework.InvalidSyntaxException;
> -import org.osgi.framework.Version;
> +
> +import java.io.PrintStream;
> +import java.lang.reflect.Array;
> +import java.util.Iterator;
> +import java.util.List;
> +import java.util.Map;
>
>  @Command(scope = "obr", name = "find", description = "Find OBR bundles for a given
filter")
>  public class FindCommand extends ObrCommandSupport {
> @@ -40,7 +36,6 @@ public class FindCommand extends ObrComm
>     List<String> requirements;
>
>     protected void doExecute(RepositoryAdmin admin) throws Exception {
> -        List<Resource> matching = new ArrayList<Resource>();
>         Resource[] resources = admin.discoverResources(parseRequirements(admin, requirements));
>         if (resources == null)
>         {
>
> Modified: karaf/trunk/webconsole/admin/src/main/java/org/apache/karaf/webconsole/admin/AdminPlugin.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/admin/src/main/java/org/apache/karaf/webconsole/admin/AdminPlugin.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/webconsole/admin/src/main/java/org/apache/karaf/webconsole/admin/AdminPlugin.java
(original)
> +++ karaf/trunk/webconsole/admin/src/main/java/org/apache/karaf/webconsole/admin/AdminPlugin.java
Thu Nov 25 07:43:45 2010
> @@ -114,10 +114,10 @@ public class AdminPlugin extends Abstrac
>             int sshPort = parsePortNumber(req.getParameter("sshPort"));
>             int rmiPort = parsePortNumber(req.getParameter("rmiPort"));
>             String location = parseString(req.getParameter("location"));
> -            String javaopts = parseString(req.getParameter("javaopts"));
> +            String javaOpts = parseString(req.getParameter("javaOpts"));
>             List<String> featureURLs = parseStringList(req.getParameter("featureURLs"));
>             List<String> features = parseStringList(req.getParameter("features"));
> -            InstanceSettings settings = new InstanceSettings(sshPort, rmiPort,
location, javaopts, featureURLs, features);
> +            InstanceSettings settings = new InstanceSettings(sshPort, rmiPort,
location, javaOpts, featureURLs, features);
>             success = createInstance(name, settings);
>         } else if ("destroy".equals(action)) {
>             success = destroyInstance(name);
>
> Modified: karaf/trunk/webconsole/admin/src/main/resources/res/ui/admin.js
> URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/admin/src/main/resources/res/ui/admin.js?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/webconsole/admin/src/main/resources/res/ui/admin.js (original)
> +++ karaf/trunk/webconsole/admin/src/main/resources/res/ui/admin.js Thu Nov 25 07:43:45
2010
> @@ -30,7 +30,7 @@ function renderView() {
>     "<th>SSH Port: <input id='sshPort' type='text' name='sshPort' style='width:70%'
colspan='2'/></th>" +
>     "<th>RMI Port: <input id='rmiPort' type='text' name='rmiPort' style='width:70%'
colspan='2'/></th>" +
>     "<th>Location: <input id='location' type='text' name='location' style='width:70%'
colspan='2'/></th>" +
> -    "<th>JavaOpts: <input id='javaopts' type='text' name='javaopts' style='width:70%'
colspan='2'/></th>" +
> +    "<th>JavaOpts: <input id='javaOpts' type='text' name='javaOpts' style='width:70%'
colspan='2'/></th>" +
>     "<th />" +
>     "</tr><tr><th>Features: <input id='features' type='text' name='features'
style='width:70%' colspan='2'" +
>     " title='Specify initial features separated by commas.'/></th>" +
> @@ -48,16 +48,16 @@ function createInstance() {
>     var sshPort = document.getElementById( "sshPort" ).value;
>     var rmiPort = document.getElementById("rmiPort").value;
>     var location = document.getElementById( "location" ).value;
> -    var javaopts = document.getElementById( "javaopts" ).value;
> +    var javaPpts = document.getElementById( "javaOpts" ).value;
>     var features = document.getElementById( "features" ).value;
>     var featureURLs = document.getElementById( "featureURLs" ).value;
> -    postCreateInstance( name, sshPort, rmiPort, location, javaopts, features, featureURLs
);
> +    postCreateInstance( name, sshPort, rmiPort, location, javaOpts, features, featureURLs
);
>  }
>
>  function postCreateInstance( /* String */ name, /* String */ sshPort, /* String */
rmiPort, /* String */ location,
> -               /* String */ javaopts, /* String */ features, /* String */ featureURLs
) {
> +               /* String */ javaOpts, /* String */ features, /* String */ featureURLs
) {
>     $.post( pluginRoot, {"action": "create", "name": name, "sshPort": sshPort, "rmiPort":
rmiPort, "location": location,
> -                             "javaopts": javaopts, "features": features,
"featureURLs": featureURLs }, function( data ) {
> +                             "javaOpts": javaOpts, "features": features,
"featureURLs": featureURLs }, function( data ) {
>         renderData( data );
>     }, "json" );
>  }
> @@ -114,7 +114,7 @@ function renderInstanceData( /* Element
>     parent.appendChild( td( null, null, [ text( instance.rmiPort ) ] ) );
>     parent.appendChild( td( null, null, [ text( instance.state ) ] ) );
>     parent.appendChild( td( null, null, [ text( instance.location ) ] ) );
> -    parent.appendChild( td( null, null, [ text( instance.javaopts ) ] ) );
> +    parent.appendChild( td( null, null, [ text( instance.javaOpts ) ] ) );
>     var actionsTd = td( null, null );
>     var div = createElement( "div", null, {
>         style: {
>
> Modified: karaf/trunk/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Terminal.java
> URL: http://svn.apache.org/viewvc/karaf/trunk/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Terminal.java?rev=1038942&r1=1038941&r2=1038942&view=diff
> ==============================================================================
> --- karaf/trunk/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Terminal.java
(original)
> +++ karaf/trunk/webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Terminal.java
Thu Nov 25 07:43:45 2010
> @@ -580,7 +580,7 @@ public class Terminal {
>                 // Alternate screen mode
>                 if ((state && !vt100_mode_alt_screen) || (!state &&
vt100_mode_alt_screen)) {
>                     int[] s = screen; screen = screen2; screen2 = s;
> -                    Map<String, Object> map = vt100_saved; vt100_saved
= vt100_saved2; vt100_saved = map;
> +                    Map<String, Object> map = vt100_saved; vt100_saved
= vt100_saved2; vt100_saved2 = map;
>                 }
>                 vt100_mode_alt_screen = state;
>             // ?57 : DECNAKB: Greek keyboard mapping
>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Mime
View raw message