You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/06/11 15:30:21 UTC
svn commit: r666660 - in /geronimo/gshell/trunk: gshell-core/
gshell-core/src/main/java/org/apache/geronimo/gshell/
gshell-core/src/main/java/org/apache/geronimo/gshell/console/
gshell-core/src/test/ gshell-support/ gshell-support/gshell-console/ gshel...
Author: jdillon
Date: Wed Jun 11 06:30:20 2008
New Revision: 666660
URL: http://svn.apache.org/viewvc?rev=666660&view=rev
Log:
Move console bits out of gshell-core and into gshell-console
Added:
geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java (with props)
geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/FileHistory.java
geronimo/gshell/trunk/gshell-support/gshell-console/
geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml (with props)
geronimo/gshell/trunk/gshell-support/gshell-console/src/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/
- copied from r666536, geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/
Removed:
geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/
geronimo/gshell/trunk/gshell-core/src/test/
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java
Modified:
geronimo/gshell/trunk/gshell-core/pom.xml
geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
geronimo/gshell/trunk/gshell-support/pom.xml
Modified: geronimo/gshell/trunk/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/pom.xml?rev=666660&r1=666659&r2=666660&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-core/pom.xml Wed Jun 11 06:30:20 2008
@@ -47,7 +47,12 @@
<groupId>org.apache.geronimo.gshell.support</groupId>
<artifactId>gshell-plexus</artifactId>
</dependency>
-
+
+ <dependency>
+ <groupId>org.apache.geronimo.gshell.support</groupId>
+ <artifactId>gshell-console</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.geronimo.gshell</groupId>
<artifactId>gshell-api</artifactId>
Added: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java?rev=666660&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java (added)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java Wed Jun 11 06:30:20 2008
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell;
+
+import jline.History;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * Default implementation of the {@link History} component.
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=History.class)
+public class DefaultHistory
+ extends FileHistory
+{
+ // Empty
+}
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/DefaultHistory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/FileHistory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/FileHistory.java?rev=666660&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/FileHistory.java (added)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/FileHistory.java Wed Jun 11 06:30:20 2008
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell;
+
+import jline.History;
+import org.apache.geronimo.gshell.application.ApplicationManager;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * Preserves command history to a file.
+ *
+ * @version $Rev: 573669 $ $Date: 2007-09-07 11:47:20 -0700 (Fri, 07 Sep 2007) $
+ */
+@Component(role=History.class, hint="file")
+public class FileHistory
+ extends History
+ implements Initializable
+{
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ @Requirement
+ private ApplicationManager applicationManager;
+
+ public FileHistory() {}
+
+ public void initialize() throws InitializationException {
+ assert applicationManager != null;
+
+ try {
+ setHistoryFile(applicationManager.getContext().getApplication().getBranding().getHistoryFile());
+ }
+ catch (IOException e) {
+ throw new InitializationException("Failed to set history file", e);
+ }
+ }
+
+ public void setHistoryFile(final File file) throws IOException {
+ assert file != null;
+
+ File dir = file.getParentFile();
+
+ if (!dir.exists()) {
+ dir.mkdirs();
+
+ log.debug("Created base directory for history file: {}", dir);
+ }
+
+ log.debug("Using history file: {}", file);
+
+ super.setHistoryFile(file);
+ }
+
+}
\ No newline at end of file
Added: geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml?rev=666660&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml (added)
+++ geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml Wed Jun 11 06:30:20 2008
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.geronimo.gshell.support</groupId>
+ <artifactId>gshell-support</artifactId>
+ <version>1.0-alpha-2-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gshell-console</artifactId>
+ <name>GShell Support :: Console</name>
+
+ <description>
+ Interactive console support.
+ </description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.gshell.support</groupId>
+ <artifactId>gshell-io</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
Propchange: geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-support/gshell-console/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java?rev=666660&r1=666536&r2=666660&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java (original)
+++ geronimo/gshell/trunk/gshell-support/gshell-console/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java Wed Jun 11 06:30:20 2008
@@ -22,13 +22,12 @@
import jline.ConsoleReader;
import jline.History;
import org.apache.geronimo.gshell.io.IO;
-import org.apache.geronimo.gshell.shell.Shell;
import java.io.IOException;
import java.io.PrintWriter;
/**
- * Support for running a {@link Shell} using the <a href="http://jline.sf.net">JLine</a> library.
+ * Support for running console using the <a href="http://jline.sf.net">JLine</a> library.
*
* @version $Rev$ $Date$
*/
Modified: geronimo/gshell/trunk/gshell-support/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/pom.xml?rev=666660&r1=666659&r2=666660&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/pom.xml (original)
+++ geronimo/gshell/trunk/gshell-support/pom.xml Wed Jun 11 06:30:20 2008
@@ -49,6 +49,7 @@
<module>gshell-prefs</module>
<module>gshell-plexus</module>
<module>gshell-url</module>
+ <module>gshell-console</module>
</modules>
</project>
\ No newline at end of file