[jboss-cvs] JBossAS SVN: r88115 - in projects/fresh/trunk: fresh-jar/src/main/resources and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 1 19:42:02 EDT 2009
Author: ctomc
Date: 2009-05-01 19:42:02 -0400 (Fri, 01 May 2009)
New Revision: 88115
Added:
projects/fresh/trunk/fresh-jar/src/main/resources/automation.xml
projects/fresh/trunk/fresh-jar/src/main/resources/hello.txt
projects/fresh/trunk/fresh-jar/src/main/resources/platform.xml
projects/fresh/trunk/fresh-jar/src/main/resources/priv.skk
projects/fresh/trunk/fresh-jar/src/main/resources/pub.pkk
projects/fresh/trunk/fresh-jar/src/main/resources/server.xml
projects/fresh/trunk/fresh-jar/src/main/resources/sshtools.xml
Removed:
projects/fresh/trunk/etc/fresh/ssh/automation.xml
projects/fresh/trunk/etc/fresh/ssh/hello.txt
projects/fresh/trunk/etc/fresh/ssh/platform.xml
projects/fresh/trunk/etc/fresh/ssh/priv.skk
projects/fresh/trunk/etc/fresh/ssh/pub.pkk
projects/fresh/trunk/etc/fresh/ssh/server.xml
projects/fresh/trunk/etc/fresh/ssh/sshtools.xml
Modified:
projects/fresh/trunk/fresh-jar/src/main/resources/META-INF/fresh-service.xml
projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/VFSFileService.java
Log:
everything now loads from classpath, no more external files needed
Deleted: projects/fresh/trunk/etc/fresh/ssh/automation.xml
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/automation.xml 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/automation.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- SSHTools automation file, defines mappings for automated configuration -->
-<Automation>
- <RemoteIdentification defaultName="OpenSSH">
- <Rule startsWith="OpenSSH"/>
- <Rule startsWith="OpenSSH" contains="3.4" name="OpenSSH 3.4" priority="1"/>
- <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.OpenSSHAuthorizedKeysFormat"
- defaultPath=".ssh/authorized_keys"/>
- </RemoteIdentification>
- <RemoteIdentification defaultName="SSHTools">
- <Rule startsWith="http://www.sshtools.com"/>
- <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.SshtoolsAuthorizedKeysFormat"
- defaultPath=".ssh2/authorization.xml"/>
- </RemoteIdentification>
- <RemoteIdentification defaultName="SSH2">
- <Rule contains="SSH Secure Shell"/>
- <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.SSH2AuthorizedKeysFormat"
- defaultPath=".ssh2/authorization"/>
- </RemoteIdentification>
-
-</Automation>
\ No newline at end of file
Deleted: projects/fresh/trunk/etc/fresh/ssh/hello.txt
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/hello.txt 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/hello.txt 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,3 +0,0 @@
-FRESH - The JBoss Shell v1.0
-
-Login:
Deleted: projects/fresh/trunk/etc/fresh/ssh/platform.xml
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/platform.xml 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/platform.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Platform configuration file - Determines the behaviour of platform specific services
--->
-<PlatformConfiguration>
- <!-- The process provider for executing and redirecting a process -->
- <NativeProcessProvider>org.jboss.fresh.ssh.SSHShell</NativeProcessProvider>
- <!-- The authentication provider for authenticating users and obtaining user information -->
- <NativeAuthenticationProvider>org.jboss.fresh.ssh.Cp2AuthenticationProvider</NativeAuthenticationProvider>
- <!-- The file system provider for SFTP -->
- <NativeFileSystemProvider>org.jboss.fresh.vfs</NativeFileSystemProvider>
- <!-- Native settings which may be used by the process or authentication provider -->
- <!-- Add native settings here -->
- <!-- <NativeSetting Name="AuthenticateOnDomain" Value="."/> -->
-</PlatformConfiguration>
Deleted: projects/fresh/trunk/etc/fresh/ssh/priv.skk
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/priv.skk 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/priv.skk 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,8 +0,0 @@
----- BEGIN SSHTOOLS ENCRYPTED PRIVATE KEY ----
-AAAABG5vbmUAAAFGAAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2
-USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4
-O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKS
-uYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+Zx
-BxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTx
-vqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAAAUCxrRGhfPB3cNZ5CH9aYYp6ADtLI=
----- END SSHTOOLS ENCRYPTED PRIVATE KEY ----
Deleted: projects/fresh/trunk/etc/fresh/ssh/pub.pkk
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/pub.pkk 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/pub.pkk 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,10 +0,0 @@
----- BEGIN SSH2 PUBLIC KEY ----
-AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2N
-WPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P2
-08UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAA
-AIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6Ewo
-FhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWf
-BpKLZl6Ae1UlZAFMO/7PSSoAAACBAKtWdET0vgDlDCMRTCUPOORVbMY44zIKvbvJ3XLejwgYm1FV
-tSKczMbBBrobVxqf1iCpZ0iHhwTw8+Jc2/KXpL6h0im5yZxNUH5kr8mfHUi9TBI5qCq37l8ED6B+
-s/uiVGTIzEv4wtZCoaHsEupOi15r51qjlWlTVLjwqro76Wyx
----- END SSH2 PUBLIC KEY ----
Deleted: projects/fresh/trunk/etc/fresh/ssh/server.xml
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/server.xml 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/server.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Server configuration file - Determines the behaviour of platform specific services
--->
-<ServerConfiguration>
- <!-- Path to server private key file - you need to generate it in advance of course. -->
- <ServerHostKey PrivateKeyFile="priv.skk" />
-
- <!-- Possible values for these are: ... -->
- <!--Subsytem Type="" Name="" Provider="" /-->
-
- <!-- The file system provider for SFTP -->
- <!--AuthenticationBanner>hello.txt</AuthenticationBanner--> <!-- currently doesnt work becouse of issues with loading-->
- <MaxConnections>3</MaxConnections>
- <MaxAuthentications>3</MaxAuthentications>
- <ListenAddress>127.0.0.1</ListenAddress>
- <Port>2022</Port>
- <CommandPort>2024</CommandPort>
- <TerminalProvider>vt100</TerminalProvider>
-
- <!-- Possible values: password, publickey, keyboard-interactive -->
- <AllowedAuthentication>password</AllowedAuthentication>
- <!--AllowedAuthentication>publickey</AllowedAuthentication>
- <AllowedAuthentication>keyboard-interactive</AllowedAuthentication-->
-
- <RequiredAuthentication>password</RequiredAuthentication>
-
- <AuthorizationFile>authorization.xml</AuthorizationFile>
- <UserConfigDirectory>users</UserConfigDirectory>
- <AllowTcpForwarding>false</AllowTcpForwarding>
-
-</ServerConfiguration>
Deleted: projects/fresh/trunk/etc/fresh/ssh/sshtools.xml
===================================================================
--- projects/fresh/trunk/etc/fresh/ssh/sshtools.xml 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/etc/fresh/ssh/sshtools.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- The Java SSH API Configuration file -->
-<SshAPIConfiguration>
-
- <!-- The Cipher configuration, add or overide default cipher implementations -->
- <CipherConfiguration>
- <DefaultAlgorithm>blowfish-cbc</DefaultAlgorithm>
- </CipherConfiguration>
- <!-- The Message Authentication Code configuration, add or overide default mac implementations -->
- <MacConfiguration>
- <DefaultAlgorithm>hmac-md5</DefaultAlgorithm>
- </MacConfiguration>
- <!-- The Compression configuration, add or overide default compression implementations -->
- <CompressionConfiguration>
- <DefaultAlgorithm>none</DefaultAlgorithm>
- </CompressionConfiguration>
- <!-- The Public Key configuration, add or overide default public key implementations -->
- <PublicKeyConfiguration>
- <DefaultAlgorithm>ssh-dss</DefaultAlgorithm>
-
- <DefaultPublicFormat>SECSH-PublicKey-Base64Encoded</DefaultPublicFormat>
- <DefaultPrivateFormat>SSHTools-PrivateKey-Base64Encoded</DefaultPrivateFormat>
- </PublicKeyConfiguration>
- <!-- The Authentication configuration, add or overide default authentication implementations -->
- <AuthenticationConfiguration>
-
- </AuthenticationConfiguration>
- <!-- The Key Exchange configuration, add or overide default Key Exchange implementations -->
- <KeyExchangeConfiguration>
- <DefaultAlgorithm>diffie-hellman-group1-sha1</DefaultAlgorithm>
- </KeyExchangeConfiguration>
-</SshAPIConfiguration>
Modified: projects/fresh/trunk/fresh-jar/src/main/resources/META-INF/fresh-service.xml
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/META-INF/fresh-service.xml 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/META-INF/fresh-service.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -32,6 +32,10 @@
</mbean>
+
+
+
+
<mbean code="org.jboss.fresh.deployer.SystemShellService" name="FRESH:service=SystemShell">
<attribute name="JNDIName">java:/FRESH/SystemShell</attribute>
<attribute name="ThreadPoolJNDIName">java:/FRESH/ThreadPool</attribute>
@@ -156,7 +160,6 @@
setattr /bin/alias Class org.jboss.fresh.shell.commands.AliasExe
mkdir /etc
mkdir /etc/shell
- cat > /etc/shell/init.rc &< ../fresh/init/init.rc
mkdir /usr
mkdir /usr/local
touch /usr/local/diag
@@ -175,6 +178,19 @@
</mbean>
+ <mbean code="org.jboss.fresh.deployer.VFSFileService" name="FRESH:service=init-rc">
+ <attribute name="File">/etc/shell/init.rc</attribute>
+ <attribute name="Content">set PATH = .:/bin
+set SERIALIZE_MODE = true
+set SESSION_TIMEOUT = 1800000
+set PROCESS_TIMEOUT = 60000
+ </attribute>
+ <depends>FRESH:service=VFS.Root</depends>
+ <depends>FRESH:service=SystemShell</depends>
+ <depends>FRESH:service=VFS.Mem.Init</depends>
+ </mbean>
+
+
<mbean code="org.jboss.fresh.deployer.SSHService" name="FRESH:service=SSHServer">
<attribute name="HomeDirectory">../fresh/ssh/</attribute>
<depends>FRESH:service=SystemShell</depends>
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/automation.xml (from rev 88109, projects/fresh/trunk/etc/fresh/ssh/automation.xml)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/automation.xml (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/automation.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- SSHTools automation file, defines mappings for automated configuration -->
+<Automation>
+ <RemoteIdentification defaultName="OpenSSH">
+ <Rule startsWith="OpenSSH"/>
+ <Rule startsWith="OpenSSH" contains="3.4" name="OpenSSH 3.4" priority="1"/>
+ <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.OpenSSHAuthorizedKeysFormat"
+ defaultPath=".ssh/authorized_keys"/>
+ </RemoteIdentification>
+ <RemoteIdentification defaultName="SSHTools">
+ <Rule startsWith="http://www.sshtools.com"/>
+ <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.SshtoolsAuthorizedKeysFormat"
+ defaultPath=".ssh2/authorization.xml"/>
+ </RemoteIdentification>
+ <RemoteIdentification defaultName="SSH2">
+ <Rule contains="SSH Secure Shell"/>
+ <AuthorizedKeysFormat implementationClass="com.sshtools.common.automate.SSH2AuthorizedKeysFormat"
+ defaultPath=".ssh2/authorization"/>
+ </RemoteIdentification>
+
+</Automation>
\ No newline at end of file
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/hello.txt (from rev 88109, projects/fresh/trunk/etc/fresh/ssh/hello.txt)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/hello.txt (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/hello.txt 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,3 @@
+FRESH - The JBoss Shell v1.0
+
+Login:
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/platform.xml (from rev 88114, projects/fresh/trunk/etc/fresh/ssh/platform.xml)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/platform.xml (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/platform.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Platform configuration file - Determines the behaviour of platform specific services
+-->
+<PlatformConfiguration>
+ <!-- The process provider for executing and redirecting a process -->
+ <NativeProcessProvider>org.jboss.fresh.ssh.SSHShell</NativeProcessProvider>
+ <!-- The authentication provider for authenticating users and obtaining user information -->
+ <NativeAuthenticationProvider>org.jboss.fresh.ssh.Cp2AuthenticationProvider</NativeAuthenticationProvider>
+ <!-- The file system provider for SFTP -->
+ <NativeFileSystemProvider>org.jboss.fresh.vfs</NativeFileSystemProvider>
+ <!-- Native settings which may be used by the process or authentication provider -->
+ <!-- Add native settings here -->
+ <!-- <NativeSetting Name="AuthenticateOnDomain" Value="."/> -->
+</PlatformConfiguration>
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/priv.skk (from rev 88109, projects/fresh/trunk/etc/fresh/ssh/priv.skk)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/priv.skk (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/priv.skk 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,8 @@
+---- BEGIN SSHTOOLS ENCRYPTED PRIVATE KEY ----
+AAAABG5vbmUAAAFGAAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2
+USZpRV1AIlH7WT2NWPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4
+O1fnxqimFQ8E+4P208UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKS
+uYKi64QL8Fgc9QAAAIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+Zx
+BxCBgLRJFnEj6EwoFhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTx
+vqhRkImog9/hWuWfBpKLZl6Ae1UlZAFMO/7PSSoAAAAUCxrRGhfPB3cNZ5CH9aYYp6ADtLI=
+---- END SSHTOOLS ENCRYPTED PRIVATE KEY ----
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/pub.pkk (from rev 88109, projects/fresh/trunk/etc/fresh/ssh/pub.pkk)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/pub.pkk (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/pub.pkk 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,10 @@
+---- BEGIN SSH2 PUBLIC KEY ----
+AAAAB3NzaC1kc3MAAACBAP1/U4EddRIpUt9KnC7s5Of2EbdSPO9EAMMeP4C2USZpRV1AIlH7WT2N
+WPq/xfW6MPbLm1Vs14E7gB00b/JmYLdrmVClpJ+f6AR7ECLCT7up1/63xhv4O1fnxqimFQ8E+4P2
+08UewwI1VBNaFpEy9nXzrith1yrv8iIDGZ3RSAHHAAAAFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QAA
+AIEA9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6Ewo
+FhO3zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWf
+BpKLZl6Ae1UlZAFMO/7PSSoAAACBAKtWdET0vgDlDCMRTCUPOORVbMY44zIKvbvJ3XLejwgYm1FV
+tSKczMbBBrobVxqf1iCpZ0iHhwTw8+Jc2/KXpL6h0im5yZxNUH5kr8mfHUi9TBI5qCq37l8ED6B+
+s/uiVGTIzEv4wtZCoaHsEupOi15r51qjlWlTVLjwqro76Wyx
+---- END SSH2 PUBLIC KEY ----
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/server.xml (from rev 88114, projects/fresh/trunk/etc/fresh/ssh/server.xml)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/server.xml (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/server.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Server configuration file - Determines the behaviour of platform specific services
+-->
+<ServerConfiguration>
+ <!-- Path to server private key file - you need to generate it in advance of course. -->
+ <ServerHostKey PrivateKeyFile="priv.skk" />
+
+ <!-- Possible values for these are: ... -->
+ <!--Subsytem Type="" Name="" Provider="" /-->
+
+ <!-- The file system provider for SFTP -->
+ <!--AuthenticationBanner>hello.txt</AuthenticationBanner--> <!-- currently doesnt work becouse of issues with loading-->
+ <MaxConnections>3</MaxConnections>
+ <MaxAuthentications>3</MaxAuthentications>
+ <ListenAddress>127.0.0.1</ListenAddress>
+ <Port>2022</Port>
+ <CommandPort>2024</CommandPort>
+ <TerminalProvider>vt100</TerminalProvider>
+
+ <!-- Possible values: password, publickey, keyboard-interactive -->
+ <AllowedAuthentication>password</AllowedAuthentication>
+ <!--AllowedAuthentication>publickey</AllowedAuthentication>
+ <AllowedAuthentication>keyboard-interactive</AllowedAuthentication-->
+
+ <RequiredAuthentication>password</RequiredAuthentication>
+
+ <AuthorizationFile>authorization.xml</AuthorizationFile>
+ <UserConfigDirectory>users</UserConfigDirectory>
+ <AllowTcpForwarding>false</AllowTcpForwarding>
+
+</ServerConfiguration>
Copied: projects/fresh/trunk/fresh-jar/src/main/resources/sshtools.xml (from rev 88109, projects/fresh/trunk/etc/fresh/ssh/sshtools.xml)
===================================================================
--- projects/fresh/trunk/fresh-jar/src/main/resources/sshtools.xml (rev 0)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/sshtools.xml 2009-05-01 23:42:02 UTC (rev 88115)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- The Java SSH API Configuration file -->
+<SshAPIConfiguration>
+
+ <!-- The Cipher configuration, add or overide default cipher implementations -->
+ <CipherConfiguration>
+ <DefaultAlgorithm>blowfish-cbc</DefaultAlgorithm>
+ </CipherConfiguration>
+ <!-- The Message Authentication Code configuration, add or overide default mac implementations -->
+ <MacConfiguration>
+ <DefaultAlgorithm>hmac-md5</DefaultAlgorithm>
+ </MacConfiguration>
+ <!-- The Compression configuration, add or overide default compression implementations -->
+ <CompressionConfiguration>
+ <DefaultAlgorithm>none</DefaultAlgorithm>
+ </CompressionConfiguration>
+ <!-- The Public Key configuration, add or overide default public key implementations -->
+ <PublicKeyConfiguration>
+ <DefaultAlgorithm>ssh-dss</DefaultAlgorithm>
+
+ <DefaultPublicFormat>SECSH-PublicKey-Base64Encoded</DefaultPublicFormat>
+ <DefaultPrivateFormat>SSHTools-PrivateKey-Base64Encoded</DefaultPrivateFormat>
+ </PublicKeyConfiguration>
+ <!-- The Authentication configuration, add or overide default authentication implementations -->
+ <AuthenticationConfiguration>
+
+ </AuthenticationConfiguration>
+ <!-- The Key Exchange configuration, add or overide default Key Exchange implementations -->
+ <KeyExchangeConfiguration>
+ <DefaultAlgorithm>diffie-hellman-group1-sha1</DefaultAlgorithm>
+ </KeyExchangeConfiguration>
+</SshAPIConfiguration>
Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/VFSFileService.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/VFSFileService.java 2009-05-01 23:18:15 UTC (rev 88114)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/VFSFileService.java 2009-05-01 23:42:02 UTC (rev 88115)
@@ -1,278 +1,297 @@
package org.jboss.fresh.deployer;
-import java.io.*;
-import java.net.URL;
-import javax.naming.InitialContext;
-import javax.naming.Context;
-
-import org.jboss.fresh.shell.ejb.RemoteShell;
-import org.jboss.fresh.shell.ejb.RemoteShellHome;
+import org.jboss.fresh.io.IOUtils;
+import org.jboss.fresh.registry.RegistryContext;
+import org.jboss.fresh.shell.ProcessInfo;
import org.jboss.fresh.shell.Shell;
import org.jboss.fresh.shell.ShellOutputStream;
import org.jboss.fresh.shell.SystemShell;
-import org.jboss.fresh.shell.ProcessInfo;
-import org.jboss.fresh.registry.RegistryContext;
-import org.jboss.fresh.io.IOUtils;
+import org.jboss.fresh.shell.ejb.RemoteShell;
+import javax.naming.Context;
+import java.io.InputStream;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+
/**
* Service creates a file in VFS.
- **/
+ */
public class VFSFileService extends ServiceModule implements VFSFileServiceMBean {
- private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(VFSFileService.class);
- static final org.apache.log4j.Level TRACE = new ApacheLevel(5000, "TRACE", 7);
- static final org.apache.log4j.Level NOTICE = new ApacheLevel(25000, "NOTICE", 5);
+ private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(VFSFileService.class);
+ static final org.apache.log4j.Level TRACE = new ApacheLevel(5000, "TRACE", 7);
+ static final org.apache.log4j.Level NOTICE = new ApacheLevel(25000, "NOTICE", 5);
- static class ApacheLevel extends org.apache.log4j.Level {
- protected ApacheLevel(int level, String levelStr, int syslogEquivalent) {
- super(level, levelStr, syslogEquivalent);
- }
- }
+ static class ApacheLevel extends org.apache.log4j.Level {
+ protected ApacheLevel(int level, String levelStr, int syslogEquivalent) {
+ super(level, levelStr, syslogEquivalent);
+ }
+ }
private String file;
- private String content;
- private String sourceFile;
- private String classpathFile;
- private URL url;
+ private String content;
+ private String sourceFile;
+ private String classpathFile;
+ private URL url;
public String getName() {
- return "VFS File Service";
+ return "VFS File Service";
}
public void setFile(String file) {
- this.file = file;
+ this.file = file;
}
public String getFile() {
- return file;
+ return file;
}
public void setContent(String content) {
- this.content = content;
+ this.content = content;
}
public String getContent() {
- return content;
+ return content;
}
- public void setFilePath(String sourceFile) {
- this.sourceFile = sourceFile;
- }
-
- public String getFilePath() {
- return sourceFile;
- }
+ public void setFilePath(String sourceFile) {
+ this.sourceFile = sourceFile;
+ }
- public void setResourcePath(String classpathFile) {
- this.classpathFile = classpathFile;
- }
-
- public String getResourcePath() {
- return classpathFile;
- }
+ public String getFilePath() {
+ return sourceFile;
+ }
- public void setUrl(String url) throws java.net.MalformedURLException {
- this.url = new URL(url);
- }
-
- public String getUrl() {
- return url == null ? null : url.toString();
- }
+ public void setResourcePath(String classpathFile) {
+ this.classpathFile = classpathFile;
+ }
+ public String getResourcePath() {
+ return classpathFile;
+ }
+ public void setUrl(String url) throws java.net.MalformedURLException {
+ this.url = new URL(url);
+ }
+
+ public String getUrl() {
+ return url == null ? null : url.toString();
+ }
+
+
public void doStart() throws Exception {
- if(file == null || file.trim().length() == 0) {
- throw new Exception("File name not defined. Please define VFS file name.");
- }
+ if (file == null || file.trim().length() == 0) {
+ throw new Exception("File name not defined. Please define VFS file name.");
+ }
- Context ctx = null;
- Shell shell = null;
- RemoteShell rshell = null;
- ShellOutputStream sos = null;
- OutputStreamWriter osw = null;
- try {
- ctx = new RegistryContext();
+ Context ctx = null;
+ Shell shell = null;
+ RemoteShell rshell = null;
+ ShellOutputStream sos = null;
+ OutputStreamWriter osw = null;
+ try {
+ ctx = new RegistryContext();
- try {
- SystemShell sysshell = (SystemShell) ctx.lookup("SystemShell");
- log.log(TRACE, "Retrieved SystemShell from RegistryContext: 'SystemShell'.");
- shell = sysshell.startSession(null, false);
- } catch (javax.naming.NameNotFoundException nnfe) {
- ctx.close();
- ctx = new InitialContext();
- RemoteShellHome home = null;
- try {
- home = (RemoteShellHome) ctx.lookup("ShellSession");
- log.log(TRACE, "Retrieved RemoteShellHome from InitialContext: 'ShellSession'.");
- rshell = home.create();
- } catch (javax.naming.NameNotFoundException nnfe2) {
- try {
- home = (RemoteShellHome) ctx.lookup("java:/CP2/ShellSession");
- log.log(TRACE, "Retrieved RemoteShellHome from InitialContext: 'java:/CP2/ShellSession'.");
- rshell = home.create();
- } catch (javax.naming.NameNotFoundException nnfe3) {
- SystemShell sysshell = (SystemShell) ctx.lookup("java:/CP2/SystemShell");
- log.log(TRACE, "Retrieved SystemShell from InitialContext: 'java:/CP2/SystemShell'.");
- shell = sysshell.startSession(null, false);
- }
- }
- }
- log.debug("Using shell: " + shell);
+ try {
+ SystemShell sysshell = (SystemShell) ctx.lookup("java:/FRESH/SystemShell");
+ log.log(TRACE, "Retrieved SystemShell from RegistryContext: 'SystemShell'.");
+ shell = sysshell.startSession(null, false);
+ } catch (javax.naming.NameNotFoundException nnfe) {
+ throw nnfe;
- String path = "";
- String[] parts = file.split("/");
- for(int i = 0; i < parts.length - 1; i++) {
- path = path + "/" + parts[i];
- String cmd = "mkdir " + path;
- log.debug(cmd);
- if(shell != null) {
- shell.executeAsObject(cmd);
- } else {
- rshell.executeAsObject(cmd);
- }
- }
-
- log.info("Creating file " + file);
- String cmd;
+ }
+ log.debug("Using shell: " + shell);
- boolean create = true;
- if(classpathFile != null && classpathFile.length() > 0) {
- url = this.getClass().getResource(classpathFile);
- if(url != null) {
- log.debug("Located resource using class.getResource(): " + url.toExternalForm());
- content = null;
- } else {
- url = Thread.currentThread().getContextClassLoader().getResource(classpathFile);
- if(url != null) {
- log.debug("Located using context class loader: " + url.toExternalForm());
- content = null;
- } else {
- log.warn("ClassPath file defined to '" + classpathFile + "' but not found using getResource() mechanism.");
- create = false;
- }
- }
- }
-
- // content over matter
- if(content != null && content.length() > 0) {
-
- java.io.StringReader sr = null;
- java.io.BufferedReader br = null;
+ String path = "";
+ String[] parts = file.split("/");
+ for (int i = 0; i < parts.length - 1; i++) {
+ path = path + "/" + parts[i];
+ String cmd = "mkdir " + path;
+ log.debug(cmd);
+ if (shell != null) {
+ shell.executeAsObject(cmd);
+ } else {
+ rshell.executeAsObject(cmd);
+ }
+ }
- try {
- sr = new java.io.StringReader(content);
- br = new java.io.BufferedReader(sr);
-
- // let's style it a bit
- if(br.readLine().trim().length() == 0) {
- log.debug("Whitespace removal activated.");
+ log.info("Creating file " + file);
+ String cmd;
- StringBuffer result = new StringBuffer(content.length());
- String whitespace = null;
- boolean first = true;
- String line = br.readLine();
- while(line != null) {
- if(first) {
- int i = 0;
- while(i < line.length() && Character.isWhitespace(line.charAt(i))) {}
+ boolean create = true;
+ if (classpathFile != null && classpathFile.length() > 0) {
+ url = this.getClass().getResource(classpathFile);
+ if (url != null) {
+ log.debug("Located resource using class.getResource(): " + url.toExternalForm());
+ content = null;
+ } else {
+ url = Thread.currentThread().getContextClassLoader().getResource(classpathFile);
+ if (url != null) {
+ log.debug("Located using context class loader: " + url.toExternalForm());
+ content = null;
+ } else {
+ log.warn("ClassPath file defined to '" + classpathFile + "' but not found using getResource() mechanism.");
+ create = false;
+ }
+ }
+ }
- if(i == line.length() - 1) {
- whitespace = "";
- } else {
- whitespace = line.substring(0, i);
- log.log(TRACE, "Removing " + whitespace.length() + " whitespace characters from lines.");
- }
- first = false;
- }
- if(line.startsWith(whitespace)) {
- line = line.substring(whitespace.length());
- }
- result.append(line).append("\r\n");
-
- line = br.readLine();
- }
+ // content over matter
+ if (content != null && content.length() > 0) {
- content = result.toString();
- }
-
- } finally {
- if(br!= null) { try { br.close(); } catch (Exception e) { } }
- if(sr!= null) { try { sr.close(); } catch (Exception e) { } }
- }
-
- ProcessInfo pinf = null;
- cmd = "cat > " + file;
- log.debug(cmd);
- if(shell != null) {
- pinf = shell.execute(cmd);
- sos = new ShellOutputStream(shell, pinf.procid);
- } else {
- pinf = rshell.execute(cmd);
- sos = new ShellOutputStream(rshell, pinf.procid);
- }
- osw = new OutputStreamWriter(sos, "UTF-8");
- osw.write(content);
- log.log(NOTICE, "Created file " + file + ", processed " + content.length() + " characters.");
- } else if(sourceFile != null && sourceFile.length() > 0) {
- java.io.File f = new java.io.File(sourceFile);
- if(!f.exists()) {
- log.error("File " + f.getAbsolutePath() + " does not exist! Will not create VFS file: " + file);
- return;
- }
- if(!f.isFile()) {
- log.error("Path " + f.getAbsolutePath() + " is not a file! Will not create VFS file: " + file);
- return;
- }
- cmd = "cat > " + file + " &< " + f.getAbsolutePath();
- log.debug(cmd);
- if(shell != null) {
- shell.execute(cmd);
- } else {
- rshell.execute(cmd);
- }
- log.log(NOTICE, "Created file " + file + ", wrote " + f.length() + " bytes.");
- } else if (url != null) {
- InputStream is = null;
- try {
- java.net.URLConnection uc = url.openConnection();
- uc.setConnectTimeout(30 * 1000);
- uc.setReadTimeout(60 * 1000);
- is = uc.getInputStream();
+ java.io.StringReader sr = null;
+ java.io.BufferedReader br = null;
- ProcessInfo pinf = null;
- cmd = "cat > " + file;
- log.debug(cmd);
- if(shell != null) {
- pinf = shell.execute(cmd);
- sos = new ShellOutputStream(shell, pinf.procid);
- } else {
- pinf = rshell.execute(cmd);
- sos = new ShellOutputStream(rshell, pinf.procid);
- }
+ try {
+ sr = new java.io.StringReader(content);
+ br = new java.io.BufferedReader(sr);
- long size = IOUtils.copy(is, sos);
+ // let's style it a bit
+ if (br.readLine().trim().length() == 0) {
+ log.debug("Whitespace removal activated.");
- log.log(NOTICE, "Created file " + file + ", processed " + size + " bytes.");
- } finally {
- if(is!= null) { try { is.close(); } catch (Exception e) { } }
- }
- } else if(create) {
- cmd = "touch " + file;
- log.debug(cmd);
- if(shell != null) {
- shell.execute(cmd);
- } else {
- rshell.execute(cmd);
- }
- log.log(NOTICE, "Created empty file " + file + ".");
- }
-
- } finally {
- if(ctx != null) { try { ctx.close(); } catch (Exception e) { } }
- // should not close shells. if(shell != null) { try { shell.close(); } catch (Exception e) { } }
- if(rshell != null) { try { rshell.remove(); } catch (Exception e) { } }
- if(osw != null) { try { osw.close(); } catch (Exception e) { } }
- if(sos != null) { try { sos.close(); } catch (Exception e) { } }
- }
+ StringBuffer result = new StringBuffer(content.length());
+ String whitespace = null;
+ boolean first = true;
+ String line = br.readLine();
+ while (line != null) {
+ if (first) {
+ int i = 0;
+ while (i < line.length() && Character.isWhitespace(line.charAt(i))) {
+ }
+
+ if (i == line.length() - 1) {
+ whitespace = "";
+ } else {
+ whitespace = line.substring(0, i);
+ log.log(TRACE, "Removing " + whitespace.length() + " whitespace characters from lines.");
+ }
+ first = false;
+ }
+ if (line.startsWith(whitespace)) {
+ line = line.substring(whitespace.length());
+ }
+ result.append(line).append("\r\n");
+
+ line = br.readLine();
+ }
+
+ content = result.toString();
+ }
+
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (Exception e) {
+ }
+ }
+ if (sr != null) {
+ try {
+ sr.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+
+ ProcessInfo pinf = null;
+ cmd = "cat > " + file;
+ log.debug(cmd);
+ if (shell != null) {
+ pinf = shell.execute(cmd);
+ sos = new ShellOutputStream(shell, pinf.procid);
+ } else {
+ pinf = rshell.execute(cmd);
+ sos = new ShellOutputStream(rshell, pinf.procid);
+ }
+ osw = new OutputStreamWriter(sos, "UTF-8");
+ osw.write(content);
+ log.log(NOTICE, "Created file " + file + ", processed " + content.length() + " characters.");
+ } else if (sourceFile != null && sourceFile.length() > 0) {
+ java.io.File f = new java.io.File(sourceFile);
+ if (!f.exists()) {
+ log.error("File " + f.getAbsolutePath() + " does not exist! Will not create VFS file: " + file);
+ return;
+ }
+ if (!f.isFile()) {
+ log.error("Path " + f.getAbsolutePath() + " is not a file! Will not create VFS file: " + file);
+ return;
+ }
+ cmd = "cat > " + file + " &< " + f.getAbsolutePath();
+ log.debug(cmd);
+ if (shell != null) {
+ shell.execute(cmd);
+ } else {
+ rshell.execute(cmd);
+ }
+ log.log(NOTICE, "Created file " + file + ", wrote " + f.length() + " bytes.");
+ } else if (url != null) {
+ InputStream is = null;
+ try {
+ java.net.URLConnection uc = url.openConnection();
+ uc.setConnectTimeout(30 * 1000);
+ uc.setReadTimeout(60 * 1000);
+ is = uc.getInputStream();
+
+ ProcessInfo pinf = null;
+ cmd = "cat > " + file;
+ log.debug(cmd);
+ if (shell != null) {
+ pinf = shell.execute(cmd);
+ sos = new ShellOutputStream(shell, pinf.procid);
+ } else {
+ pinf = rshell.execute(cmd);
+ sos = new ShellOutputStream(rshell, pinf.procid);
+ }
+
+ long size = IOUtils.copy(is, sos);
+
+ log.log(NOTICE, "Created file " + file + ", processed " + size + " bytes.");
+ } finally {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (Exception e) {
+ }
+ }
+ }
+ } else if (create) {
+ cmd = "touch " + file;
+ log.debug(cmd);
+ if (shell != null) {
+ shell.execute(cmd);
+ } else {
+ rshell.execute(cmd);
+ }
+ log.log(NOTICE, "Created empty file " + file + ".");
+ }
+
+ } finally {
+ if (ctx != null) {
+ try {
+ ctx.close();
+ } catch (Exception e) {
+ }
+ }
+ // should not close shells. if(shell != null) { try { shell.close(); } catch (Exception e) { } }
+ if (rshell != null) {
+ try {
+ rshell.remove();
+ } catch (Exception e) {
+ }
+ }
+ if (osw != null) {
+ try {
+ osw.close();
+ } catch (Exception e) {
+ }
+ }
+ if (sos != null) {
+ try {
+ sos.close();
+ } catch (Exception e) {
+ }
+ }
+ }
}
}
More information about the jboss-cvs-commits
mailing list