geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r726492 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/ gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/ gshell-commands/gshell-builtin/src/main/java/org/ap...
Date Sun, 14 Dec 2008 16:40:26 GMT
Author: jdillon
Date: Sun Dec 14 08:40:26 2008
New Revision: 726492

URL: http://svn.apache.org/viewvc?rev=726492&view=rev
Log:
More work to factor out unused Application stuff

Modified:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/java/org/apache/geronimo/gshell/commands/builtin/AboutAction.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/resources/META-INF/gshell/components.xml
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
Sun Dec 14 08:40:26 2008
@@ -34,6 +34,10 @@
  */
 public interface Application
 {
+    //
+    // FIXME: Merge with Branding + ApplicationModel
+    //
+    
     String getId();
 
     Artifact getArtifact();

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/model/Branding.java
Sun Dec 14 08:40:26 2008
@@ -36,17 +36,15 @@
     
     private transient ApplicationModel parent;
 
-    private String name;
-
-    private String displayName;
+    // private String displayName;
 
     private String programName;
 
     private String userDirectory;
 
-    private String sharedDirectory;
+    // private String sharedDirectory;
 
-    // TODO: Need stateDirectory (${gshell.home}/var/<name>
+    // private String stateDirectory;
 
     private String profileScriptName;
 
@@ -58,7 +56,7 @@
 
     private String welcomeMessage;
 
-    private String goodbyeMessage;
+    // private String goodbyeMessage;
 
     private String prompt;
 
@@ -79,56 +77,17 @@
     }
 
     public String getName() {
-        if (name == null) {
-            return getParent().getArtifactId();
-        }
-
-        return name;
-    }
-
-    public void setName(final String name) {
-        this.name = name;
-    }
-
-    public String getDisplayName() {
-        if (displayName == null) {
-            return capitalise(getName());
-        }
-
-        return displayName;
-    }
-
-    private static String capitalise(final String str) {
-        if (str == null) {
-            return null;
-        }
-        else if (str.length() == 0) {
-            return "";
-        }
-        else {
-            return new StringBuilder(str.length())
-                    .append(Character.toTitleCase(str.charAt(0)))
-                    .append(str.substring(1))
-                    .toString();
-        }
-    }
-
-    public void setDisplayName(final String displayName) {
-        this.displayName = displayName;
+        return getParent().getArtifactId();
     }
 
     public String getProgramName() {
         if (programName == null) {
-            return System.getProperty("program.name", getName());
+            return System.getProperty("gshell.program", getName());
         }
         
         return programName;
     }
 
-    public void setProgramName(final String programName) {
-        this.programName = programName;
-    }
-
     public String getUserDirectory() {
         if (userDirectory == null) {
             File userHome = new File(System.getProperty("user.home"));
@@ -140,22 +99,6 @@
         return userDirectory;
     }
 
-    public void setUserDirectory(final String userDirectory) {
-        this.userDirectory = userDirectory;
-    }
-
-    public String getSharedDirectory() {
-        //
-        // TODO: Default this to root under the application's directory
-        //
-
-        return sharedDirectory;
-    }
-
-    public void setSharedDirectory(final String sharedDirectory) {
-        this.sharedDirectory = sharedDirectory;
-    }
-
     public String getProfileScriptName() {
         if (profileScriptName == null) {
             return getName() + ".profile";
@@ -164,10 +107,6 @@
         return profileScriptName;
     }
 
-    public void setProfileScriptName(final String profileScriptName) {
-        this.profileScriptName = profileScriptName;
-    }
-
     public String getHistoryFileName() {
         if (historyFileName == null) {
             return getName() + ".history";
@@ -179,10 +118,6 @@
     public File getHistoryFile() {
         return new File(getUserDirectory(), getHistoryFileName());
     }
-    
-    public void setHistoryFileName(final String historyFileName) {
-        this.historyFileName = historyFileName;
-    }
 
     public String getInteractiveScriptName() {
         if (interactiveScriptName == null) {
@@ -192,39 +127,15 @@
         return interactiveScriptName;
     }
 
-    public void setInteractiveScriptName(final String interactiveScriptName) {
-        this.interactiveScriptName = interactiveScriptName;
-    }
-
     public String getAboutMessage() {
         return aboutMessage;
     }
 
-    public void setAboutMessage(final String aboutMessage) {
-        this.aboutMessage = aboutMessage;
-    }
-
     public String getWelcomeMessage() {
         return welcomeMessage;
     }
 
-    public void setWelcomeMessage(final String welcomeMessage) {
-        this.welcomeMessage = welcomeMessage;
-    }
-
-    public String getGoodbyeMessage() {
-        return goodbyeMessage;
-    }
-
-    public void setGoodbyeMessage(final String goodbyeMessage) {
-        this.goodbyeMessage = goodbyeMessage;
-    }
-
     public String getPrompt() {
         return prompt;
     }
-
-    public void setPrompt(final String prompt) {
-        this.prompt = prompt;
-    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/java/org/apache/geronimo/gshell/commands/builtin/AboutAction.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/java/org/apache/geronimo/gshell/commands/builtin/AboutAction.java?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/java/org/apache/geronimo/gshell/commands/builtin/AboutAction.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/java/org/apache/geronimo/gshell/commands/builtin/AboutAction.java
Sun Dec 14 08:40:26 2008
@@ -20,7 +20,6 @@
 package org.apache.geronimo.gshell.commands.builtin;
 
 import org.apache.geronimo.gshell.application.Application;
-import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.application.model.ApplicationModel;
 import org.apache.geronimo.gshell.application.model.Branding;
 import org.apache.geronimo.gshell.command.CommandAction;
@@ -35,22 +34,21 @@
 public class AboutAction
     implements CommandAction
 {
-    private final ApplicationManager applicationManager;
+    private final Application application;
 
-    public AboutAction(final ApplicationManager applicationManager) {
-        assert applicationManager != null;
-        this.applicationManager = applicationManager;
+    public AboutAction(final Application application) {
+        assert application != null;
+        this.application = application;
     }
 
     public Object execute(CommandContext context) throws Exception {
         assert context != null;
         IO io = context.getIo();
 
-        Application app = applicationManager.getApplication();
-        ApplicationModel model = app.getModel();
-        Branding branding = app.getModel().getBranding();
+        ApplicationModel model = application.getModel();
+        Branding branding = application.getModel().getBranding();
         
-        String id = app.getId();
+        String id = application.getId();
         String name = model.getName();
 
         if (name == null) {

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/resources/META-INF/gshell/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/resources/META-INF/gshell/components.xml?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/resources/META-INF/gshell/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtin/src/main/resources/META-INF/gshell/components.xml
Sun Dec 14 08:40:26 2008
@@ -35,7 +35,7 @@
         <gshell:command-bundle name="default">
             <gshell:command name="about">
                 <gshell:action class="org.apache.geronimo.gshell.commands.builtin.AboutAction">
-                    <constructor-arg ref="applicationManager"/>
+                    <constructor-arg ref="application"/>
                 </gshell:action>
             </gshell:command>
 

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationImpl.java?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationImpl.java
Sun Dec 14 08:40:26 2008
@@ -26,8 +26,6 @@
 import org.apache.geronimo.gshell.artifact.Artifact;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.io.IO;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
@@ -41,8 +39,6 @@
 public class ApplicationImpl
     implements Application
 {
-    private final Logger log = LoggerFactory.getLogger(getClass());
-
     private final ApplicationConfiguration config;
 
     private ClassPath classPath;

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java?rev=726492&r1=726491&r2=726492&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/branding/GShellBranding.java
Sun Dec 14 08:40:26 2008
@@ -43,29 +43,9 @@
     }
 
     @Override
-    public void setName(String name) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public String getDisplayName() {
-        return "GShell";
-    }
-
-    @Override
-    public void setDisplayName(String displayName) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
     public String getProgramName() {
         return "gsh";
     }
-    
-    @Override
-    public void setProgramName(String programName) {
-        throw new UnsupportedOperationException();
-    }
 
     @Override
     public String getAboutMessage() {
@@ -79,11 +59,6 @@
         return writer.toString();
     }
 
-    @Override
-    public void setAboutMessage(final String aboutMessage) {
-        throw new UnsupportedOperationException();
-    }
-
     /*
     // Figlet font name: ???
     private static final String[] BANNER = {
@@ -146,11 +121,6 @@
     }
 
     @Override
-    public void setWelcomeMessage(String welcomeMessage) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
     public String getPrompt() {
         return "@|bold %{application.userName}|@%{application.localHost.hostName}:@|bold
%{branding.name}:%{gshell.group}|> ";
     }



Mime
View raw message