[jboss-cvs] JBossAS SVN: r88082 - in projects/fresh/trunk: fresh-jar/src/main/resources/META-INF and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 30 19:58:36 EDT 2009


Author: ctomc
Date: 2009-04-30 19:58:36 -0400 (Thu, 30 Apr 2009)
New Revision: 88082

Removed:
   projects/fresh/trunk/fresh-shell/src/main/java/com/
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/parsek/
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/TxExe.java
   projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java
   projects/fresh/trunk/fresh-vfs/src/main/java/com/
   projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/parsek/
   projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/hibernate/
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/ContextBinder.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/remoteshell/ejb/impl/RemoteShellImpl.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/AbstractExecutable.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/AbstractInvokeExe.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/RunExe.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/util/WebGetExe.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/Process.java
   projects/fresh/trunk/fresh-vfs/pom.xml
   projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/LazyVFSOutputStream.java
   projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/disk/DiskVFSMeta.java
   projects/fresh/trunk/pom.xml
Log:
removed dependancy to UserTransaction, removed TxSupport, will be added if realy needed
removed hibernate vfs implementation becouse it was realy old and should be replaced with jpa based, removed dependancy to hibernate 3


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-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-jar/src/main/resources/META-INF/fresh-service.xml	2009-04-30 23:58:36 UTC (rev 88082)
@@ -181,7 +181,7 @@
         <attribute name="UseLocal">true</attribute>
         <attribute name="SvcName">java:/FRESH/SystemShell</attribute>
         <depends>FRESH:service=SystemShell</depends>
-        <depends>jboss:service=ClientUserTransaction</depends>
+        
 
     </mbean>
     <mbean code="org.jboss.fresh.deployer.SSHService" name="FRESH:service=SSHServer">

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/ContextBinder.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/ContextBinder.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/ContextBinder.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -10,10 +10,8 @@
 import org.jboss.fresh.ctx.Context;
 
 /**
- * @author strukelj
+ * @author Marko Strukelj
  *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
  */
 public class ContextBinder extends RegistryNamingBinder implements ContextBinderMBean {
 
@@ -22,19 +20,12 @@
 	 */
 	public ContextBinder() {
 		super();
-		// TODO Auto-generated constructor stub
 	}
 
-	/* (non-Javadoc)
-	 * @see com.parsek.deployer.modules.RegistryNamingBinder#classToInstance(java.lang.Class)
-	 */
 	protected Object classToInstance(Class c) {
 		return new FlatContext();
 	}
 
-	/* (non-Javadoc)
-	 * @see com.parsek.deployer.modules.RegistryNamingBinder#getBindClass()
-	 */
 	protected String getBindClass() {
 		return Context.class.getName();
 	}

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/remoteshell/ejb/impl/RemoteShellImpl.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/remoteshell/ejb/impl/RemoteShellImpl.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/remoteshell/ejb/impl/RemoteShellImpl.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -23,7 +23,6 @@
 import org.jboss.fresh.shell.ShellIOException;
 import org.jboss.fresh.shell.ShellInitializationException;
 import org.jboss.fresh.shell.SystemShell;
-import org.jboss.fresh.util.TxSupport;
 
 /**
  * Shell session can timeout. Using a timed-out session is like having a ghost around. Even the system is not aware of it, so
@@ -72,9 +71,9 @@
 		this.interactive = interactive;
 		this.sessid = sessid;
 		try {
-			if (sctx != null) {
+			/*if (sctx != null) {
 				TxSupport.assignUTForThread(sctx.getUserTransaction());
-			}
+			}*/
 
 			reinitShell();
 
@@ -87,9 +86,9 @@
 			}
 		} catch (Exception ex) {
 			throw new ShellInitializationException(ex);
-		} finally {
+		}/* finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 //	public void ejbPostCreate(String sessid) {
@@ -97,9 +96,9 @@
 
 	public void ejbRemove() {
 		try {
-			if (sctx != null) {
+			/*if (sctx != null) {
 				TxSupport.assignUTForThread(sctx.getUserTransaction());
-			}
+			}*/
 
 			if (shell == null) {
 				ejbActivate();
@@ -115,9 +114,9 @@
 			} else {
 				log.error("Error while removing EJB!", ex);
 			}
-		} finally {
+		}/* finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 	public void setSessionContext(SessionContext ctx) {
@@ -147,7 +146,7 @@
 		//log.debug("ejbActivate called");
 		try {
 			if (sctx != null) {
-				TxSupport.assignUTForThread(sctx.getUserTransaction());
+				//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			}
 			reinitShell();
 		} catch (Exception ex) {
@@ -157,7 +156,7 @@
 				log.error("Error while activating EJB!", ex);
 			}
 		} finally {
-			TxSupport.clearUTForThread();
+			//TxSupport.clearUTForThread();
 		}
 	}
 
@@ -217,7 +216,7 @@
 
 	public ProcessInfo execute(String cmdline, List input) throws ShellException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			log_cmd.debug(cmdline);
 			return shell.execute(cmdline, input, true);
@@ -248,9 +247,9 @@
 			} else {
 				throw new ShellException(th);
 			}
-		} finally {
+		} /*finally {
 			TxSupport.clearUTForThread();
-		}
+		}   */
 	}
 /*
 	public String executeAsString(String cmdline) throws ShellException {
@@ -296,7 +295,7 @@
 	public Object executeAsObject(String cmdline, List input) throws ShellException {
 		try {
 			UserTransaction tx = sctx.getUserTransaction();
-			TxSupport.assignUTForThread(tx);
+			//TxSupport.assignUTForThread(tx);
 
 			reinitShell();
 			log_cmd.debug(cmdline);
@@ -328,14 +327,14 @@
 			} else {
 				throw new ShellException(th);
 			}
-		} finally {
+		}/* finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 	public String getEnvProperty(String propname) throws ShellException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			return shell.getEnvProperty(propname);
 		} catch (RuntimeException e) {
@@ -365,14 +364,14 @@
 			} else {
 				throw new ShellException(th);
 			}
-		} finally {
+		} /*finally {
 			TxSupport.clearUTForThread();
-		}
+		}   */
 	}
 
 	public Properties getEnvProperties() throws ShellException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			return shell.getEnvProperties();
 		} catch (RuntimeException e) {
@@ -402,14 +401,14 @@
 			} else {
 				throw new ShellException(th);
 			}
-		} finally {
+		} /*finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 	public void setEnvProperty(String name, String value) throws ShellException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			shell.setEnvProperty(name, value);
 		} catch (RuntimeException e) {
@@ -439,14 +438,14 @@
 			} else {
 				throw new ShellException(th);
 			}
-		} finally {
+		}/* finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 	public Object read(String id) throws IOException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			Object obj = shell.read(id);
 			//log.debug("### obj: " + obj);
@@ -470,14 +469,14 @@
 			} else {
 				throw new ShellIOException(th);
 			}
-		} finally {
+		}/* finally {
 			TxSupport.assignUTForThread(sctx.getUserTransaction());
-		}
+		}*/
 	}
 
 	public LinkedList readBuffer(String id, int maxsize) throws IOException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			LinkedList l = shell.readBuffer(id, maxsize);
 			//log.debug("### list: (" + l.size() +") "  + l);
@@ -502,14 +501,14 @@
 			} else {
 				throw new ShellIOException(th);
 			}
-		} finally {
+		} /*finally {
 			TxSupport.clearUTForThread();
-		}
+		} */
 	}
 
 	public void write(String id, Object obj) throws IOException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			shell.write(id, obj);
 		} catch (RuntimeException e) {
@@ -531,14 +530,14 @@
 			} else {
 				throw new ShellIOException(th);
 			}
-		} finally {
+		}/* finally {
 			TxSupport.clearUTForThread();
-		}
+		}*/
 	}
 
 	public void writeBuffer(String id, LinkedList obj) throws IOException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			shell.writeBuffer(id, obj);
 		} catch (RuntimeException e) {
@@ -560,15 +559,15 @@
 			} else {
 				throw new ShellIOException(th);
 			}
-		} finally {
+		} /*finally {
 			TxSupport.clearUTForThread();
-		}
+		}   */
 	}
 
 	// means only the specified process
 	public void close(String id, int streamid) throws IOException {
 		try {
-			TxSupport.assignUTForThread(sctx.getUserTransaction());
+			//TxSupport.assignUTForThread(sctx.getUserTransaction());
 			reinitShell();
 			shell.close(id, streamid);
 		} catch (RuntimeException e) {
@@ -591,7 +590,7 @@
 				throw new ShellIOException(th);
 			}
 		} finally {
-			TxSupport.clearUTForThread();
+			//TxSupport.clearUTForThread();
 		}
 	}
 

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/AbstractExecutable.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/AbstractExecutable.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/AbstractExecutable.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -8,7 +8,6 @@
 import org.jboss.fresh.io.BufferWriter;
 import org.jboss.fresh.io.BufferInputStream;
 import org.jboss.fresh.io.BufferOutputStream;
-import org.jboss.fresh.util.TxSupport;
 import org.jboss.fresh.shell.impl.Process;
 
 import java.io.PrintWriter;
@@ -709,16 +708,16 @@
 	}
 
 	protected void txOn() throws Exception {
-		if (!TxSupport.isActive()) {
+		/*if (!TxSupport.isActive()) {
 			TxSupport.begin();
-		}
+		}*/
 
 	}
 
 	protected void txOff() throws Exception {
-		if (TxSupport.isActive()) {
+		/*if (TxSupport.isActive()) {
 			TxSupport.commit();
-		}
+		}*/
 	}
 
 

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/AbstractInvokeExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/AbstractInvokeExe.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/AbstractInvokeExe.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -1,186 +1,154 @@
 package org.jboss.fresh.shell.commands;
 
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.StringTokenizer;
-
 import org.apache.log4j.Logger;
 import org.jboss.fresh.io.BufferObjectReader;
 import org.jboss.fresh.io.BufferObjectWriter;
 import org.jboss.fresh.io.BufferWriter;
 import org.jboss.fresh.io.PrintWriter2;
 import org.jboss.fresh.shell.AbstractExecutable;
-import org.jboss.fresh.util.TxSupport;
 
+import java.io.PrintWriter;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.StringTokenizer;
+
 /**
  * @author ales.justin at jboss.org
  */
-public abstract class AbstractInvokeExe extends AbstractExecutable
-{
-   protected abstract Logger getLog();
+public abstract class AbstractInvokeExe extends AbstractExecutable {
+    protected abstract Logger getLog();
 
-   protected abstract String getCmd();
+    protected abstract String getCmd();
 
-   //	cat [PATHS]
-   public void process(String exename, String[] params) throws Exception
-   {
-      getLog().debug("entered");
+    //	cat [PATHS]
+    public void process(String exename, String[] params) throws Exception {
+        getLog().debug("entered");
 
-      if (helpRequested())
-      {
-         PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
-         out.println("Usage: " + getCmd() + " [-ex] [-notx] <service name> <method sig>");
-         out.println("			--help : this help");
-         out.close();
-         getLog().debug("done");
-         return;
-      }
+        if (helpRequested()) {
+            PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
+            out.println("Usage: " + getCmd() + " [-ex] [-notx] <service name> <method sig>");
+            out.println("			--help : this help");
+            out.close();
+            getLog().debug("done");
+            return;
+        }
 
-      // zaklju�imo transakcijo �e je za�eta
-      // get mbean name
-      // get method
-      PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
+        // zaklju�imo transakcijo �e je za�eta
+        // get mbean name
+        // get method
+        PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
 
-      if (params.length < 2)
-      {
-         if (canThrowEx())
-         {
-            throw new Exception("Wrong number of parameters. Usage: " + getCmd() + " [-notx] <service name> <method sig>");
-         }
-         else
-         {
-            printUsage(out);
-            return;
-         }
-      }
+        if (params.length < 2) {
+            if (canThrowEx()) {
+                throw new Exception("Wrong number of parameters. Usage: " + getCmd() + " [-notx] <service name> <method sig>");
+            } else {
+                printUsage(out);
+                return;
+            }
+        }
 
-      String mbeanName = params[0];
-      String method = params[1];
+        String mbeanName = params[0];
+        String method = params[1];
 
-      boolean notx = false;
-      boolean wasActive = false;
+        boolean notx = false;
+        boolean wasActive = false;
 
-      if (params[0].equals("-notx"))
-      {
-         notx = true;
-         mbeanName = params[1];
+        if (params[0].equals("-notx")) {
+            notx = true;
+            mbeanName = params[1];
 
-         if (params.length < 3)
-         {
-            if (canThrowEx())
-            {
-               throw new Exception("Wrong number of parameters. Usage: " + getCmd() + " [-notx] <srevice name> <method sig>");
+            if (params.length < 3) {
+                if (canThrowEx()) {
+                    throw new Exception("Wrong number of parameters. Usage: " + getCmd() + " [-notx] <srevice name> <method sig>");
+                } else {
+                    printUsage(out);
+                    return;
+                }
             }
-            else
-            {
-               printUsage(out);
-               return;
-            }
-         }
 
-         method = params[2];
-      }
+            method = params[2];
+        }
 
 
-      String methodName;
-      String[] sig = null;
-      Object[] vals = null;
+        String methodName;
+        String[] sig = null;
+        Object[] vals = null;
 
-      int pos = method.indexOf("(");
+        int pos = method.indexOf("(");
 
-      if (pos >= 0)
-      {
-         methodName = method.substring(0, pos);
-         int epos = method.lastIndexOf(")");
-         String prs;
-         if (epos != -1)
-         {
-            prs = method.substring(pos + 1, epos);
-         }
-         else
-         {
-            prs = method.substring(pos + 1);
-         }
+        if (pos >= 0) {
+            methodName = method.substring(0, pos);
+            int epos = method.lastIndexOf(")");
+            String prs;
+            if (epos != -1) {
+                prs = method.substring(pos + 1, epos);
+            } else {
+                prs = method.substring(pos + 1);
+            }
 
-         LinkedList l = new LinkedList();
-         StringTokenizer st = new StringTokenizer(prs, ",");
-         while (st.hasMoreTokens())
-         {
-            l.add(st.nextToken());
-         }
+            LinkedList l = new LinkedList();
+            StringTokenizer st = new StringTokenizer(prs, ",");
+            while (st.hasMoreTokens()) {
+                l.add(st.nextToken());
+            }
 
-         sig = new String[l.size()];
-         Iterator it = l.iterator();
-         for (int i = 0; i < sig.length && it.hasNext(); i++)
-         {
-            sig[i] = (String)it.next();
-         }
+            sig = new String[l.size()];
+            Iterator it = l.iterator();
+            for (int i = 0; i < sig.length && it.hasNext(); i++) {
+                sig[i] = (String) it.next();
+            }
 
-         vals = new Object[sig.length];
-      }
-      else
-      {
-         methodName = method;
-      }
+            vals = new Object[sig.length];
+        } else {
+            methodName = method;
+        }
 
-      BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
-      BufferObjectReader oin = new BufferObjectReader(getStdIn());
+        BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
+        BufferObjectReader oin = new BufferObjectReader(getStdIn());
 
-      if (vals != null)
-      {
-         for (int i = 0; i < vals.length; i++)
-         {
+        if (vals != null) {
+            for (int i = 0; i < vals.length; i++) {
 
-            if (!oin.isFinished())
-               vals[i] = oin.readObject();
-            else if (canThrowEx())
-            {
-               throw new Exception("Not enough input objects on stdin.");
+                if (!oin.isFinished())
+                    vals[i] = oin.readObject();
+                else if (canThrowEx()) {
+                    throw new Exception("Not enough input objects on stdin.");
+                } else {
+                    out.println("Not enough input objects on stdin.");
+                    return;
+                }
             }
-            else
-            {
-               out.println("Not enough input objects on stdin.");
-               return;
+        }
+
+        /*
+        if (notx) {
+            // if in tx, do this in another thread - through remote
+            // or
+            if (TxSupport.isActive()) {
+                wasActive = true;
+                TxSupport.commit();
             }
-         }
-      }
+        } */
 
+        try {
+            invoke(out, mbeanName, methodName, sig, vals, oout);
+        }
+        finally {
+           /* if (wasActive && !TxSupport.isActive()) {
+                TxSupport.begin();
+            } */
+        }
 
-      if (notx)
-      {
-         // if in tx, do this in another thread - through remote
-         // or
-         if (TxSupport.isActive())
-         {
-            wasActive = true;
-            TxSupport.commit();
-         }
-      }
+        oout.close();
+        oin.close();
 
-      try
-      {
-         invoke(out, mbeanName, methodName, sig, vals, oout);
-      }
-      finally
-      {
-         if (wasActive && !TxSupport.isActive())
-         {
-            TxSupport.begin();
-         }
-      }
+        getLog().debug("done");
+    }
 
-      oout.close();
-      oin.close();
+    protected abstract void invoke(PrintWriter out, String mbeanName, String methodName, String[] sig, Object[] vals, BufferObjectWriter oout) throws Exception;
 
-      getLog().debug("done");
-   }
-
-   protected abstract void invoke(PrintWriter out, String mbeanName, String methodName, String[] sig, Object[] vals, BufferObjectWriter oout) throws Exception;
-
-   private void printUsage(PrintWriter pout)
-   {
-      pout.println(" Usage: " + getCmd() + " [-notx] <service name> <method sig>");
-      pout.println();
-   }
+    private void printUsage(PrintWriter pout) {
+        pout.println(" Usage: " + getCmd() + " [-notx] <service name> <method sig>");
+        pout.println();
+    }
 }
\ No newline at end of file

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/RunExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/RunExe.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/RunExe.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -1,20 +1,19 @@
 package org.jboss.fresh.shell.commands;
 
 
-import org.jboss.fresh.vfs.FileName;
-import org.jboss.fresh.vfs.impl.SecureVFS;
-import org.jboss.fresh.vfs.impl.VFSInputStream;
+import org.jboss.fresh.io.*;
 import org.jboss.fresh.shell.AbstractExecutable;
 import org.jboss.fresh.shell.ProcessInfo;
 import org.jboss.fresh.shell.ShellException;
 import org.jboss.fresh.shell.impl.ShellImpl;
-import org.jboss.fresh.util.TxSupport;
-import org.jboss.fresh.io.*;
+import org.jboss.fresh.vfs.FileName;
+import org.jboss.fresh.vfs.impl.SecureVFS;
+import org.jboss.fresh.vfs.impl.VFSInputStream;
 
 import java.io.BufferedReader;
+import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
-import java.io.IOException;
 
 
 // EX OK
@@ -22,72 +21,70 @@
 
 public class RunExe extends AbstractExecutable {
 
-	//private static transient org.jboss.fresh.parsek.logging.Logger log = org.jboss.fresh.parsek.logging.Logger.getLogger(RunExe.class);
+    //private static transient org.jboss.fresh.parsek.logging.Logger log = org.jboss.fresh.parsek.logging.Logger.getLogger(RunExe.class);
 
-	private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(RunExe.class);
+    private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(RunExe.class);
 
 
-	/**
+    /**
+     * Runs the specified batch file.
+     */
 
-	 Runs the specified batch file.
 
-	 */
+    public void process(String path, String[] params) throws Exception {
 
+        boolean debug = log.isDebugEnabled();
 
-	public void process(String path, String[] params) throws Exception {
+        if (debug) {
+            log.debug(exePath + " entered");
+        }
 
-		boolean debug = log.isDebugEnabled();
+        // read first parameter which is filename
 
-		if (debug) {
-			log.debug(exePath + " entered");
-		}
+        if (helpRequested()) {
 
-		// read first parameter which is filename
+            PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
 
-		if (helpRequested()) {
+            out.println("Usage:	run [--help] <vfs:path-to-batch-file>");
 
-			PrintWriter2 out = new PrintWriter2(new BufferWriter(getStdOut()));
-
-			out.println("Usage:	run [--help] <vfs:path-to-batch-file>");
-
-			out.println("			run [--help] < inputstream");
+            out.println("			run [--help] < inputstream");
             out.println("	    --ex       : (as first param) If exception occurs throw it without dump to stdout");
             out.println("	    --out      : Output everything to stdout");
             out.println("	    --exout    : If exception occurs - dump it to stdout and rethrow");
-			out.println("	    --failfast : If exception occurs stop further process (the default is to continue with next command)");
+            out.println("	    --failfast : If exception occurs stop further process (the default is to continue with next command)");
             out.println("		--help     : this help");
 
-			out.close();
+            out.close();
 
-			log.debug(exePath + " done");
+            log.debug(exePath + " done");
 
-			return;
+            return;
 
-		}
+        }
 
-		boolean wasactive = false;
+        boolean wasactive = false;
 
-		if (TxSupport.isActive()) {
-			wasactive = true;
-			TxSupport.commit();
-		}
+        /*if (TxSupport.isActive()) {
+              wasactive = true;
+              TxSupport.commit();
+          }*/
 
-		BufferedReader in = null;
+        BufferedReader in = null;
 
         boolean outThrough = false;
         boolean exDump = !throwsException();
         boolean failfast = false;
 
-		if (params.length > 0) {
-            for(int i=0; i<params.length; i++) {
+        if (params.length > 0) {
+            for (int i = 0; i < params.length; i++) {
                 String tmp = params[i];
 
-                if(tmp.startsWith("--")) {
-                    if("--out".equals(tmp)) {
+                if (tmp.startsWith("--")) {
+                    if ("--out".equals(tmp)) {
                         outThrough = true;
-                    } else if("--exout".equals(tmp)) {
+                    } else if ("--exout".equals(tmp)) {
                         exDump = true;
-                    } else if("--failfast".equals(tmp)) {
+                    } else if ("--failfast".equals(tmp)) {
                         failfast = true;
                     } else {
                         error("Unknown parameter: " + tmp);
@@ -105,22 +102,22 @@
                     break;
                 }
             }
-		}
+        }
 
-        if(in == null) {
+        if (in == null) {
             in = new BufferedReader(new BufferReader(getStdIn()));
         }
 
         BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
         PrintWriter pwout = new PrintWriter(new BufferWriter(getStdOut()));
 
-		String line = in.readLine();
-		while (line != null) {
-			String ln = line.trim();
-			if (ln.length() != 0 && ln.charAt(0) != '#') {
-				if (debug) {
-					log.debug(exePath + " - Executing " + line);
-				}
+        String line = in.readLine();
+        while (line != null) {
+            String ln = line.trim();
+            if (ln.length() != 0 && ln.charAt(0) != '#') {
+                if (debug) {
+                    log.debug(exePath + " - Executing " + line);
+                }
 
                 ShellImpl sh = (ShellImpl) getShell();
                 try {
@@ -129,7 +126,7 @@
                     InBuffer buf = null;
                     try {
                         buf = sh.getBuffer(pinfo.procid, 1);
-                    } catch(org.jboss.fresh.shell.NoSuchProcessException ex) {
+                    } catch (org.jboss.fresh.shell.NoSuchProcessException ex) {
                         continue;
                     }
 
@@ -140,17 +137,17 @@
                     while (!ein.isFinished()) { // �e ho�emo, da sa izvede do konca moramo prebrati vse  -  dokler se ne zapre.
                         try {
                             retObj = ein.readObject();  // read it
-                            if(outThrough)
+                            if (outThrough)
                                 oout.writeObject(retObj);
                         } catch (IOException ex) {
                             //log.error(ex.getMessage(), ex);
-                            if(exDump) {
+                            if (exDump) {
                                 ex.printStackTrace(pwout);
                                 pwout.flush();
                             }
 
-                            if(failfast) {
-                                if(canThrowEx()) {
+                            if (failfast) {
+                                if (canThrowEx()) {
                                     throw ex;
                                 }
                                 break;
@@ -160,7 +157,7 @@
 
                 } catch (ShellException ex) {
                     //log.error(ex.getMessage(), ex);
-                    if(canThrowEx()) {
+                    if (canThrowEx()) {
                         throw ex;
                     } else {
                         ex.printStackTrace(pwout);
@@ -170,25 +167,25 @@
                     //log.error(t.getMessage(), t);
                     ShellException ex = new ShellException(t);
 
-                    if(canThrowEx()) {
+                    if (canThrowEx()) {
                         throw ex;
                     } else {
                         ex.printStackTrace(pwout);
                         return;
-                    }                    
+                    }
                 }
-			}
+            }
 
             line = in.readLine();
-		}
+        }
 
-		// read line by line - execute each line
-		if (wasactive)
-			TxSupport.begin();
-
-		if (debug) {
-			log.debug(exePath + " done");
-		}
-	}
+        // read line by line - execute each line
+        /*if (wasactive)
+            TxSupport.begin();
+        */
+        if (debug) {
+            log.debug(exePath + " done");
+        }
+    }
 }
 

Deleted: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/TxExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/TxExe.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/TxExe.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -1,66 +0,0 @@
-package org.jboss.fresh.shell.commands;
-
-import java.io.PrintWriter;
-
-import javax.transaction.UserTransaction;
-
-import org.jboss.fresh.io.BufferObjectWriter;
-import org.jboss.fresh.io.BufferWriter;
-import org.jboss.fresh.shell.AbstractExecutable;
-import org.jboss.fresh.util.TxSupport;
-
-import org.apache.log4j.Logger;
-
-public class TxExe extends AbstractExecutable {
-	private static final Logger log = Logger.getLogger(TxExe.class);
-
-	@Override
-	protected void process(String exepath, String[] args) throws Exception {
-
-		if(args.length == 0 || isHelpRequested(args)) {
-			printHelp();
-			return;
-		}
-
-		if(!"SINGLE".equals(shell.getEnvProperty("TMODE"))) {
-			error("TMODE shell env property must be set to SINGLE before starting any transaction operation! (you can use tsingle shell command)");
-		}
-
-
-		UserTransaction tx = TxSupport.getUT();
-
-		if("begin".equals(args[0])) {
-
-			tx.begin();
-			shell.setEnvProperty("TX_ACTIVE", "1");
-
-		} else if("commit".equals(args[0])) {
-
-			tx.commit();
-			shell.setEnvProperty("TX_ACTIVE", null);
-
-		} else if("rollback".equals(args[0])) {
-
-			tx.rollback();
-			shell.setEnvProperty("TX_ACTIVE", null);
-
-		} else if("status".equals(args[0])) {
-				String status = TxSupport.getStatusAsString();
-				BufferObjectWriter bw = new BufferObjectWriter(getStdOut());
-				bw.writeObject(status);
-				bw.flush();
-		} else {
-			error("Unknown command: " + args[0]);
-		}
-	}
-
-	private void printHelp() {
-        PrintWriter out = new PrintWriter(new BufferWriter(getStdOut()));
-        out.println("Usage: tx [-ex] <command>");
-        out.println("		Begin, commit, rollback transaction or check current tx status");
-        out.println();
-        out.println("		--help : this help\n");
-        out.println("    <command> : One of - begin, commit, rollback, status");
-        out.close();
-    }
-}

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/util/WebGetExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/util/WebGetExe.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/util/WebGetExe.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -5,6 +5,7 @@
 import org.jboss.fresh.io.BufferOutputStream;
 import org.jboss.fresh.io.PrintWriter2;
 import org.jboss.fresh.shell.AbstractExecutable;
+import org.jboss.util.Base64;
 
 import java.io.PrintWriter;
 import java.io.InputStream;
@@ -131,7 +132,7 @@
 
 			if (user != null) {
 				if (pass == null) pass = "";
-				String authentication = "Basic " + new sun.misc.BASE64Encoder().encode((user + ":" + pass).getBytes());
+				String authentication = "Basic " + Base64.encodeObject((user + ":" + pass).getBytes());
 				pw.println("Authorization: " + authentication);
 			}
 

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/Process.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/Process.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/Process.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -11,7 +11,6 @@
 import org.jboss.fresh.shell.Shell;
 import org.jboss.fresh.shell.SystemShell;
 
-import org.jboss.fresh.util.TxSupport;
 import org.apache.log4j.Logger;
 
 import java.util.HashMap;
@@ -352,8 +351,8 @@
                 executable.setStdOut(new CloseProtectedOutBufferImpl(bufOut));
                 executable.execute(exepath, params);
 
-    			if(!"1".equals(shell.getEnvProperty("TX_ACTIVE")) && TxSupport.isActive())
-    				TxSupport.commit();
+    			/*if(!"1".equals(shell.getEnvProperty("TX_ACTIVE")) && TxSupport.isActive())
+    				TxSupport.commit();*/
 			
 			} finally {
 //System.out.println("          Execute   DONE : " + executable);
@@ -373,11 +372,11 @@
             log.error(getClientAndProjectInfo() + "Exception while executing: " + cmdline + formatParams(origParams), t.getUnderlyingThrowable());
 			setThrowable(t);
 			th = t;
-			try {
+			/*try {
 				if(!"1".equals(shell.getEnvProperty("TX_ACTIVE")) && TxSupport.isActive())
 					TxSupport.rollback();
 			} catch (Exception e) {
-			}
+			} */
 
 		} catch (Throwable t) {
 			//log.debug("[Process] " + procid + " : Exception occured: ");
@@ -392,11 +391,11 @@
 			}
 			setThrowable(t);
 			th = t;
-			try {
+			/*try {
 				if(!"1".equals(shell.getEnvProperty("TX_ACTIVE")) && TxSupport.isActive())
 					TxSupport.rollback();
 			} catch (Exception e) {
-			}
+			}*/
 
 		} finally {
 

Deleted: projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java
===================================================================
--- projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-util/src/main/java/org/jboss/fresh/util/TxSupport.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -1,173 +0,0 @@
-package org.jboss.fresh.util;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.NameNotFoundException;
-
-import javax.transaction.Status;
-import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
-import org.jboss.fresh.parsek.cpii.Cp2Configuration;
-import org.apache.log4j.Logger;
-
-public class TxSupport {
-
-	
-	//private static UserTransaction ut;
-	//private static long lastUpdated = 0;
-	private static final Logger log = Logger.getLogger(TxSupport.class);
-	
-	private static ThreadLocal tloc = new ThreadLocal();
-
-	public static void assignUTForThread(UserTransaction ut) {
-		tloc.set(ut);
-	}
-	
-	public static void clearUTForThread() {
-		tloc.remove();
-	}
-	
-	private static String getUTjndiName() throws Exception {
-		return Cp2Configuration.getUserTransactionJndiName();
-	}
-
-    protected static javax.transaction.UserTransaction getUserTransaction() throws NamingException
-   {
-      InitialContext context = new InitialContext();
-      try
-      {
-         return (javax.transaction.UserTransaction) context.lookup("java:comp/UserTransaction");
-      }
-      catch (NameNotFoundException nnfe)
-      {
-         try
-         {
-            //Embedded JBoss has no java:comp/UserTransaction
-            javax.transaction.UserTransaction ut = (javax.transaction.UserTransaction) context.lookup("UserTransaction");
-            ut.getStatus(); //for glassfish, which can return an unusable UT
-            return ut;
-         }
-         catch (Exception e)
-         {
-            throw nnfe;
-         }
-      }
-   }
-
-	public static UserTransaction getUT()  throws Exception {
-	        // cache for 10 secs then do another lookup.
-	        //long ct = System.currentTimeMillis();
-	        //if(ct-lastUpdated >10000) {
-	        //	InitialContext ctx = new InitialContext();
-	        	//RegistryContext ctx = new RegistryContext();
-	        //	ut = (UserTransaction) ctx.lookup(getUTjndiName());
-	        //	lastUpdated = ct;
-	        //}
-	        
-	        //return ut;
-		UserTransaction ut = (UserTransaction) tloc.get();
-		if(ut != null)
-			return ut;
-
-        return getUserTransaction();
-		/*InitialContext ctx = new InitialContext();
-		return (UserTransaction) ctx.lookup(getUTjndiName());*/
-	}
-
-	
-    public static boolean isActive() throws Exception {
-
-//System.out.println("/**  getStatus called!  ********************/");
-//printThreadInfo();
-
-		try {
-			return getUT().getStatus() != Status.STATUS_NO_TRANSACTION;
-		} catch (Exception e) {
-			log.error("Exception occoured", e);
-			return false;
-		}
-//		return getTXif().getStatus() != Status.STATUS_NO_TRANSACTION;
-    }
-
-    public static String getStatusAsString() throws Exception {
-    	int status = getUT().getStatus();
-		String ret = null;
-		switch(status) {
-			case Status.STATUS_ACTIVE:
-				ret = "STATUS_ACTIVE";
-				break;
-			case Status.STATUS_COMMITTED:
-				ret = "STATUS_COMMITTED";
-				break;
-			case Status.STATUS_COMMITTING:
-				ret = "STATUS_COMMITTING";
-				break;
-			case Status.STATUS_MARKED_ROLLBACK:
-				ret = "STATUS_MARKED_ROLLBACK";
-				break;
-			case Status.STATUS_NO_TRANSACTION:
-				ret = "STATUS_NO_TRANSACTION";
-				break;
-			case Status.STATUS_PREPARED:
-				ret = "STATUS_PREPARED";
-				break;
-			case Status.STATUS_PREPARING:
-				ret = "STATUS_PREPARING";
-				break;
-			case Status.STATUS_ROLLEDBACK:
-				ret = "STATUS_ROLLEDBACK";
-				break;
-			case Status.STATUS_ROLLING_BACK:
-				ret = "STATUS_ROLLING_BACK";
-				break;
-			case Status.STATUS_UNKNOWN:
-				ret = "STATUS_UNKNOWN";
-				break;
-			default:
-				ret = "UNDEFINED";
-		}
-		
-		return ret;
-    }
-    
-    public static void begin() throws Exception {
-//System.out.println("/**  begin called!     ********************/");
-//printThreadInfo();
-        getUT().begin();
-//		getTXif().begin();
-    }
-
-
-    public static void commit() throws Exception {
-//System.out.println("/**  commit called!  ********************/");
-//printThreadInfo();
-        getUT().commit();
-//		getTXif().commit();
-    }
-
-
-    public static void rollback() throws Exception {
-//System.out.println("/**  rollback called!  ********************/");
-//printThreadInfo();
-        getUT().rollback();
-//		getTXif().rollback();
-    }
-
-    public static void setRollbackOnly() throws Exception {
-	getUT().setRollbackOnly();
-    }
-
-    private static void printThreadInfo() {
-        Thread current = Thread.currentThread();
-        System.out.println("/******************************************/");
-        System.out.println("/**  name = " + current.getName());
-        current.dumpStack();
-        System.out.println("/******************************************/");
-    }
-
-    private static TransactionManager getTXif() throws Exception {
-        InitialContext ctx = new InitialContext();
-        TransactionManager tm = (TransactionManager) ctx.lookup("java:/TransactionManager");
-        return tm;
-    }
-}
\ No newline at end of file

Modified: projects/fresh/trunk/fresh-vfs/pom.xml
===================================================================
--- projects/fresh/trunk/fresh-vfs/pom.xml	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-vfs/pom.xml	2009-04-30 23:58:36 UTC (rev 88082)
@@ -30,11 +30,6 @@
   			<artifactId>fresh-util</artifactId>
       </dependency>
       
-      <dependency>
-			  <groupId>org.hibernate</groupId>
-			  <artifactId>hibernate-core</artifactId>
-			  <scope>provided</scope>
-			</dependency>
   </dependencies>
   
 </project>
\ No newline at end of file

Modified: projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/LazyVFSOutputStream.java
===================================================================
--- projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/LazyVFSOutputStream.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/LazyVFSOutputStream.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -50,23 +50,15 @@
 
 
     protected void fileCreate() throws Exception {
-        if (!org.jboss.fresh.util.TxSupport.isActive()) org.jboss.fresh.util.TxSupport.begin();
+        //if (!org.jboss.fresh.util.TxSupport.isActive()) org.jboss.fresh.util.TxSupport.begin();
         FileInfo info = new FileInfo(filename, FileInfo.TYPE_FILE);
         info.setMime("x-application/octet-stream");
-//System.out.println("[VFSOutputStream] <init> info: " + info);
-//System.out.println("[VFSOutputStream] creating file... " + info.getFileName());
-//System.out.println("[VFSOutputStream] creating file with path " + info.getFileName().getPath());
         tag = vfs.createFile(info);
-//System.out.println("[VFSOutputStream] file created: " + tag);
         needCreate = false;
     }
 
 
     public void close() throws IOException {
-//System.out.println("##");
-//System.out.println("## Close called " + this);
-//System.out.println("##");
-//System.out.println("##");
         if (closed) return;  // if it has already been flushed we must not do it again.
 
         closed = true;

Modified: projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/disk/DiskVFSMeta.java
===================================================================
--- projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/disk/DiskVFSMeta.java	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/fresh-vfs/src/main/java/org/jboss/fresh/vfs/impl/disk/DiskVFSMeta.java	2009-04-30 23:58:36 UTC (rev 88082)
@@ -30,7 +30,7 @@
 
 	public DiskVFSMeta(String rootpath) throws Exception {
 		fsroot = new File(rootpath);
-		String rp = fsroot.toURL().getPath();
+		String rp = fsroot.getPath();// toURL().getPath();
 		rootlen = rp.endsWith("/") ? rp.length()-1 : rp.length();
 
 		// just check that path exists
@@ -53,7 +53,8 @@
 
 	private FileInfo fileToFileInfo(File file) throws VFSException {
 		try {
-			FileInfo inf = new FileInfo(file.toURL().getPath().substring(rootlen));
+			FileInfo inf = new FileInfo(file.getPath().substring(rootlen));
+			//FileInfo inf = new FileInfo(file.toURL().getPath().substring(rootlen));
 			inf.setCreateDate(new Date(file.lastModified()));
 			inf.setFileType(file.isFile() ? FileInfo.TYPE_FILE : FileInfo.TYPE_DIR);
 			inf.setLastModified(new Date(file.lastModified()));
@@ -106,7 +107,8 @@
 
 		FileName adjusted = root.absolutize(path);
 		File thefile = new File(fsroot, adjusted.toString());
-		ls.add(new FileName(thefile.toURL().getPath().substring(rootlen)));
+		//ls.add(new FileName(thefile.toURL().getPath().substring(rootlen)));
+		ls.add(new FileName(thefile.getPath().substring(rootlen)));
 		return ls;
 	}
 

Modified: projects/fresh/trunk/pom.xml
===================================================================
--- projects/fresh/trunk/pom.xml	2009-04-30 22:54:39 UTC (rev 88081)
+++ projects/fresh/trunk/pom.xml	2009-04-30 23:58:36 UTC (rev 88082)
@@ -247,12 +247,6 @@
         <version>${version.sshtools}</version>
       </dependency>
       
-      <dependency>
-        <groupId>org.hibernate</groupId>
-        <artifactId>hibernate-core</artifactId>
-        <version>3.3.1.GA</version>
-        <scope>provided</scope>
-      </dependency>
       
       <!-- JBoss dependencies -->
       




More information about the jboss-cvs-commits mailing list