[jboss-cvs] JBossAS SVN: r81066 - in trunk/profileservice: src/main/org/jboss/managed/plugins/advice and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 14 10:10:09 EST 2008


Author: dimitris at jboss.org
Date: 2008-11-14 10:10:09 -0500 (Fri, 14 Nov 2008)
New Revision: 81066

Modified:
   trunk/profileservice/build.bat
   trunk/profileservice/build.sh
   trunk/profileservice/pom.xml
   trunk/profileservice/src/main/org/jboss/managed/plugins/advice/TraceAdvice.java
   trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperAdvice.java
   trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperIterator.java
   trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperSet.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/AbstractRuntimeComponentDispatcher.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/KernelBusRuntimeComponentDispatcher.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/messages.properties
   trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplateInfo.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/messages.properties
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
   trunk/profileservice/src/resources/profileservice-hdscanner-jboss-beans.xml
   trunk/profileservice/src/test/main/org/jboss/test/ps/SerializableDeploymentRepositoryUnitTest.java
   trunk/profileservice/src/test/resources/log4j.properties
Log:
fix svn properties

Modified: trunk/profileservice/build.bat
===================================================================
--- trunk/profileservice/build.bat	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/build.bat	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,89 +1,89 @@
- at echo off
-REM  ======================================================================
-REM
-REM  This is the main entry point for the build system.
-REM
-REM  Users should be sure to execute this file rather than 'ant' to ensure
-REM  the correct version is being used with the correct configuration.
-REM
-REM  ======================================================================
-REM
-REM $Id: build.bat 24242 2004-10-04 20:13:37Z andd $
-REM
-REM Authors:
-REM     Jason Dillon <jason at planet57.com>
-REM     Sacha Labourey <sacha.labourey at cogito-info.ch>
-REM
-
-REM ******************************************************
-REM Ignore the ANT_HOME variable: we want to use *our*
-REM ANT version and associated JARs.
-REM ******************************************************
-REM Ignore the users classpath, cause it might mess
-REM things up
-REM ******************************************************
-
-SETLOCAL
-
-set CLASSPATH=
-set ANT_HOME=
-set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
-
-REM ******************************************************
-REM - "for" loops have been unrolled for compatibility
-REM   with some WIN32 systems.
-REM ******************************************************
-
-set NAMES=tools;tools\ant;tools\apache\ant
-set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
-
-REM ******************************************************
-REM ******************************************************
-
-SET EXECUTED=FALSE
-for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
-
-goto :EOF
-
-
-REM ******************************************************
-REM ********* Search for names in the subfolders *********
-REM ******************************************************
-
-:subLoop
-for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
-
-goto :EOF
-
-
-REM ******************************************************
-REM ************ Test if ANT Batch file exists ***********
-REM ******************************************************
-
-:testIfExists
-if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
-
-goto :EOF
-
-
-REM ******************************************************
-REM ************** Batch file has been found *************
-REM ******************************************************
-
-:BatchFound
-if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
-set EXECUTED=TRUE
-
-goto :EOF
-
-REM ******************************************************
-REM ************* Execute Batch file only once ***********
-REM ******************************************************
-
-:ExecuteBatch
-echo Calling %1 %2 %3 %4 %5 %6 %7 %8
-call %1 %2 %3 %4 %5 %6 %7 %8
-
-:end
-
-if "%NOPAUSE%" == "" pause
+ at echo off
+REM  ======================================================================
+REM
+REM  This is the main entry point for the build system.
+REM
+REM  Users should be sure to execute this file rather than 'ant' to ensure
+REM  the correct version is being used with the correct configuration.
+REM
+REM  ======================================================================
+REM
+REM $Id: build.bat 24242 2004-10-04 20:13:37Z andd $
+REM
+REM Authors:
+REM     Jason Dillon <jason at planet57.com>
+REM     Sacha Labourey <sacha.labourey at cogito-info.ch>
+REM
+
+REM ******************************************************
+REM Ignore the ANT_HOME variable: we want to use *our*
+REM ANT version and associated JARs.
+REM ******************************************************
+REM Ignore the users classpath, cause it might mess
+REM things up
+REM ******************************************************
+
+SETLOCAL
+
+set CLASSPATH=
+set ANT_HOME=
+set ANT_OPTS=-Djava.protocol.handler.pkgs=org.jboss.net.protocol -Dbuild.script=build.bat
+
+REM ******************************************************
+REM - "for" loops have been unrolled for compatibility
+REM   with some WIN32 systems.
+REM ******************************************************
+
+set NAMES=tools;tools\ant;tools\apache\ant
+set SUBFOLDERS=..;..\..;..\..\..;..\..\..\..
+
+REM ******************************************************
+REM ******************************************************
+
+SET EXECUTED=FALSE
+for %%i in (%NAMES%) do call :subLoop %%i %1 %2 %3 %4 %5 %6
+
+goto :EOF
+
+
+REM ******************************************************
+REM ********* Search for names in the subfolders *********
+REM ******************************************************
+
+:subLoop
+for %%j in (%SUBFOLDERS%) do call :testIfExists %%j\%1\bin\ant.bat %2 %3 %4 %5 %6 %7
+
+goto :EOF
+
+
+REM ******************************************************
+REM ************ Test if ANT Batch file exists ***********
+REM ******************************************************
+
+:testIfExists
+if exist %1 call :BatchFound %1 %2 %3 %4 %5 %6 %7 %8
+
+goto :EOF
+
+
+REM ******************************************************
+REM ************** Batch file has been found *************
+REM ******************************************************
+
+:BatchFound
+if (%EXECUTED%)==(FALSE) call :ExecuteBatch %1 %2 %3 %4 %5 %6 %7 %8
+set EXECUTED=TRUE
+
+goto :EOF
+
+REM ******************************************************
+REM ************* Execute Batch file only once ***********
+REM ******************************************************
+
+:ExecuteBatch
+echo Calling %1 %2 %3 %4 %5 %6 %7 %8
+call %1 %2 %3 %4 %5 %6 %7 %8
+
+:end
+
+if "%NOPAUSE%" == "" pause


Property changes on: trunk/profileservice/build.bat
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/build.sh
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/pom.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/TraceAdvice.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/managed/plugins/advice/TraceAdvice.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/managed/plugins/advice/TraceAdvice.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,99 +1,99 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.managed.plugins.advice;
-
-import java.util.Arrays;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.logging.Logger;
-
-/**
- * TraceAdvice.
- * 
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class TraceAdvice
-{
-   /** The log */
-   private static final Logger log = Logger.getLogger(TraceAdvice.class);
-   
-   /**
-    * Interceptor
-    * 
-    * @param invocation the invocation
-    * @return the result
-    * @throws Throwable for any problem
-    */
-   public Object invoke(Invocation invocation) throws Throwable
-   {
-      boolean trace = log.isTraceEnabled();
-      if (trace)
-         logMethod(false, invocation, null, null);
-      
-      Throwable e = null;
-      Object result = null;
-      try
-      {
-         result = invocation.invokeNext();
-         return result;
-      }
-      catch (Throwable t)
-      {
-         e = t;
-         throw t;
-      }
-      finally
-      {
-         logMethod(true, invocation, result, e);
-      }
-   }
-   
-   private void logMethod(boolean beforeAfter, Invocation invocation, Object result, Throwable t)
-   {
-      MethodInvocation mi = (MethodInvocation) invocation;
-      StringBuilder builder = new StringBuilder();
-      Object target = mi.getTargetObject();
-      builder.append(target.getClass().getSimpleName());
-      builder.append('@');
-      builder.append(System.identityHashCode(target));
-      if (beforeAfter == false)
-         builder.append(" before ");
-      else
-         builder.append(" after  ");
-      builder.append(mi.getActualMethod().getName());
-      if (beforeAfter == false)
-      {
-         builder.append(" params=");
-         builder.append(Arrays.asList(mi.getArguments()));
-      }
-      else if (t == null)
-      {
-         builder.append(" result=");
-         builder.append(result);
-      }
-      if (t != null)
-         builder.append(" ended in error:");
-      log.trace(builder.toString(), t);
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins.advice;
+
+import java.util.Arrays;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.logging.Logger;
+
+/**
+ * TraceAdvice.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class TraceAdvice
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(TraceAdvice.class);
+   
+   /**
+    * Interceptor
+    * 
+    * @param invocation the invocation
+    * @return the result
+    * @throws Throwable for any problem
+    */
+   public Object invoke(Invocation invocation) throws Throwable
+   {
+      boolean trace = log.isTraceEnabled();
+      if (trace)
+         logMethod(false, invocation, null, null);
+      
+      Throwable e = null;
+      Object result = null;
+      try
+      {
+         result = invocation.invokeNext();
+         return result;
+      }
+      catch (Throwable t)
+      {
+         e = t;
+         throw t;
+      }
+      finally
+      {
+         logMethod(true, invocation, result, e);
+      }
+   }
+   
+   private void logMethod(boolean beforeAfter, Invocation invocation, Object result, Throwable t)
+   {
+      MethodInvocation mi = (MethodInvocation) invocation;
+      StringBuilder builder = new StringBuilder();
+      Object target = mi.getTargetObject();
+      builder.append(target.getClass().getSimpleName());
+      builder.append('@');
+      builder.append(System.identityHashCode(target));
+      if (beforeAfter == false)
+         builder.append(" before ");
+      else
+         builder.append(" after  ");
+      builder.append(mi.getActualMethod().getName());
+      if (beforeAfter == false)
+      {
+         builder.append(" params=");
+         builder.append(Arrays.asList(mi.getArguments()));
+      }
+      else if (t == null)
+      {
+         builder.append(" result=");
+         builder.append(result);
+      }
+      if (t != null)
+         builder.append(" ended in error:");
+      log.trace(builder.toString(), t);
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/TraceAdvice.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperAdvice.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperAdvice.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperAdvice.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,139 +1,139 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.managed.plugins.advice;
-
-import java.util.Set;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
-import org.jboss.managed.api.Fields;
-import org.jboss.managed.api.ManagedObject;
-import org.jboss.managed.api.ManagedProperty;
-
-/**
- * WrapperAdvice, intercepts methods that produce objects
- * that require proxies.
- * 
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 63962 $
- */
-public class WrapperAdvice
-{
-   /**
-    * Wrap a managed object
-    * 
-    * @param managedObject the managed object
-    * @return the managed object wrapper
-    */
-   public static ManagedObject wrapManagedObject(ManagedObject managedObject)
-   {
-      return createProxy(managedObject, ManagedObject.class);
-   }
-   
-   /**
-    * Wrap a managed property
-    * 
-    * @param managedProperty the managed property
-    * @return the managed property wrapper
-    */
-   public static ManagedProperty wrapManagedProperty(ManagedProperty managedProperty)
-   {
-      return createProxy(managedProperty, ManagedProperty.class);
-   }
-   
-   /**
-    * Wrap fields
-    * 
-    * @param fields the fields
-    * @return the fields wrapper
-    */
-   public static Fields wrapFields(Fields fields)
-   {
-      return createProxy(fields, Fields.class);
-   }
-
-   /**
-    * Wrap a returned managed object
-    * 
-    * @param invocation the invocation
-    * @return the wrapped managed object
-    * @throws Throwable for any error
-    */
-   public ManagedObject wrapManagedObject(Invocation invocation) throws Throwable
-   {
-      ManagedObject result = (ManagedObject) invocation.invokeNext();
-      return wrapManagedObject(result);
-   }
-
-   /**
-    * Wrap a returned managed property
-    * 
-    * @param invocation the invocation
-    * @return the wrapped managed property
-    * @throws Throwable for any error
-    */
-   public ManagedProperty wrapManagedProperty(Invocation invocation) throws Throwable
-   {
-      ManagedProperty result = (ManagedProperty) invocation.invokeNext();
-      return wrapManagedProperty(result);
-   }
-
-   /**
-    * Wrap a returned managed property set
-    * 
-    * @param invocation the invocation
-    * @return the wrapped managed property set
-    * @throws Throwable for any error
-    */
-   @SuppressWarnings("unchecked")
-   public Set<ManagedProperty> wrapManagedPropertySet(Invocation invocation) throws Throwable
-   {
-      Set<ManagedProperty> result = (Set<ManagedProperty>) invocation.invokeNext();
-      return new WrapperSet<ManagedProperty>(result, ManagedProperty.class);
-   }
-
-   /**
-    * Wrap fields
-    * 
-    * @param invocation the invocation
-    * @return the wrapped managed property
-    * @throws Throwable for any error
-    */
-   public Fields wrapFields(Invocation invocation) throws Throwable
-   {
-      Fields result = (Fields) invocation.invokeNext();
-      return wrapFields(result);
-   }
-   
-   /**
-    * Create a proxy 
-    * 
-    * @param <T> the expected type
-    * @param target the target
-    * @param interfaceClass the interface class
-    * @return the proxy
-    */
-   static <T> T createProxy(T target, Class<T> interfaceClass)
-   {
-      return GeneratedAOPProxyFactory.createProxy(target, interfaceClass);
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins.advice;
+
+import java.util.Set;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory;
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.api.ManagedObject;
+import org.jboss.managed.api.ManagedProperty;
+
+/**
+ * WrapperAdvice, intercepts methods that produce objects
+ * that require proxies.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 63962 $
+ */
+public class WrapperAdvice
+{
+   /**
+    * Wrap a managed object
+    * 
+    * @param managedObject the managed object
+    * @return the managed object wrapper
+    */
+   public static ManagedObject wrapManagedObject(ManagedObject managedObject)
+   {
+      return createProxy(managedObject, ManagedObject.class);
+   }
+   
+   /**
+    * Wrap a managed property
+    * 
+    * @param managedProperty the managed property
+    * @return the managed property wrapper
+    */
+   public static ManagedProperty wrapManagedProperty(ManagedProperty managedProperty)
+   {
+      return createProxy(managedProperty, ManagedProperty.class);
+   }
+   
+   /**
+    * Wrap fields
+    * 
+    * @param fields the fields
+    * @return the fields wrapper
+    */
+   public static Fields wrapFields(Fields fields)
+   {
+      return createProxy(fields, Fields.class);
+   }
+
+   /**
+    * Wrap a returned managed object
+    * 
+    * @param invocation the invocation
+    * @return the wrapped managed object
+    * @throws Throwable for any error
+    */
+   public ManagedObject wrapManagedObject(Invocation invocation) throws Throwable
+   {
+      ManagedObject result = (ManagedObject) invocation.invokeNext();
+      return wrapManagedObject(result);
+   }
+
+   /**
+    * Wrap a returned managed property
+    * 
+    * @param invocation the invocation
+    * @return the wrapped managed property
+    * @throws Throwable for any error
+    */
+   public ManagedProperty wrapManagedProperty(Invocation invocation) throws Throwable
+   {
+      ManagedProperty result = (ManagedProperty) invocation.invokeNext();
+      return wrapManagedProperty(result);
+   }
+
+   /**
+    * Wrap a returned managed property set
+    * 
+    * @param invocation the invocation
+    * @return the wrapped managed property set
+    * @throws Throwable for any error
+    */
+   @SuppressWarnings("unchecked")
+   public Set<ManagedProperty> wrapManagedPropertySet(Invocation invocation) throws Throwable
+   {
+      Set<ManagedProperty> result = (Set<ManagedProperty>) invocation.invokeNext();
+      return new WrapperSet<ManagedProperty>(result, ManagedProperty.class);
+   }
+
+   /**
+    * Wrap fields
+    * 
+    * @param invocation the invocation
+    * @return the wrapped managed property
+    * @throws Throwable for any error
+    */
+   public Fields wrapFields(Invocation invocation) throws Throwable
+   {
+      Fields result = (Fields) invocation.invokeNext();
+      return wrapFields(result);
+   }
+   
+   /**
+    * Create a proxy 
+    * 
+    * @param <T> the expected type
+    * @param target the target
+    * @param interfaceClass the interface class
+    * @return the proxy
+    */
+   static <T> T createProxy(T target, Class<T> interfaceClass)
+   {
+      return GeneratedAOPProxyFactory.createProxy(target, interfaceClass);
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperAdvice.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperIterator.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperIterator.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperIterator.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,73 +1,73 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.managed.plugins.advice;
-
-import java.util.Iterator;
-
-/**
- * WrapperIterator.
- * 
- * @param <T> the interface
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-public class WrapperIterator<T> implements Iterator<T>
-{
-   /** The delegate */
-   private Iterator<T> delegate;
-
-   /** The interface class */
-   private Class<T> interfaceClass;
-   
-   /**
-    * Create a new WrapperIterator.
-    * 
-    * @param delegate the delegate
-    * @param interfaceClass the interface class
-    */
-   public WrapperIterator(Iterator<T> delegate, Class<T> interfaceClass)
-   {
-      if (delegate == null)
-         throw new IllegalArgumentException("Null delegate");
-      if (interfaceClass == null)
-         throw new IllegalArgumentException("Null interface class");
-      
-      this.delegate = delegate;
-      this.interfaceClass = interfaceClass;
-   }
-
-   public boolean hasNext()
-   {
-      return delegate.hasNext();
-   }
-
-   public T next()
-   {
-      T next = delegate.next();
-      return WrapperAdvice.createProxy(next, interfaceClass);
-   }
-
-   public void remove()
-   {
-      throw new UnsupportedOperationException();
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins.advice;
+
+import java.util.Iterator;
+
+/**
+ * WrapperIterator.
+ * 
+ * @param <T> the interface
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class WrapperIterator<T> implements Iterator<T>
+{
+   /** The delegate */
+   private Iterator<T> delegate;
+
+   /** The interface class */
+   private Class<T> interfaceClass;
+   
+   /**
+    * Create a new WrapperIterator.
+    * 
+    * @param delegate the delegate
+    * @param interfaceClass the interface class
+    */
+   public WrapperIterator(Iterator<T> delegate, Class<T> interfaceClass)
+   {
+      if (delegate == null)
+         throw new IllegalArgumentException("Null delegate");
+      if (interfaceClass == null)
+         throw new IllegalArgumentException("Null interface class");
+      
+      this.delegate = delegate;
+      this.interfaceClass = interfaceClass;
+   }
+
+   public boolean hasNext()
+   {
+      return delegate.hasNext();
+   }
+
+   public T next()
+   {
+      T next = delegate.next();
+      return WrapperAdvice.createProxy(next, interfaceClass);
+   }
+
+   public void remove()
+   {
+      throw new UnsupportedOperationException();
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperIterator.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperSet.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperSet.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperSet.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,73 +1,73 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.managed.plugins.advice;
-
-import java.io.Serializable;
-import java.util.AbstractSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * WrapperSet.
- * 
- * @param <T> the interface type
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
- */
-class WrapperSet<T> extends AbstractSet<T> implements Serializable
-{
-   /** The serialVersionUID */
-   private static final long serialVersionUID = -5588975054846538928L;
-
-   /** The delegate */
-   private Set<T> delegate;
-
-   /** The interface class */
-   private Class<T> interfaceClass;
-   
-   /**
-    * Create a new WrapperSet.
-    * 
-    * @param delegate the delegate
-    * @param interfaceClass the interface class
-    */
-   public WrapperSet(Set<T> delegate, Class<T> interfaceClass)
-   {
-      if (delegate == null)
-         throw new IllegalArgumentException("Null delegate");
-      if (interfaceClass == null)
-         throw new IllegalArgumentException("Null interface class");
-
-      this.delegate = delegate;
-      this.interfaceClass = interfaceClass;
-   }
-
-   public Iterator<T> iterator()
-   {
-      return new WrapperIterator<T>(delegate.iterator(), interfaceClass);
-   }
-
-   public int size()
-   {
-      return delegate.size();
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.managed.plugins.advice;
+
+import java.io.Serializable;
+import java.util.AbstractSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * WrapperSet.
+ * 
+ * @param <T> the interface type
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+class WrapperSet<T> extends AbstractSet<T> implements Serializable
+{
+   /** The serialVersionUID */
+   private static final long serialVersionUID = -5588975054846538928L;
+
+   /** The delegate */
+   private Set<T> delegate;
+
+   /** The interface class */
+   private Class<T> interfaceClass;
+   
+   /**
+    * Create a new WrapperSet.
+    * 
+    * @param delegate the delegate
+    * @param interfaceClass the interface class
+    */
+   public WrapperSet(Set<T> delegate, Class<T> interfaceClass)
+   {
+      if (delegate == null)
+         throw new IllegalArgumentException("Null delegate");
+      if (interfaceClass == null)
+         throw new IllegalArgumentException("Null interface class");
+
+      this.delegate = delegate;
+      this.interfaceClass = interfaceClass;
+   }
+
+   public Iterator<T> iterator()
+   {
+      return new WrapperIterator<T>(delegate.iterator(), interfaceClass);
+   }
+
+   public int size()
+   {
+      return delegate.size();
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/managed/plugins/advice/WrapperSet.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/AbstractRuntimeComponentDispatcher.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/AbstractRuntimeComponentDispatcher.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/AbstractRuntimeComponentDispatcher.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,97 +1,97 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management;
-
-import org.jboss.deployers.spi.management.RuntimeComponentDispatcher;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-
-/**
- * Abstract component dispatcher.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractRuntimeComponentDispatcher implements RuntimeComponentDispatcher
-{
-   private MetaValueFactory valueFactory;
-
-   protected AbstractRuntimeComponentDispatcher(MetaValueFactory valueFactory)
-   {
-      if (valueFactory == null)
-         valueFactory = MetaValueFactory.getInstance();
-      this.valueFactory = valueFactory;
-   }
-
-   /**
-    * Create meta value.
-    *
-    * @param value the value
-    * @return meta value instance
-    */
-   protected MetaValue create(Object value)
-   {
-      return valueFactory.create(value);
-   }
-
-   /**
-    * Unwrap meta value.
-    *
-    * @param metaValue the meta value
-    * @return unwrapped value
-    */
-   protected Object unwrap(MetaValue metaValue)
-   {
-      return valueFactory.unwrap(metaValue);
-   }
-
-   /**
-    * Get the arguments from meta values.
-    *
-    * @param param the meta value parameters
-    * @return unwrapped object array
-    */
-   protected Object[] toArguments(MetaValue... param)
-   {
-      Object[] args = new Object[param.length];
-      for(int i=0; i < param.length; i++)
-      {
-         args[i] = unwrap(param[i]);
-      }
-      return args;
-   }
-
-   /**
-    * Get the parameters signatures.
-    *
-    * @param param the parameters
-    * @return signatures
-    */
-   protected static String[] toSignature(MetaValue... param)
-   {
-      String[] signature = new String[param.length];
-      for(int i=0; i < param.length; i++)
-      {
-         signature[i] = param[i].getMetaType().getTypeName();
-      }
-      return signature;
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management;
+
+import org.jboss.deployers.spi.management.RuntimeComponentDispatcher;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+
+/**
+ * Abstract component dispatcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractRuntimeComponentDispatcher implements RuntimeComponentDispatcher
+{
+   private MetaValueFactory valueFactory;
+
+   protected AbstractRuntimeComponentDispatcher(MetaValueFactory valueFactory)
+   {
+      if (valueFactory == null)
+         valueFactory = MetaValueFactory.getInstance();
+      this.valueFactory = valueFactory;
+   }
+
+   /**
+    * Create meta value.
+    *
+    * @param value the value
+    * @return meta value instance
+    */
+   protected MetaValue create(Object value)
+   {
+      return valueFactory.create(value);
+   }
+
+   /**
+    * Unwrap meta value.
+    *
+    * @param metaValue the meta value
+    * @return unwrapped value
+    */
+   protected Object unwrap(MetaValue metaValue)
+   {
+      return valueFactory.unwrap(metaValue);
+   }
+
+   /**
+    * Get the arguments from meta values.
+    *
+    * @param param the meta value parameters
+    * @return unwrapped object array
+    */
+   protected Object[] toArguments(MetaValue... param)
+   {
+      Object[] args = new Object[param.length];
+      for(int i=0; i < param.length; i++)
+      {
+         args[i] = unwrap(param[i]);
+      }
+      return args;
+   }
+
+   /**
+    * Get the parameters signatures.
+    *
+    * @param param the parameters
+    * @return signatures
+    */
+   protected static String[] toSignature(MetaValue... param)
+   {
+      String[] signature = new String[param.length];
+      for(int i=0; i < param.length; i++)
+      {
+         signature[i] = param[i].getMetaType().getTypeName();
+      }
+      return signature;
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/AbstractRuntimeComponentDispatcher.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/KernelBusRuntimeComponentDispatcher.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/KernelBusRuntimeComponentDispatcher.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/KernelBusRuntimeComponentDispatcher.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,87 +1,87 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management;
-
-import java.lang.reflect.UndeclaredThrowableException;
-
-import org.jboss.kernel.spi.registry.KernelBus;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.MetaValueFactory;
-
-/**
- * Microcontainer KernelBus runtime component dispatcher.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class KernelBusRuntimeComponentDispatcher extends AbstractRuntimeComponentDispatcher
-{
-   private KernelBus bus;
-
-   public KernelBusRuntimeComponentDispatcher(KernelBus bus)
-   {
-      this(bus, null);
-   }
-
-   public KernelBusRuntimeComponentDispatcher(KernelBus bus, MetaValueFactory valueFactory)
-   {
-      super(valueFactory);
-      if (bus == null)
-         throw new IllegalArgumentException("Null kernel bus.");
-      this.bus = bus;
-   }
-
-   public MetaValue get(Object componentName, String propertyName)
-   {
-      try
-      {
-         return create(bus.get(componentName, propertyName));
-      }
-      catch (Throwable t)
-      {
-         throw new UndeclaredThrowableException(t);
-      }
-   }
-
-   public void set(Object componentName, String propertyName, MetaValue value)
-   {
-      try
-      {
-         bus.set(componentName, propertyName, unwrap(value));
-      }
-      catch (Throwable t)
-      {
-         throw new UndeclaredThrowableException(t);
-      }
-   }
-
-   public Object invoke(Object componentName, String methodName, MetaValue... param)
-   {
-      try
-      {
-         return bus.invoke(componentName, methodName, toArguments(param), toSignature(param));
-      }
-      catch (Throwable t)
-      {
-         throw new UndeclaredThrowableException(t);
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management;
+
+import java.lang.reflect.UndeclaredThrowableException;
+
+import org.jboss.kernel.spi.registry.KernelBus;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.MetaValueFactory;
+
+/**
+ * Microcontainer KernelBus runtime component dispatcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class KernelBusRuntimeComponentDispatcher extends AbstractRuntimeComponentDispatcher
+{
+   private KernelBus bus;
+
+   public KernelBusRuntimeComponentDispatcher(KernelBus bus)
+   {
+      this(bus, null);
+   }
+
+   public KernelBusRuntimeComponentDispatcher(KernelBus bus, MetaValueFactory valueFactory)
+   {
+      super(valueFactory);
+      if (bus == null)
+         throw new IllegalArgumentException("Null kernel bus.");
+      this.bus = bus;
+   }
+
+   public MetaValue get(Object componentName, String propertyName)
+   {
+      try
+      {
+         return create(bus.get(componentName, propertyName));
+      }
+      catch (Throwable t)
+      {
+         throw new UndeclaredThrowableException(t);
+      }
+   }
+
+   public void set(Object componentName, String propertyName, MetaValue value)
+   {
+      try
+      {
+         bus.set(componentName, propertyName, unwrap(value));
+      }
+      catch (Throwable t)
+      {
+         throw new UndeclaredThrowableException(t);
+      }
+   }
+
+   public Object invoke(Object componentName, String methodName, MetaValue... param)
+   {
+      try
+      {
+         return bus.invoke(componentName, methodName, toArguments(param), toSignature(param));
+      }
+      catch (Throwable t)
+      {
+         throw new UndeclaredThrowableException(t);
+      }
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/KernelBusRuntimeComponentDispatcher.java
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/messages.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,247 +1,247 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.templates;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlValue;
-import org.jboss.deployers.spi.management.DeploymentTemplate;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.managed.api.DeploymentTemplateInfo;
-import org.jboss.managed.api.ManagedProperty;
-import org.jboss.metatype.api.values.MetaValue;
-import org.jboss.metatype.api.values.SimpleValue;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * A template for creating jms destinations
- * 
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: $</tt>
- */
-public class JmsDestinationTemplate
-   implements DeploymentTemplate
-{
-   private DeploymentTemplateInfo info;
-
-   public DeploymentTemplateInfo getInfo()
-   {
-      return info;
-   }
-
-   public void setInfo(DeploymentTemplateInfo info)
-   {
-      this.info = info;
-   }
-
-   public VirtualFile applyTemplate(VirtualFile root, String deploymentBaseName, DeploymentTemplateInfo values)
-      throws Exception
-   {
-      String dsName = deploymentBaseName + "-service.xml";
-      URI dsXmlURI = new URI(root.toURI() + dsName);
-      File dsXml = new File(dsXmlURI.getPath());
-      writeTemplate(dsXml, values);
-      return root.findChild(dsName);
-   }
-
-   public void updateTemplateDeployment(VFSDeployment ctx, DeploymentTemplateInfo values) throws Exception
-   {
-   }
-
-   private void writeTemplate(File dsXml, DeploymentTemplateInfo info)
-      throws Exception
-   {
-      JmsDestinationTemplateInfo destinationInfo = (JmsDestinationTemplateInfo)info;
-      String destinationType = destinationInfo.getDestinationType();
-
-      JmsDestinationMetaData destination = new JmsDestinationMetaData();
-      String jndiName = "" + getProperty(info, "JNDIName");
-      if("queue".equals(destinationType))
-      {
-         destination.className = "org.jboss.jms.server.destination.QueueService";
-         destination.annotation =
-            "@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)";
-         destination.xmbeanDd = "xmdesc/Queue-xmbean.xml";
-         destination.jmxName = "jboss.messaging.destination:service=Queue,name=" + jndiName;
-      }
-      else if("topic".equals(destinationType))
-      {
-         destination.className = "org.jboss.jms.server.destination.TopicService";
-         destination.annotation =
-            "@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.TopicServiceMO)";
-         destination.xmbeanDd = "xmdesc/Topic-xmbean.xml";
-         destination.jmxName = "jboss.messaging.destination:service=Topic,name=" + jndiName;
-      }
-      else
-      {
-         throw new IllegalStateException("Unsupported destination type: " + destinationType);
-      }
-      List<JmsAttributeMetaData> attributes = new ArrayList<JmsAttributeMetaData>();
-
-      JmsAttributeMetaData jndiNameMD = new JmsAttributeMetaData("JNDIName", jndiName);
-      destination.attribute = attributes;
-      attributes.add(jndiNameMD);
-
-      List<JmsDependencyMetaData> depends = new ArrayList<JmsDependencyMetaData>();
-      destination.depends = depends;
-      depends.add(new JmsDependencyMetaData("ServerPeer", "jboss.messaging:service=ServerPeer"));
-      depends.add(new JmsDependencyMetaData("jboss.messaging:service=PostOffice"));
-
-      JmsDestinationDeployment deployment = new JmsDestinationDeployment();
-      deployment.destination = destination;
-
-      Class[] classes = {JmsDestinationDeployment.class};
-      JAXBContext context = JAXBContext.newInstance(classes);
-      Marshaller marshaller = context.createMarshaller();
-      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
-
-      JAXBElement<JmsDestinationDeployment> root =
-         new JAXBElement<JmsDestinationDeployment>(
-            new javax.xml.namespace.QName("server"),
-            JmsDestinationDeployment.class,
-            null, deployment
-         );
-
-      FileWriter fw = null;
-      try
-      {
-         fw = new FileWriter(dsXml);
-         marshaller.marshal(root, fw);
-      }
-      finally
-      {
-         if(fw != null)
-         {
-            fw.close();
-         }
-      }
-   }
-
-   /**
-    * Extract the value from the property MetaValue
-    * @param info - template info
-    * @param propName - the name of the property to return a value for
-    * @return the unwrapped property value
-    */
-   private Object getProperty(DeploymentTemplateInfo info, String propName)
-   {
-      Map<String, ManagedProperty> propsInfo = info.getProperties();
-      ManagedProperty prop = propsInfo.get(propName);
-      if(prop == null)
-      {
-         throw new IllegalStateException("Property " + propName + " not found.");
-      }
-      Object value = prop.getValue();
-      if(value instanceof MetaValue)
-      {
-         if (prop.getMetaType().isComposite())
-         {
-            throw new IllegalArgumentException("Unable to handle composite: "+prop);
-         }
-         else if(prop.getMetaType().isSimple())
-         {
-            SimpleValue sv = SimpleValue.class.cast(value);
-            value = sv.getValue();
-         }
-      }
-      return value;
-   }
-
-   // the classes below should go away and ServiceDeployment and MetaData
-   // API should be used instead once their bound with JAXB
-
-   @XmlRootElement(name = "server")
-   public static class JmsDestinationDeployment
-   {
-      @XmlElement(name = "mbean")
-      public JmsDestinationMetaData destination;
-   }
-
-   public static class JmsDestinationMetaData
-   {
-      @XmlAttribute(name = "code")
-      String className;
-
-      @XmlAttribute(name = "name")
-      String jmxName;
-
-      @XmlAttribute(name = "xmbean-dd")
-      String xmbeanDd;
-
-      @XmlElement
-      String annotation;
-
-      public List<JmsAttributeMetaData> attribute;
-      public List<JmsDependencyMetaData> depends;
-   }
-
-   public static class JmsAttributeMetaData
-   {
-      @XmlAttribute
-      String name;
-      @XmlValue
-      String value;
-      public JmsAttributeMetaData()
-      {
-      }
-      public JmsAttributeMetaData(String name, String value)
-      {
-         this.name = name;
-         this.value = value;
-      }
-   }
-   public static class JmsDependencyMetaData
-   {
-      @XmlAttribute(name = "optional-attribute-name")
-      String attribute;
-
-      @XmlValue
-      String value;
-
-      public JmsDependencyMetaData()
-      {
-      }
-
-
-      public JmsDependencyMetaData(String value)
-      {
-         this.value = value;
-      }
-
-
-      public JmsDependencyMetaData(String attribute, String value)
-      {
-         this.attribute = attribute;
-         this.value = value;
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.templates;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlValue;
+import org.jboss.deployers.spi.management.DeploymentTemplate;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.managed.api.DeploymentTemplateInfo;
+import org.jboss.managed.api.ManagedProperty;
+import org.jboss.metatype.api.values.MetaValue;
+import org.jboss.metatype.api.values.SimpleValue;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A template for creating jms destinations
+ * 
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public class JmsDestinationTemplate
+   implements DeploymentTemplate
+{
+   private DeploymentTemplateInfo info;
+
+   public DeploymentTemplateInfo getInfo()
+   {
+      return info;
+   }
+
+   public void setInfo(DeploymentTemplateInfo info)
+   {
+      this.info = info;
+   }
+
+   public VirtualFile applyTemplate(VirtualFile root, String deploymentBaseName, DeploymentTemplateInfo values)
+      throws Exception
+   {
+      String dsName = deploymentBaseName + "-service.xml";
+      URI dsXmlURI = new URI(root.toURI() + dsName);
+      File dsXml = new File(dsXmlURI.getPath());
+      writeTemplate(dsXml, values);
+      return root.findChild(dsName);
+   }
+
+   public void updateTemplateDeployment(VFSDeployment ctx, DeploymentTemplateInfo values) throws Exception
+   {
+   }
+
+   private void writeTemplate(File dsXml, DeploymentTemplateInfo info)
+      throws Exception
+   {
+      JmsDestinationTemplateInfo destinationInfo = (JmsDestinationTemplateInfo)info;
+      String destinationType = destinationInfo.getDestinationType();
+
+      JmsDestinationMetaData destination = new JmsDestinationMetaData();
+      String jndiName = "" + getProperty(info, "JNDIName");
+      if("queue".equals(destinationType))
+      {
+         destination.className = "org.jboss.jms.server.destination.QueueService";
+         destination.annotation =
+            "@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.QueueServiceMO)";
+         destination.xmbeanDd = "xmdesc/Queue-xmbean.xml";
+         destination.jmxName = "jboss.messaging.destination:service=Queue,name=" + jndiName;
+      }
+      else if("topic".equals(destinationType))
+      {
+         destination.className = "org.jboss.jms.server.destination.TopicService";
+         destination.annotation =
+            "@org.jboss.system.deployers.managed.ManagementObjectClass(code=org.jboss.jms.server.destination.TopicServiceMO)";
+         destination.xmbeanDd = "xmdesc/Topic-xmbean.xml";
+         destination.jmxName = "jboss.messaging.destination:service=Topic,name=" + jndiName;
+      }
+      else
+      {
+         throw new IllegalStateException("Unsupported destination type: " + destinationType);
+      }
+      List<JmsAttributeMetaData> attributes = new ArrayList<JmsAttributeMetaData>();
+
+      JmsAttributeMetaData jndiNameMD = new JmsAttributeMetaData("JNDIName", jndiName);
+      destination.attribute = attributes;
+      attributes.add(jndiNameMD);
+
+      List<JmsDependencyMetaData> depends = new ArrayList<JmsDependencyMetaData>();
+      destination.depends = depends;
+      depends.add(new JmsDependencyMetaData("ServerPeer", "jboss.messaging:service=ServerPeer"));
+      depends.add(new JmsDependencyMetaData("jboss.messaging:service=PostOffice"));
+
+      JmsDestinationDeployment deployment = new JmsDestinationDeployment();
+      deployment.destination = destination;
+
+      Class[] classes = {JmsDestinationDeployment.class};
+      JAXBContext context = JAXBContext.newInstance(classes);
+      Marshaller marshaller = context.createMarshaller();
+      marshaller.setProperty("jaxb.formatted.output", Boolean.TRUE);
+
+      JAXBElement<JmsDestinationDeployment> root =
+         new JAXBElement<JmsDestinationDeployment>(
+            new javax.xml.namespace.QName("server"),
+            JmsDestinationDeployment.class,
+            null, deployment
+         );
+
+      FileWriter fw = null;
+      try
+      {
+         fw = new FileWriter(dsXml);
+         marshaller.marshal(root, fw);
+      }
+      finally
+      {
+         if(fw != null)
+         {
+            fw.close();
+         }
+      }
+   }
+
+   /**
+    * Extract the value from the property MetaValue
+    * @param info - template info
+    * @param propName - the name of the property to return a value for
+    * @return the unwrapped property value
+    */
+   private Object getProperty(DeploymentTemplateInfo info, String propName)
+   {
+      Map<String, ManagedProperty> propsInfo = info.getProperties();
+      ManagedProperty prop = propsInfo.get(propName);
+      if(prop == null)
+      {
+         throw new IllegalStateException("Property " + propName + " not found.");
+      }
+      Object value = prop.getValue();
+      if(value instanceof MetaValue)
+      {
+         if (prop.getMetaType().isComposite())
+         {
+            throw new IllegalArgumentException("Unable to handle composite: "+prop);
+         }
+         else if(prop.getMetaType().isSimple())
+         {
+            SimpleValue sv = SimpleValue.class.cast(value);
+            value = sv.getValue();
+         }
+      }
+      return value;
+   }
+
+   // the classes below should go away and ServiceDeployment and MetaData
+   // API should be used instead once their bound with JAXB
+
+   @XmlRootElement(name = "server")
+   public static class JmsDestinationDeployment
+   {
+      @XmlElement(name = "mbean")
+      public JmsDestinationMetaData destination;
+   }
+
+   public static class JmsDestinationMetaData
+   {
+      @XmlAttribute(name = "code")
+      String className;
+
+      @XmlAttribute(name = "name")
+      String jmxName;
+
+      @XmlAttribute(name = "xmbean-dd")
+      String xmbeanDd;
+
+      @XmlElement
+      String annotation;
+
+      public List<JmsAttributeMetaData> attribute;
+      public List<JmsDependencyMetaData> depends;
+   }
+
+   public static class JmsAttributeMetaData
+   {
+      @XmlAttribute
+      String name;
+      @XmlValue
+      String value;
+      public JmsAttributeMetaData()
+      {
+      }
+      public JmsAttributeMetaData(String name, String value)
+      {
+         this.name = name;
+         this.value = value;
+      }
+   }
+   public static class JmsDependencyMetaData
+   {
+      @XmlAttribute(name = "optional-attribute-name")
+      String attribute;
+
+      @XmlValue
+      String value;
+
+      public JmsDependencyMetaData()
+      {
+      }
+
+
+      public JmsDependencyMetaData(String value)
+      {
+         this.value = value;
+      }
+
+
+      public JmsDependencyMetaData(String attribute, String value)
+      {
+         this.attribute = attribute;
+         this.value = value;
+      }
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplate.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplateInfo.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplateInfo.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplateInfo.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,133 +1,133 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.templates;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.annotation.factory.AnnotationProxy;
-import org.jboss.managed.api.Fields;
-import org.jboss.managed.api.annotation.ManagementObjectID;
-import org.jboss.managed.plugins.BasicDeploymentTemplateInfo;
-import org.jboss.managed.plugins.ManagedObjectImpl;
-import org.jboss.managed.plugins.DefaultFieldsImpl;
-import org.jboss.managed.plugins.ManagedPropertyImpl;
-import org.jboss.metatype.api.types.MetaType;
-import org.jboss.metatype.api.types.SimpleMetaType;
-
-/**
- * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
- * @version <tt>$Revision: $</tt>
- */
-public class JmsDestinationTemplateInfo extends BasicDeploymentTemplateInfo
-{
-   private static final long serialVersionUID = 1;
-   private String destinationType = "queue";
-
-   public JmsDestinationTemplateInfo(String name, String description, String destinationType)
-   {
-      super(name, description);
-      this.destinationType = destinationType;
-      super.setRootManagedPropertyName("services");
-   }
-
-
-   public String getDestinationType()
-   {
-      return destinationType;
-   }
-
-   public void start()
-   {
-      ManagedObjectImpl mo;
-      if("queue".equals(destinationType))
-         mo = new ManagedObjectImpl("org.jboss.jms.server.destination.QueueServiceMO");
-      else if("topic".equals(destinationType))
-         mo = new ManagedObjectImpl("org.jboss.jms.server.destination.TopicServiceMO");
-      else
-         throw new IllegalStateException("Unexpected destination type: " + destinationType);
-
-      addManagedProperty("name", "The destination name", true, false, SimpleMetaType.STRING, mo);
-      addManagedProperty("JNDIName", "The destination's JNDI name", false, true, SimpleMetaType.STRING, mo);
-   }
-
-   private void addManagedProperty(String fieldName,
-                                   String fieldDescr,
-                                   boolean mandatory,
-                                   boolean isID,
-                                   MetaType metaType,
-                                   ManagedObjectImpl mo)
-   {
-      addManagedProperty(fieldName, fieldDescr, mandatory, isID, metaType, null, mo);
-   }
-
-   private void addManagedProperty(String fieldName,
-                                   String fieldDescr,
-                                   boolean mandatory,
-                                   boolean isID,
-                                   MetaType metaType,
-                                   java.io.Serializable value,
-                                   ManagedObjectImpl mo)
-   {
-      DefaultFieldsImpl fields = new DefaultFieldsImpl();
-      setFieldName(fieldName, fields);
-      fields.setDescription(fieldDescr);
-      fields.setMandatory(mandatory);
-      fields.setMetaType(metaType);
-      ManagedPropertyImpl mp = new ManagedPropertyImpl(mo, fields);
-      if(isID)
-      {
-         Map<String, Annotation> annotations = new HashMap<String, Annotation>();
-         Map<String, Object> idFields = Collections.emptyMap();
-         try
-         {
-            ManagementObjectID id = (ManagementObjectID) AnnotationProxy.createProxy(idFields, ManagementObjectID.class);
-            annotations.put(ManagementObjectID.class.getName(), id);
-            mp.setAnnotations(annotations);
-         }
-         catch(Exception e)
-         {
-            throw new UndeclaredThrowableException(e);
-         }
-      }
-
-      super.addProperty(mp);
-      if(value != null)
-         mp.setValue(value);
-   }
-
-   protected void setFieldName(String name, Fields f)
-   {
-      f.setField(Fields.NAME, name);
-/*
-      if( propertyNameMappings != null )
-      {
-         String mappedName = propertyNameMappings.get(name);
-         if( mappedName != null )
-            f.setField(Fields.MAPPED_NAME, mappedName);
-      }
-*/
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.templates;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.annotation.factory.AnnotationProxy;
+import org.jboss.managed.api.Fields;
+import org.jboss.managed.api.annotation.ManagementObjectID;
+import org.jboss.managed.plugins.BasicDeploymentTemplateInfo;
+import org.jboss.managed.plugins.ManagedObjectImpl;
+import org.jboss.managed.plugins.DefaultFieldsImpl;
+import org.jboss.managed.plugins.ManagedPropertyImpl;
+import org.jboss.metatype.api.types.MetaType;
+import org.jboss.metatype.api.types.SimpleMetaType;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public class JmsDestinationTemplateInfo extends BasicDeploymentTemplateInfo
+{
+   private static final long serialVersionUID = 1;
+   private String destinationType = "queue";
+
+   public JmsDestinationTemplateInfo(String name, String description, String destinationType)
+   {
+      super(name, description);
+      this.destinationType = destinationType;
+      super.setRootManagedPropertyName("services");
+   }
+
+
+   public String getDestinationType()
+   {
+      return destinationType;
+   }
+
+   public void start()
+   {
+      ManagedObjectImpl mo;
+      if("queue".equals(destinationType))
+         mo = new ManagedObjectImpl("org.jboss.jms.server.destination.QueueServiceMO");
+      else if("topic".equals(destinationType))
+         mo = new ManagedObjectImpl("org.jboss.jms.server.destination.TopicServiceMO");
+      else
+         throw new IllegalStateException("Unexpected destination type: " + destinationType);
+
+      addManagedProperty("name", "The destination name", true, false, SimpleMetaType.STRING, mo);
+      addManagedProperty("JNDIName", "The destination's JNDI name", false, true, SimpleMetaType.STRING, mo);
+   }
+
+   private void addManagedProperty(String fieldName,
+                                   String fieldDescr,
+                                   boolean mandatory,
+                                   boolean isID,
+                                   MetaType metaType,
+                                   ManagedObjectImpl mo)
+   {
+      addManagedProperty(fieldName, fieldDescr, mandatory, isID, metaType, null, mo);
+   }
+
+   private void addManagedProperty(String fieldName,
+                                   String fieldDescr,
+                                   boolean mandatory,
+                                   boolean isID,
+                                   MetaType metaType,
+                                   java.io.Serializable value,
+                                   ManagedObjectImpl mo)
+   {
+      DefaultFieldsImpl fields = new DefaultFieldsImpl();
+      setFieldName(fieldName, fields);
+      fields.setDescription(fieldDescr);
+      fields.setMandatory(mandatory);
+      fields.setMetaType(metaType);
+      ManagedPropertyImpl mp = new ManagedPropertyImpl(mo, fields);
+      if(isID)
+      {
+         Map<String, Annotation> annotations = new HashMap<String, Annotation>();
+         Map<String, Object> idFields = Collections.emptyMap();
+         try
+         {
+            ManagementObjectID id = (ManagementObjectID) AnnotationProxy.createProxy(idFields, ManagementObjectID.class);
+            annotations.put(ManagementObjectID.class.getName(), id);
+            mp.setAnnotations(annotations);
+         }
+         catch(Exception e)
+         {
+            throw new UndeclaredThrowableException(e);
+         }
+      }
+
+      super.addProperty(mp);
+      if(value != null)
+         mp.setValue(value);
+   }
+
+   protected void setFieldName(String name, Fields f)
+   {
+      f.setField(Fields.NAME, name);
+/*
+      if( propertyNameMappings != null )
+      {
+         String mappedName = propertyNameMappings.get(name);
+         if( mappedName != null )
+            f.setField(Fields.MAPPED_NAME, mappedName);
+      }
+*/
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/templates/JmsDestinationTemplateInfo.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,264 +1,264 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.management.upload.remoting.DeployHandler;
-import org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget;
-import org.jboss.profileservice.spi.DeploymentRepository;
-import org.jboss.profileservice.spi.DeploymentRepositoryFactory;
-import org.jboss.profileservice.spi.NoSuchProfileException;
-import org.jboss.profileservice.spi.Profile;
-import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * The remoting base DeploymentManager implementation
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class DeploymentManagerImpl implements DeploymentManager
-{
-   private static Logger log = Logger.getLogger(DeploymentManagerImpl.class);
-   private static final String BUNDLE_NAME = "org.jboss.profileservice.management.upload.messages"; //$NON-NLS-1$
-   /** */
-   private ProfileService ps;
-   /** The currently loaded profile */
-   private Profile activeProfile;
-   private DeploymentRepositoryFactory repositoryFactory;
-   private DeployHandler deployHandler;
-
-   /** */
-   private ResourceBundle i18n;
-   /** */
-   private Locale currentLocale;
-   /** */
-   private MessageFormat formatter = new MessageFormat("");
-   private InvokerLocator locator;
-   private String remotingSubsystem = "DeploymentManager";
-
-   public DeploymentManagerImpl()
-   {
-      currentLocale = Locale.getDefault();
-      formatter.setLocale(currentLocale);
-      i18n = ResourceBundle.getBundle(BUNDLE_NAME, currentLocale);
-   }
-
-   
-   public ProfileService getProfileService()
-   {
-      return ps;
-   }
-   public void setProfileService(ProfileService ps)
-   {
-      this.ps = ps;
-   }
-
-   public DeploymentRepositoryFactory getRepositoryFactory()
-   {
-      return repositoryFactory;
-   }
-   public void setRepositoryFactory(DeploymentRepositoryFactory repositoryFactory)
-   {
-      this.repositoryFactory = repositoryFactory;
-   }
-
-   public DeployHandler getDeployHandler()
-   {
-      return deployHandler;
-   }
-   public void setDeployHandler(DeployHandler deployHandler)
-   {
-      this.deployHandler = deployHandler;
-   }
-
-   public InvokerLocator getLocator()
-   {
-      return locator;
-   }
-   public void setLocator(InvokerLocator locator)
-   {
-      this.locator = locator;
-   }
-
-   public String getRemotingSubsystem()
-   {
-      return remotingSubsystem;
-   }
-   public void setRemotingSubsystem(String remotingSubsystem)
-   {
-      this.remotingSubsystem = remotingSubsystem;
-   }
-
-   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL)
-      throws Exception
-   {
-      return distribute(name, phase, contentURL, true);
-   }
-
-   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent)
-      throws Exception
-   {
-      if(activeProfile == null)
-      {
-         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
-         Object[] args = {};
-         String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
-      }
-
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, contentURL.toString());
-      deployment.setContentURL(contentURL);
-      deployment.setCopyContent(copyContent);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.DISTRIBUTE);
-   }
-
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
-   {
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      return targets.get(0).getRepositoryNames(names, phase);
-   }
-
-   public boolean isRedeploySupported()
-   {
-      return false;
-   }
-
-   public void loadProfile(ProfileKey key, boolean allowHotDeployments)
-      throws Exception
-   {
-      activeProfile = ps.getProfile(key);
-      if( activeProfile == null )
-      {
-         formatter.applyPattern(i18n.getString("DeploymentManager.NoSuchProfileException")); //$NON-NLS-1$
-         Object[] args = {key};
-         String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
-      }
-      log.debug("Loading profile, key: "+key+", allowHotDeployments: "+allowHotDeployments);
-      activeProfile.enableModifiedDeploymentChecks(allowHotDeployments);
-      // Set the deployment repository on the handler
-      DeploymentRepository repository = repositoryFactory.getDeploymentRepository(key);
-      log.debug("DeploymentRepository for profile: "+repository);
-      deployHandler.setDeploymentRepository(repository);
-   }
-
-   public void releaseProfile(ProfileKey key, boolean allowHotDeployments)
-         throws Exception
-   {
-      activeProfile = ps.getProfile(key);
-      if( activeProfile == null )
-      {
-         formatter.applyPattern(i18n.getString("DeploymentManager.NoSuchProfileException")); //$NON-NLS-1$
-         Object[] args = {key};
-         String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
-      }
-      log.debug("Releasing profile, key: "+key);
-      activeProfile.enableModifiedDeploymentChecks(allowHotDeployments);
-      deployHandler.setDeploymentRepository(null);
-   }
-
-   public DeploymentProgress redeploy(String name, DeploymentPhase phase, URL contentURL)
-      throws Exception
-   {
-      if(activeProfile == null)
-      {
-         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
-         Object[] args = {};
-         String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
-      }
-
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.REDEPLOY);
-   }
-
-   public DeploymentProgress prepare(DeploymentPhase phase, String... names) throws Exception
-   {
-      return doProgress(CommandType.PREPARE, phase, names);
-   }
-
-   public DeploymentProgress start(DeploymentPhase phase, String... names) throws Exception
-   {
-      return doProgress(CommandType.START, phase, names);
-   }
-
-   public DeploymentProgress stop(DeploymentPhase phase, String... names) throws Exception
-   {
-      return doProgress(CommandType.STOP, phase, names);
-   }
-
-   public DeploymentProgress undeploy(DeploymentPhase phase, String... names) throws Exception
-   {
-      return doProgress(CommandType.UNDEPLOY, phase, names);
-   }
-
-   protected DeploymentProgress doProgress(CommandType type, DeploymentPhase phase, String... names)
-      throws Exception
-   {
-      if(activeProfile == null)
-      {
-         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
-         Object[] args = {};
-         String msg = formatter.format(args);
-         throw new NoSuchProfileException(msg);
-      }
-
-      if (names == null || names.length == 0)
-         log.warn("Null or empty names.");
-
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, type);
-   }
-
-   /**
-    * TODO: should the targets include cluster info
-    * @param name
-    * @return
-    */
-   protected List<DeploymentTarget> getDeploymentTargets()
-   {
-      String targetName = locator.getHost();
-      List<DeploymentTarget> targets = new ArrayList<DeploymentTarget>();
-      StreamingDeploymentTarget hostTarget = new StreamingDeploymentTarget(locator, targetName, remotingSubsystem);
-      targets.add(hostTarget);
-      return targets;
-   }
-   
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload;
+
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.management.upload.remoting.DeployHandler;
+import org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget;
+import org.jboss.profileservice.spi.DeploymentRepository;
+import org.jboss.profileservice.spi.DeploymentRepositoryFactory;
+import org.jboss.profileservice.spi.NoSuchProfileException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.remoting.InvokerLocator;
+
+/**
+ * The remoting base DeploymentManager implementation
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class DeploymentManagerImpl implements DeploymentManager
+{
+   private static Logger log = Logger.getLogger(DeploymentManagerImpl.class);
+   private static final String BUNDLE_NAME = "org.jboss.profileservice.management.upload.messages"; //$NON-NLS-1$
+   /** */
+   private ProfileService ps;
+   /** The currently loaded profile */
+   private Profile activeProfile;
+   private DeploymentRepositoryFactory repositoryFactory;
+   private DeployHandler deployHandler;
+
+   /** */
+   private ResourceBundle i18n;
+   /** */
+   private Locale currentLocale;
+   /** */
+   private MessageFormat formatter = new MessageFormat("");
+   private InvokerLocator locator;
+   private String remotingSubsystem = "DeploymentManager";
+
+   public DeploymentManagerImpl()
+   {
+      currentLocale = Locale.getDefault();
+      formatter.setLocale(currentLocale);
+      i18n = ResourceBundle.getBundle(BUNDLE_NAME, currentLocale);
+   }
+
+   
+   public ProfileService getProfileService()
+   {
+      return ps;
+   }
+   public void setProfileService(ProfileService ps)
+   {
+      this.ps = ps;
+   }
+
+   public DeploymentRepositoryFactory getRepositoryFactory()
+   {
+      return repositoryFactory;
+   }
+   public void setRepositoryFactory(DeploymentRepositoryFactory repositoryFactory)
+   {
+      this.repositoryFactory = repositoryFactory;
+   }
+
+   public DeployHandler getDeployHandler()
+   {
+      return deployHandler;
+   }
+   public void setDeployHandler(DeployHandler deployHandler)
+   {
+      this.deployHandler = deployHandler;
+   }
+
+   public InvokerLocator getLocator()
+   {
+      return locator;
+   }
+   public void setLocator(InvokerLocator locator)
+   {
+      this.locator = locator;
+   }
+
+   public String getRemotingSubsystem()
+   {
+      return remotingSubsystem;
+   }
+   public void setRemotingSubsystem(String remotingSubsystem)
+   {
+      this.remotingSubsystem = remotingSubsystem;
+   }
+
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL)
+      throws Exception
+   {
+      return distribute(name, phase, contentURL, true);
+   }
+
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent)
+      throws Exception
+   {
+      if(activeProfile == null)
+      {
+         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
+         Object[] args = {};
+         String msg = formatter.format(args);
+         throw new NoSuchProfileException(msg);
+      }
+
+      List<DeploymentTarget> targets = getDeploymentTargets();
+      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, contentURL.toString());
+      deployment.setContentURL(contentURL);
+      deployment.setCopyContent(copyContent);
+      return new DeploymentProgressImpl(targets, deployment, CommandType.DISTRIBUTE);
+   }
+
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
+   {
+      List<DeploymentTarget> targets = getDeploymentTargets();
+      return targets.get(0).getRepositoryNames(names, phase);
+   }
+
+   public boolean isRedeploySupported()
+   {
+      return false;
+   }
+
+   public void loadProfile(ProfileKey key, boolean allowHotDeployments)
+      throws Exception
+   {
+      activeProfile = ps.getProfile(key);
+      if( activeProfile == null )
+      {
+         formatter.applyPattern(i18n.getString("DeploymentManager.NoSuchProfileException")); //$NON-NLS-1$
+         Object[] args = {key};
+         String msg = formatter.format(args);
+         throw new NoSuchProfileException(msg);
+      }
+      log.debug("Loading profile, key: "+key+", allowHotDeployments: "+allowHotDeployments);
+      activeProfile.enableModifiedDeploymentChecks(allowHotDeployments);
+      // Set the deployment repository on the handler
+      DeploymentRepository repository = repositoryFactory.getDeploymentRepository(key);
+      log.debug("DeploymentRepository for profile: "+repository);
+      deployHandler.setDeploymentRepository(repository);
+   }
+
+   public void releaseProfile(ProfileKey key, boolean allowHotDeployments)
+         throws Exception
+   {
+      activeProfile = ps.getProfile(key);
+      if( activeProfile == null )
+      {
+         formatter.applyPattern(i18n.getString("DeploymentManager.NoSuchProfileException")); //$NON-NLS-1$
+         Object[] args = {key};
+         String msg = formatter.format(args);
+         throw new NoSuchProfileException(msg);
+      }
+      log.debug("Releasing profile, key: "+key);
+      activeProfile.enableModifiedDeploymentChecks(allowHotDeployments);
+      deployHandler.setDeploymentRepository(null);
+   }
+
+   public DeploymentProgress redeploy(String name, DeploymentPhase phase, URL contentURL)
+      throws Exception
+   {
+      if(activeProfile == null)
+      {
+         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
+         Object[] args = {};
+         String msg = formatter.format(args);
+         throw new NoSuchProfileException(msg);
+      }
+
+      List<DeploymentTarget> targets = getDeploymentTargets();
+      SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, null);
+      return new DeploymentProgressImpl(targets, deployment, CommandType.REDEPLOY);
+   }
+
+   public DeploymentProgress prepare(DeploymentPhase phase, String... names) throws Exception
+   {
+      return doProgress(CommandType.PREPARE, phase, names);
+   }
+
+   public DeploymentProgress start(DeploymentPhase phase, String... names) throws Exception
+   {
+      return doProgress(CommandType.START, phase, names);
+   }
+
+   public DeploymentProgress stop(DeploymentPhase phase, String... names) throws Exception
+   {
+      return doProgress(CommandType.STOP, phase, names);
+   }
+
+   public DeploymentProgress undeploy(DeploymentPhase phase, String... names) throws Exception
+   {
+      return doProgress(CommandType.UNDEPLOY, phase, names);
+   }
+
+   protected DeploymentProgress doProgress(CommandType type, DeploymentPhase phase, String... names)
+      throws Exception
+   {
+      if(activeProfile == null)
+      {
+         formatter.applyPattern(i18n.getString("DeploymentManager.NoProfileLoadedException")); //$NON-NLS-1$
+         Object[] args = {};
+         String msg = formatter.format(args);
+         throw new NoSuchProfileException(msg);
+      }
+
+      if (names == null || names.length == 0)
+         log.warn("Null or empty names.");
+
+      List<DeploymentTarget> targets = getDeploymentTargets();
+      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
+      return new DeploymentProgressImpl(targets, deployment, type);
+   }
+
+   /**
+    * TODO: should the targets include cluster info
+    * @param name
+    * @return
+    */
+   protected List<DeploymentTarget> getDeploymentTargets()
+   {
+      String targetName = locator.getHost();
+      List<DeploymentTarget> targets = new ArrayList<DeploymentTarget>();
+      StreamingDeploymentTarget hostTarget = new StreamingDeploymentTarget(locator, targetName, remotingSubsystem);
+      targets.add(hostTarget);
+      return targets;
+   }
+   
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,335 +1,335 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-import org.jboss.deployers.spi.management.deploy.ProgressEvent;
-import org.jboss.deployers.spi.management.deploy.ProgressListener;
-
-/**
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class DeploymentProgressImpl implements DeploymentProgress, Serializable
-{
-   private static final long serialVersionUID = 1;
-
-   /** The client side listeners */
-   private transient CopyOnWriteArrayList<ProgressListener> listeners = new CopyOnWriteArrayList<ProgressListener>();
-   private transient DeploymentStatus currentStatus;
-   private transient boolean isCancelled;
-   /** The targets to distribute to */
-   private List<DeploymentTarget> targets;
-   /** The deployment being distributed */
-   private DeploymentID deployment;
-   private CommandType command;
-
-   public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment, CommandType command)
-   {
-      this.targets = targets;
-      this.deployment = deployment;
-      this.command = command;
-   }
-
-   public synchronized void addProgressListener(ProgressListener listener)
-   {
-      if(listeners == null)
-         listeners = new CopyOnWriteArrayList<ProgressListener>();
-      listeners.add(listener);
-   }
-   public void removeProgressListener(ProgressListener listener)
-   {
-      listeners.remove(listener);
-   }
-
-   /**
-    * Begins the deployment command process
-    */
-   public void run()
-   {
-      switch(command)
-      {
-         case DISTRIBUTE:
-            distribute();
-            break;
-         case START:
-            start();
-            break;
-         case STOP:
-            stop();
-            break;
-         case UNDEPLOY:
-            undeploy();
-            break;
-         default:
-            throw new IllegalStateException(command+" is not currently handled");
-      }
-   }
-
-   public void cancel()
-   {
-      isCancelled = true;
-   }
-
-   public DeploymentStatus getDeploymentStatus()
-   {
-      return currentStatus;
-   }
-
-   public DeploymentID getDeploymentID()
-   {
-      return deployment;
-   }
-
-   public List<DeploymentTarget> getDeploymentTargets()
-   {
-      return targets;
-   }
-
-   /**
-    * 
-    * @param event
-    */
-   protected void notify(ProgressEvent event)
-   {
-      if(listeners == null)
-         return;
-
-      for(ProgressListener listener : listeners)
-      {
-         try
-         {
-            listener.progressEvent(event);
-         }
-         catch(Throwable ignore)
-         {
-         }
-      }
-   }
-
-   protected void distribute()
-   {
-      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
-      status.setMessage("Running distribute to: "+targets);
-      currentStatus = status;
-      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
-      notify(event);
-      for(DeploymentTarget target : targets)
-      {
-         if(isCancelled)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
-            status.setMessage("Distribute has been cancelled");
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-            break;
-         }
-
-         try
-         {
-            // TODO, percent complete info in upload and overall distribute
-            status = new SerializableDeploymentStatus(command, StateType.UPLOADING);
-            status.setTarget(target);
-            status.setMessage("Begining distribute to target: "+target);
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-
-            // TODO, cancellation of in progress distribution
-            target.distribute(deployment);
-            status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
-            status.setTarget(target);
-            status.setMessage("Completed distribute to target: "+target);
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-         }
-         catch(Exception e)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.FAILED);
-            status.setTarget(target);
-            status.setFailure(e);
-            status.setFailed(true);
-            currentStatus = status;
-            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
-            notify(error);
-            break;
-         }
-      }
-
-      if(currentStatus.isFailed() == false)
-      {
-         status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
-         status.setMessage("Completed distribute to all targets");
-         status.setCompleted(true);
-         currentStatus = status;
-         event =  new ProgressEvent(deployment, currentStatus);
-         notify(event);         
-      }
-   }
-
-   protected void start()
-   {
-      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
-      status.setMessage("Running start to: "+targets);
-      currentStatus = status;
-      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
-      notify(event);
-      for(DeploymentTarget target : targets)
-      {
-         if(isCancelled)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
-            status.setMessage("Start has been cancelled");
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-            break;
-         }
-
-         try
-         {
-            target.start(deployment);
-            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
-            status.setTarget(target);
-            status.setMessage("Completed start for target: "+target);
-            status.setCompleted(true);
-            status.setRunning(true);
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-         }
-         catch(Exception e)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.FAILED);
-            status.setTarget(target);
-            status.setFailure(e);
-            status.setFailed(true);
-            currentStatus = status;
-            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
-            notify(error);
-            break;
-         }
-      }
-   }
-
-   protected void stop()
-   {
-      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
-      status.setMessage("Running stop to: "+targets);
-      currentStatus = status;
-      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
-      notify(event);
-      for(DeploymentTarget target : targets)
-      {
-         if(isCancelled)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
-            status.setMessage("Stop has been cancelled");
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-            break;
-         }
-
-         try
-         {
-            target.stop(deployment);
-            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
-            status.setTarget(target);
-            status.setMessage("Completed stop for target: "+target);
-            status.setCompleted(true);
-            status.setRunning(true);
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-         }
-         catch(Exception e)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.FAILED);
-            status.setTarget(target);
-            status.setFailure(e);
-            status.setFailed(true);
-            currentStatus = status;
-            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
-            notify(error);
-            break;
-         }
-      }
-   }
-
-   protected void undeploy()
-   {
-      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
-      status.setMessage("Running undeploy to: "+targets);
-      currentStatus = status;
-      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
-      notify(event);
-      for(DeploymentTarget target : targets)
-      {
-         if(isCancelled)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
-            status.setMessage("Undeploy has been cancelled");
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-            break;
-         }
-
-         try
-         {
-            target.undeploy(deployment);
-            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
-            status.setTarget(target);
-            status.setMessage("Completed undeploy for target: "+target);
-            status.setCompleted(true);
-            status.setRunning(true);
-            currentStatus = status;
-            event =  new ProgressEvent(deployment, currentStatus);
-            notify(event);
-         }
-         catch(Exception e)
-         {
-            status = new SerializableDeploymentStatus(command, StateType.FAILED);
-            status.setTarget(target);
-            status.setFailure(e);
-            status.setFailed(true);
-            currentStatus = status;
-            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
-            notify(error);
-            break;
-         }
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+import org.jboss.deployers.spi.management.deploy.ProgressEvent;
+import org.jboss.deployers.spi.management.deploy.ProgressListener;
+
+/**
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DeploymentProgressImpl implements DeploymentProgress, Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   /** The client side listeners */
+   private transient CopyOnWriteArrayList<ProgressListener> listeners = new CopyOnWriteArrayList<ProgressListener>();
+   private transient DeploymentStatus currentStatus;
+   private transient boolean isCancelled;
+   /** The targets to distribute to */
+   private List<DeploymentTarget> targets;
+   /** The deployment being distributed */
+   private DeploymentID deployment;
+   private CommandType command;
+
+   public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment, CommandType command)
+   {
+      this.targets = targets;
+      this.deployment = deployment;
+      this.command = command;
+   }
+
+   public synchronized void addProgressListener(ProgressListener listener)
+   {
+      if(listeners == null)
+         listeners = new CopyOnWriteArrayList<ProgressListener>();
+      listeners.add(listener);
+   }
+   public void removeProgressListener(ProgressListener listener)
+   {
+      listeners.remove(listener);
+   }
+
+   /**
+    * Begins the deployment command process
+    */
+   public void run()
+   {
+      switch(command)
+      {
+         case DISTRIBUTE:
+            distribute();
+            break;
+         case START:
+            start();
+            break;
+         case STOP:
+            stop();
+            break;
+         case UNDEPLOY:
+            undeploy();
+            break;
+         default:
+            throw new IllegalStateException(command+" is not currently handled");
+      }
+   }
+
+   public void cancel()
+   {
+      isCancelled = true;
+   }
+
+   public DeploymentStatus getDeploymentStatus()
+   {
+      return currentStatus;
+   }
+
+   public DeploymentID getDeploymentID()
+   {
+      return deployment;
+   }
+
+   public List<DeploymentTarget> getDeploymentTargets()
+   {
+      return targets;
+   }
+
+   /**
+    * 
+    * @param event
+    */
+   protected void notify(ProgressEvent event)
+   {
+      if(listeners == null)
+         return;
+
+      for(ProgressListener listener : listeners)
+      {
+         try
+         {
+            listener.progressEvent(event);
+         }
+         catch(Throwable ignore)
+         {
+         }
+      }
+   }
+
+   protected void distribute()
+   {
+      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
+      status.setMessage("Running distribute to: "+targets);
+      currentStatus = status;
+      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
+      notify(event);
+      for(DeploymentTarget target : targets)
+      {
+         if(isCancelled)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+            status.setMessage("Distribute has been cancelled");
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+            break;
+         }
+
+         try
+         {
+            // TODO, percent complete info in upload and overall distribute
+            status = new SerializableDeploymentStatus(command, StateType.UPLOADING);
+            status.setTarget(target);
+            status.setMessage("Begining distribute to target: "+target);
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+
+            // TODO, cancellation of in progress distribution
+            target.distribute(deployment);
+            status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
+            status.setTarget(target);
+            status.setMessage("Completed distribute to target: "+target);
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+         }
+         catch(Exception e)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.FAILED);
+            status.setTarget(target);
+            status.setFailure(e);
+            status.setFailed(true);
+            currentStatus = status;
+            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+            notify(error);
+            break;
+         }
+      }
+
+      if(currentStatus.isFailed() == false)
+      {
+         status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+         status.setMessage("Completed distribute to all targets");
+         status.setCompleted(true);
+         currentStatus = status;
+         event =  new ProgressEvent(deployment, currentStatus);
+         notify(event);         
+      }
+   }
+
+   protected void start()
+   {
+      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+      status.setMessage("Running start to: "+targets);
+      currentStatus = status;
+      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
+      notify(event);
+      for(DeploymentTarget target : targets)
+      {
+         if(isCancelled)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+            status.setMessage("Start has been cancelled");
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+            break;
+         }
+
+         try
+         {
+            target.start(deployment);
+            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+            status.setTarget(target);
+            status.setMessage("Completed start for target: "+target);
+            status.setCompleted(true);
+            status.setRunning(true);
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+         }
+         catch(Exception e)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.FAILED);
+            status.setTarget(target);
+            status.setFailure(e);
+            status.setFailed(true);
+            currentStatus = status;
+            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+            notify(error);
+            break;
+         }
+      }
+   }
+
+   protected void stop()
+   {
+      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+      status.setMessage("Running stop to: "+targets);
+      currentStatus = status;
+      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
+      notify(event);
+      for(DeploymentTarget target : targets)
+      {
+         if(isCancelled)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+            status.setMessage("Stop has been cancelled");
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+            break;
+         }
+
+         try
+         {
+            target.stop(deployment);
+            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+            status.setTarget(target);
+            status.setMessage("Completed stop for target: "+target);
+            status.setCompleted(true);
+            status.setRunning(true);
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+         }
+         catch(Exception e)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.FAILED);
+            status.setTarget(target);
+            status.setFailure(e);
+            status.setFailed(true);
+            currentStatus = status;
+            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+            notify(error);
+            break;
+         }
+      }
+   }
+
+   protected void undeploy()
+   {
+      SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+      status.setMessage("Running undeploy to: "+targets);
+      currentStatus = status;
+      ProgressEvent event =  new ProgressEvent(deployment, currentStatus);
+      notify(event);
+      for(DeploymentTarget target : targets)
+      {
+         if(isCancelled)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+            status.setMessage("Undeploy has been cancelled");
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+            break;
+         }
+
+         try
+         {
+            target.undeploy(deployment);
+            status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+            status.setTarget(target);
+            status.setMessage("Completed undeploy for target: "+target);
+            status.setCompleted(true);
+            status.setRunning(true);
+            currentStatus = status;
+            event =  new ProgressEvent(deployment, currentStatus);
+            notify(event);
+         }
+         catch(Exception e)
+         {
+            status = new SerializableDeploymentStatus(command, StateType.FAILED);
+            status.setTarget(target);
+            status.setFailure(e);
+            status.setFailed(true);
+            currentStatus = status;
+            ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+            notify(error);
+            break;
+         }
+      }
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,140 +1,140 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.Arrays;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-
-/**
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class SerializableDeploymentID implements DeploymentID, Serializable
-{
-   private static final long serialVersionUID = 1;
-
-   /** An InputStream to use to copy the contents */
-   private transient InputStream contentIS;
-   private String[] deploymentNames;
-   private String[] repositoryNames;
-   private DeploymentPhase phase;
-   private String description;
-   private URL contentURL;
-   private boolean copyContent;
-
-   public SerializableDeploymentID(DeploymentID deployment)
-   {
-      this(deployment.getNames(), deployment.getPhase(), deployment.getDescription());
-   }
-   public SerializableDeploymentID(String name, DeploymentPhase phase, String description)
-   {
-      this(new String[]{name}, phase, description);
-   }
-   public SerializableDeploymentID(String[] names, DeploymentPhase phase, String description)
-   {
-      this.deploymentNames = names;
-      this.phase = phase;
-      this.description = description;
-      this.copyContent = true; // by default we copy content
-   }
-
-   public String[] getNames()
-   {
-      return deploymentNames;
-   }
-
-   public String[] getRepositoryNames()
-   {
-      if(repositoryNames == null)
-         repositoryNames = deploymentNames;
-      return repositoryNames;
-   }
-   public void setRepositoryNames(String[] names)
-   {
-      this.repositoryNames = names;
-   }
-   public DeploymentPhase getPhase()
-   {
-      return phase;
-   }
-
-   public String getDescription()
-   {
-      return description;
-   }
-
-   public URL getContentURL()
-   {
-      return contentURL;
-   }
-   public void setContentURL(URL contentURL)
-   {
-      this.contentURL = contentURL;
-   }
-
-   public boolean isCopyContent()
-   {
-      return copyContent;
-   }
-
-   public void setCopyContent(boolean copyContent)
-   {
-      this.copyContent = copyContent;
-   }
-
-   /**
-    * An optional deployment archive content stream for the top-level
-    * deployment.
-    * 
-    * @return the archive input stream if it exists
-    */
-   public InputStream getContentIS()
-   {
-      return contentIS;
-   }
-   /**
-    * 
-    * @param contentIS
-    */
-   public void setContentIS(InputStream contentIS)
-   {
-      this.contentIS = contentIS;
-   }
-
-   public String toString()
-   {
-      StringBuffer buffer = new StringBuffer();
-      buffer.append("names=").append(Arrays.toString(getNames()));
-      // Only add the repositoryNames if it differs from deploymentNames
-      if(getRepositoryNames() != getNames())
-         buffer.append("repositoryNames=").append(Arrays.toString(getRepositoryNames()));
-      buffer.append("phase=").append(phase);
-      buffer.append("copyContent=").append(copyContent);
-      buffer.append("description=").append(description);
-      return buffer.toString();
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload;
+
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.Arrays;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class SerializableDeploymentID implements DeploymentID, Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   /** An InputStream to use to copy the contents */
+   private transient InputStream contentIS;
+   private String[] deploymentNames;
+   private String[] repositoryNames;
+   private DeploymentPhase phase;
+   private String description;
+   private URL contentURL;
+   private boolean copyContent;
+
+   public SerializableDeploymentID(DeploymentID deployment)
+   {
+      this(deployment.getNames(), deployment.getPhase(), deployment.getDescription());
+   }
+   public SerializableDeploymentID(String name, DeploymentPhase phase, String description)
+   {
+      this(new String[]{name}, phase, description);
+   }
+   public SerializableDeploymentID(String[] names, DeploymentPhase phase, String description)
+   {
+      this.deploymentNames = names;
+      this.phase = phase;
+      this.description = description;
+      this.copyContent = true; // by default we copy content
+   }
+
+   public String[] getNames()
+   {
+      return deploymentNames;
+   }
+
+   public String[] getRepositoryNames()
+   {
+      if(repositoryNames == null)
+         repositoryNames = deploymentNames;
+      return repositoryNames;
+   }
+   public void setRepositoryNames(String[] names)
+   {
+      this.repositoryNames = names;
+   }
+   public DeploymentPhase getPhase()
+   {
+      return phase;
+   }
+
+   public String getDescription()
+   {
+      return description;
+   }
+
+   public URL getContentURL()
+   {
+      return contentURL;
+   }
+   public void setContentURL(URL contentURL)
+   {
+      this.contentURL = contentURL;
+   }
+
+   public boolean isCopyContent()
+   {
+      return copyContent;
+   }
+
+   public void setCopyContent(boolean copyContent)
+   {
+      this.copyContent = copyContent;
+   }
+
+   /**
+    * An optional deployment archive content stream for the top-level
+    * deployment.
+    * 
+    * @return the archive input stream if it exists
+    */
+   public InputStream getContentIS()
+   {
+      return contentIS;
+   }
+   /**
+    * 
+    * @param contentIS
+    */
+   public void setContentIS(InputStream contentIS)
+   {
+      this.contentIS = contentIS;
+   }
+
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer();
+      buffer.append("names=").append(Arrays.toString(getNames()));
+      // Only add the repositoryNames if it differs from deploymentNames
+      if(getRepositoryNames() != getNames())
+         buffer.append("repositoryNames=").append(Arrays.toString(getRepositoryNames()));
+      buffer.append("phase=").append(phase);
+      buffer.append("copyContent=").append(copyContent);
+      buffer.append("description=").append(description);
+      return buffer.toString();
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,153 +1,153 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-
-/**
- * Simple javabean impl of DeploymentStatus
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class SerializableDeploymentStatus implements DeploymentStatus,
-      Serializable
-{
-   private static final long serialVersionUID = 1;
-
-   private CommandType command;
-   private Exception failure;
-   private String message;
-   private StateType state;
-   private DeploymentTarget target;
-   private boolean isCompleted;
-   private boolean isFailed;
-   private boolean isRunning;
-
-   public SerializableDeploymentStatus(CommandType command, StateType state)
-   {
-      this.command = command;
-      this.state = state;
-   }
-
-   public CommandType getCommand()
-   {
-      return command;
-   }
-   public void setCommand(CommandType command)
-   {
-      this.command = command;
-   }
-   
-   public DeploymentTarget getTarget()
-   {
-      return target;
-   }
-   public void setTarget(DeploymentTarget target)
-   {
-      this.target = target;
-   }
-
-   public Exception getFailure()
-   {
-      return failure;
-   }
-   public void setFailure(Exception failure)
-   {
-      this.failure = failure;
-   }
-   public String getMessage()
-   {
-      return message;
-   }
-   public void setMessage(String message)
-   {
-      this.message = message;
-   }
-   public StateType getState()
-   {
-      return state;
-   }
-   public void setState(StateType state)
-   {
-      this.state = state;
-   }
-   public boolean isCompleted()
-   {
-      return isCompleted;
-   }
-   public void setCompleted(boolean isCompleted)
-   {
-      this.isCompleted = isCompleted;
-   }
-   public boolean isFailed()
-   {
-      return isFailed;
-   }
-   public void setFailed(boolean isFailed)
-   {
-      this.isFailed = isFailed;
-   }
-   public boolean isRunning()
-   {
-      return isRunning;
-   }
-   public void setRunning(boolean isRunning)
-   {
-      this.isRunning = isRunning;
-   }
-
-   @Override
-   public String toString()
-   {
-      StringBuffer tmp = new StringBuffer("DeploymentStatus(");
-      tmp.append("command=");
-      tmp.append(command);
-      tmp.append(",state=");
-      tmp.append(state);
-      tmp.append(",message=");
-      tmp.append(message);
-      tmp.append(",isCompleted=");
-      tmp.append(isCompleted);
-      tmp.append(",isRunning=");
-      tmp.append(isRunning);
-      tmp.append(",isFailed=");
-      tmp.append(isFailed);
-
-      if(failure != null)
-      {
-         StringWriter sw = new StringWriter();
-         PrintWriter pw = new PrintWriter(sw);
-         failure.printStackTrace(pw);
-         tmp.append(",failure:\n");
-         tmp.append(sw.toString());
-      }
-      tmp.append(")");
-      return tmp.toString();
-   }
-
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload;
+
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringWriter;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+
+/**
+ * Simple javabean impl of DeploymentStatus
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class SerializableDeploymentStatus implements DeploymentStatus,
+      Serializable
+{
+   private static final long serialVersionUID = 1;
+
+   private CommandType command;
+   private Exception failure;
+   private String message;
+   private StateType state;
+   private DeploymentTarget target;
+   private boolean isCompleted;
+   private boolean isFailed;
+   private boolean isRunning;
+
+   public SerializableDeploymentStatus(CommandType command, StateType state)
+   {
+      this.command = command;
+      this.state = state;
+   }
+
+   public CommandType getCommand()
+   {
+      return command;
+   }
+   public void setCommand(CommandType command)
+   {
+      this.command = command;
+   }
+   
+   public DeploymentTarget getTarget()
+   {
+      return target;
+   }
+   public void setTarget(DeploymentTarget target)
+   {
+      this.target = target;
+   }
+
+   public Exception getFailure()
+   {
+      return failure;
+   }
+   public void setFailure(Exception failure)
+   {
+      this.failure = failure;
+   }
+   public String getMessage()
+   {
+      return message;
+   }
+   public void setMessage(String message)
+   {
+      this.message = message;
+   }
+   public StateType getState()
+   {
+      return state;
+   }
+   public void setState(StateType state)
+   {
+      this.state = state;
+   }
+   public boolean isCompleted()
+   {
+      return isCompleted;
+   }
+   public void setCompleted(boolean isCompleted)
+   {
+      this.isCompleted = isCompleted;
+   }
+   public boolean isFailed()
+   {
+      return isFailed;
+   }
+   public void setFailed(boolean isFailed)
+   {
+      this.isFailed = isFailed;
+   }
+   public boolean isRunning()
+   {
+      return isRunning;
+   }
+   public void setRunning(boolean isRunning)
+   {
+      this.isRunning = isRunning;
+   }
+
+   @Override
+   public String toString()
+   {
+      StringBuffer tmp = new StringBuffer("DeploymentStatus(");
+      tmp.append("command=");
+      tmp.append(command);
+      tmp.append(",state=");
+      tmp.append(state);
+      tmp.append(",message=");
+      tmp.append(message);
+      tmp.append(",isCompleted=");
+      tmp.append(isCompleted);
+      tmp.append(",isRunning=");
+      tmp.append(isRunning);
+      tmp.append(",isFailed=");
+      tmp.append(isFailed);
+
+      if(failure != null)
+      {
+         StringWriter sw = new StringWriter();
+         PrintWriter pw = new PrintWriter(sw);
+         failure.printStackTrace(pw);
+         tmp.append(",failure:\n");
+         tmp.append(sw.toString());
+      }
+      tmp.append(")");
+      return tmp.toString();
+   }
+
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/messages.properties
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,291 +1,291 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload.remoting;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Map;
-import javax.management.MBeanServer;
-
-import org.jboss.aop.joinpoint.Invocation;
-import org.jboss.aop.joinpoint.InvocationResponse;
-import org.jboss.aspects.remoting.AOPRemotingInvocationHandler;
-import org.jboss.deployers.client.spi.main.MainDeployer;
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.management.upload.SerializableDeploymentID;
-import org.jboss.profileservice.spi.DeploymentRepository;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.remoting.stream.StreamInvocationHandler;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * A remoting StreamInvocationHandler installed as the profile service subsystem
- * handler and used by the StreamingDeploymentTarget implementation.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class DeployHandler extends AOPRemotingInvocationHandler
-   implements StreamInvocationHandler
-{
-   static Logger log = Logger.getLogger(DeployHandler.class);
-   private DeploymentRepository deploymentRepository;
-   /** The deployment factory */
-   private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
-   private MainDeployer mainDeployer;
-
-
-   public DeploymentRepository getDeploymentRepository()
-   {
-      return deploymentRepository;
-   }
-   public void setDeploymentRepository(DeploymentRepository deploymentRepository)
-   {
-      log.debug("setDeploymentRepository, "+deploymentRepository);
-      this.deploymentRepository = deploymentRepository;
-   }
-
-
-   public VFSDeploymentFactory getDeploymentFactory()
-   {
-      return deploymentFactory;
-   }
-   public void setDeploymentFactory(VFSDeploymentFactory deploymentFactory)
-   {
-      this.deploymentFactory = deploymentFactory;
-   }
-
-   public MainDeployer getMainDeployer()
-   {
-      return mainDeployer;
-   }
-   public void setMainDeployer(MainDeployer mainDeployer)
-   {
-      this.mainDeployer = mainDeployer;
-   }
-   /**
-    * Handle a DeploymentManager distribute invocation
-    * @see DeploymentManager#distribute(String, DeploymentPhase, java.net.URL)
-    * @param request - the remoting invocation
-    */
-   public Object handleStream(InputStream contentIS, InvocationRequest request) throws Throwable
-   {
-      SerializableDeploymentID deploymentTarget = (SerializableDeploymentID) request.getParameter();
-      log.info("Handle stream, deploymentTarget: " + deploymentTarget);
-      deploymentTarget.setContentIS(contentIS);
-      DeploymentPhase phase = deploymentTarget.getPhase();
-      String[] names = deploymentTarget.getNames();
-      String repositoryName = deploymentRepository.addDeploymentContent(names[0], contentIS, phase);
-      log.info("End handle stream, repositoryName: " + repositoryName);
-      String[] rnames = {repositoryName};
-      deploymentTarget.setRepositoryNames(rnames);
-      return new InvocationResponse(repositoryName);
-   }
-
-   public void addListener(InvokerCallbackHandler arg0)
-   {
-   }
-
-   /**
-    * Handle a DeploymentManager invocation other than distribute
-    * @param request - the remoting invocation
-    * @return the result of the invocation
-    */
-   public Object invoke(InvocationRequest request) throws Throwable
-   {
-      Object parameter = request.getParameter();
-      Object returnValue = null;
-
-      if(parameter instanceof Invocation)
-      {
-         returnValue = super.invoke(request);
-      }
-      else
-      {
-         Map payload = request.getRequestPayload();
-         DeploymentID dtID = (DeploymentID) payload.get("DeploymentTargetID");
-         log.debug("invoke, payload: "+payload+", parameter: "+parameter);
-         if( parameter.equals("getRepositoryNames"))
-         {
-            String[] names = (String[]) payload.get("names");
-            DeploymentPhase phase = (DeploymentPhase) payload.get("phase");
-            returnValue = getRepositoryNames(names, phase);
-         }
-         else if( parameter.equals("distribute") )
-         {
-            returnValue = distribute(dtID);
-         }
-         else if( parameter.equals("start") )
-         {
-            start(dtID);
-         }
-         else if( parameter.equals("stop") )
-         {
-            stop(dtID);
-         }
-         else if( parameter.equals("undeploy") )
-         {
-            undeploy(dtID);
-         }
-      }
-      return returnValue;
-   }
-
-   public void removeListener(InvokerCallbackHandler arg0)
-   {
-   }
-
-   public void setInvoker(ServerInvoker arg0)
-   {
-   }
-
-   public void setMBeanServer(MBeanServer arg0)
-   {
-   }
-
-   protected String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-      throws IOException
-   {
-      return deploymentRepository.getRepositoryNames(names, phase);
-   }
-
-   protected String[] distribute(DeploymentID dtID) throws Exception
-   {
-      URL contentURL = dtID.getContentURL();
-      DeploymentPhase phase = dtID.getPhase();
-      log.info("Begin distribute, content url: " + contentURL + ", phase: " + phase);
-      // Prevent hot deployment scans from seeing in transition deployments
-      deploymentRepository.acquireDeploymentContentLock();
-      try
-      {
-         VirtualFile vf = VFS.getRoot(contentURL);
-         VFSDeployment vfsd = createDeployment(vf);
-         deploymentRepository.addDeployment(vfsd.getName(), vfsd, phase);
-         mainDeployer.addDeployment(vfsd);
-         mainDeployer.process();
-         mainDeployer.checkComplete();         
-         String[] rnames = {vfsd.getName()};
-         log.info("End distribute, " + contentURL);
-         return rnames;
-      }
-      finally
-      {
-         deploymentRepository.releaseDeploymentContentLock();
-      }
-   }
-
-   protected void start(DeploymentID dtID) throws Exception
-   {
-      String[] names = dtID.getNames();
-      DeploymentPhase phase = dtID.getPhase();
-      log.info("Begin start, "+Arrays.asList(names) + ", phase: " + phase);
-      // Prevent hot deployment scans from seeing in transition deployments
-      deploymentRepository.acquireDeploymentContentLock();
-      try
-      {
-         for(String name : names)
-         {
-            VirtualFile vf = deploymentRepository.getDeploymentContent(name, phase);
-            VFSDeployment vfsd = createDeployment(vf);
-            deploymentRepository.addDeployment(vfsd.getName(), vfsd, phase);
-            deploymentRepository.unlockDeploymentContent(vf.getPathName(), phase);
-            mainDeployer.addDeployment(vfsd);
-            log.info("Scheduling start for: "+vfsd);
-         }
-         mainDeployer.process();
-         mainDeployer.checkComplete();
-      }
-      finally
-      {
-         deploymentRepository.releaseDeploymentContentLock();
-      }
-      log.info("End start, "+Arrays.asList(names));
-   }
-
-   protected void stop(DeploymentID dtID) throws Exception
-   {
-      String[] names = dtID.getNames();
-      log.info("Stop, "+Arrays.asList(names));
-      deploymentRepository.acquireDeploymentContentLock();
-      try
-      {
-         for(String name : names)
-         {
-            // Obtain the 
-            VFSDeployment vfsd = deploymentRepository.getDeployment(name, dtID.getPhase());
-            // Lock the content to make it unavailable to the deployment scanner
-            String path = vfsd.getRoot().getPathName();
-            deploymentRepository.lockDeploymentContent(path, dtID.getPhase());
-            mainDeployer.removeDeployment(vfsd);
-            log.info("Scheduling stop for: "+vfsd);
-         }
-         mainDeployer.process();
-         mainDeployer.checkComplete();
-      }
-      finally
-      {
-         deploymentRepository.releaseDeploymentContentLock();
-      }
-   }
-
-   protected void undeploy(DeploymentID dtID) throws Exception
-   {
-      String[] names = dtID.getNames();
-      log.info("Undeploy, "+Arrays.asList(names));
-      deploymentRepository.acquireDeploymentContentLock();
-      try
-      {
-         for(String name : names)
-         {
-            deploymentRepository.removeDeployment(name, dtID.getPhase());
-            log.info("Undeployed: "+name);
-         }
-      }
-      finally
-      {
-         deploymentRepository.releaseDeploymentContentLock();
-      }
-   }
-
-   /**
-    * Create a deployment
-    * 
-    * @param file the root file
-    * @return the deployment
-    */
-   protected VFSDeployment createDeployment(VirtualFile file)
-   {
-      if (file == null)
-         throw new IllegalArgumentException("Null file");
-      return deploymentFactory.createVFSDeployment(file);
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload.remoting;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Map;
+import javax.management.MBeanServer;
+
+import org.jboss.aop.joinpoint.Invocation;
+import org.jboss.aop.joinpoint.InvocationResponse;
+import org.jboss.aspects.remoting.AOPRemotingInvocationHandler;
+import org.jboss.deployers.client.spi.main.MainDeployer;
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.management.upload.SerializableDeploymentID;
+import org.jboss.profileservice.spi.DeploymentRepository;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.stream.StreamInvocationHandler;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A remoting StreamInvocationHandler installed as the profile service subsystem
+ * handler and used by the StreamingDeploymentTarget implementation.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DeployHandler extends AOPRemotingInvocationHandler
+   implements StreamInvocationHandler
+{
+   static Logger log = Logger.getLogger(DeployHandler.class);
+   private DeploymentRepository deploymentRepository;
+   /** The deployment factory */
+   private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
+   private MainDeployer mainDeployer;
+
+
+   public DeploymentRepository getDeploymentRepository()
+   {
+      return deploymentRepository;
+   }
+   public void setDeploymentRepository(DeploymentRepository deploymentRepository)
+   {
+      log.debug("setDeploymentRepository, "+deploymentRepository);
+      this.deploymentRepository = deploymentRepository;
+   }
+
+
+   public VFSDeploymentFactory getDeploymentFactory()
+   {
+      return deploymentFactory;
+   }
+   public void setDeploymentFactory(VFSDeploymentFactory deploymentFactory)
+   {
+      this.deploymentFactory = deploymentFactory;
+   }
+
+   public MainDeployer getMainDeployer()
+   {
+      return mainDeployer;
+   }
+   public void setMainDeployer(MainDeployer mainDeployer)
+   {
+      this.mainDeployer = mainDeployer;
+   }
+   /**
+    * Handle a DeploymentManager distribute invocation
+    * @see DeploymentManager#distribute(String, DeploymentPhase, java.net.URL)
+    * @param request - the remoting invocation
+    */
+   public Object handleStream(InputStream contentIS, InvocationRequest request) throws Throwable
+   {
+      SerializableDeploymentID deploymentTarget = (SerializableDeploymentID) request.getParameter();
+      log.info("Handle stream, deploymentTarget: " + deploymentTarget);
+      deploymentTarget.setContentIS(contentIS);
+      DeploymentPhase phase = deploymentTarget.getPhase();
+      String[] names = deploymentTarget.getNames();
+      String repositoryName = deploymentRepository.addDeploymentContent(names[0], contentIS, phase);
+      log.info("End handle stream, repositoryName: " + repositoryName);
+      String[] rnames = {repositoryName};
+      deploymentTarget.setRepositoryNames(rnames);
+      return new InvocationResponse(repositoryName);
+   }
+
+   public void addListener(InvokerCallbackHandler arg0)
+   {
+   }
+
+   /**
+    * Handle a DeploymentManager invocation other than distribute
+    * @param request - the remoting invocation
+    * @return the result of the invocation
+    */
+   public Object invoke(InvocationRequest request) throws Throwable
+   {
+      Object parameter = request.getParameter();
+      Object returnValue = null;
+
+      if(parameter instanceof Invocation)
+      {
+         returnValue = super.invoke(request);
+      }
+      else
+      {
+         Map payload = request.getRequestPayload();
+         DeploymentID dtID = (DeploymentID) payload.get("DeploymentTargetID");
+         log.debug("invoke, payload: "+payload+", parameter: "+parameter);
+         if( parameter.equals("getRepositoryNames"))
+         {
+            String[] names = (String[]) payload.get("names");
+            DeploymentPhase phase = (DeploymentPhase) payload.get("phase");
+            returnValue = getRepositoryNames(names, phase);
+         }
+         else if( parameter.equals("distribute") )
+         {
+            returnValue = distribute(dtID);
+         }
+         else if( parameter.equals("start") )
+         {
+            start(dtID);
+         }
+         else if( parameter.equals("stop") )
+         {
+            stop(dtID);
+         }
+         else if( parameter.equals("undeploy") )
+         {
+            undeploy(dtID);
+         }
+      }
+      return returnValue;
+   }
+
+   public void removeListener(InvokerCallbackHandler arg0)
+   {
+   }
+
+   public void setInvoker(ServerInvoker arg0)
+   {
+   }
+
+   public void setMBeanServer(MBeanServer arg0)
+   {
+   }
+
+   protected String[] getRepositoryNames(String[] names, DeploymentPhase phase)
+      throws IOException
+   {
+      return deploymentRepository.getRepositoryNames(names, phase);
+   }
+
+   protected String[] distribute(DeploymentID dtID) throws Exception
+   {
+      URL contentURL = dtID.getContentURL();
+      DeploymentPhase phase = dtID.getPhase();
+      log.info("Begin distribute, content url: " + contentURL + ", phase: " + phase);
+      // Prevent hot deployment scans from seeing in transition deployments
+      deploymentRepository.acquireDeploymentContentLock();
+      try
+      {
+         VirtualFile vf = VFS.getRoot(contentURL);
+         VFSDeployment vfsd = createDeployment(vf);
+         deploymentRepository.addDeployment(vfsd.getName(), vfsd, phase);
+         mainDeployer.addDeployment(vfsd);
+         mainDeployer.process();
+         mainDeployer.checkComplete();         
+         String[] rnames = {vfsd.getName()};
+         log.info("End distribute, " + contentURL);
+         return rnames;
+      }
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
+   }
+
+   protected void start(DeploymentID dtID) throws Exception
+   {
+      String[] names = dtID.getNames();
+      DeploymentPhase phase = dtID.getPhase();
+      log.info("Begin start, "+Arrays.asList(names) + ", phase: " + phase);
+      // Prevent hot deployment scans from seeing in transition deployments
+      deploymentRepository.acquireDeploymentContentLock();
+      try
+      {
+         for(String name : names)
+         {
+            VirtualFile vf = deploymentRepository.getDeploymentContent(name, phase);
+            VFSDeployment vfsd = createDeployment(vf);
+            deploymentRepository.addDeployment(vfsd.getName(), vfsd, phase);
+            deploymentRepository.unlockDeploymentContent(vf.getPathName(), phase);
+            mainDeployer.addDeployment(vfsd);
+            log.info("Scheduling start for: "+vfsd);
+         }
+         mainDeployer.process();
+         mainDeployer.checkComplete();
+      }
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
+      log.info("End start, "+Arrays.asList(names));
+   }
+
+   protected void stop(DeploymentID dtID) throws Exception
+   {
+      String[] names = dtID.getNames();
+      log.info("Stop, "+Arrays.asList(names));
+      deploymentRepository.acquireDeploymentContentLock();
+      try
+      {
+         for(String name : names)
+         {
+            // Obtain the 
+            VFSDeployment vfsd = deploymentRepository.getDeployment(name, dtID.getPhase());
+            // Lock the content to make it unavailable to the deployment scanner
+            String path = vfsd.getRoot().getPathName();
+            deploymentRepository.lockDeploymentContent(path, dtID.getPhase());
+            mainDeployer.removeDeployment(vfsd);
+            log.info("Scheduling stop for: "+vfsd);
+         }
+         mainDeployer.process();
+         mainDeployer.checkComplete();
+      }
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
+   }
+
+   protected void undeploy(DeploymentID dtID) throws Exception
+   {
+      String[] names = dtID.getNames();
+      log.info("Undeploy, "+Arrays.asList(names));
+      deploymentRepository.acquireDeploymentContentLock();
+      try
+      {
+         for(String name : names)
+         {
+            deploymentRepository.removeDeployment(name, dtID.getPhase());
+            log.info("Undeployed: "+name);
+         }
+      }
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
+   }
+
+   /**
+    * Create a deployment
+    * 
+    * @param file the root file
+    * @return the deployment
+    */
+   protected VFSDeployment createDeployment(VirtualFile file)
+   {
+      if (file == null)
+         throw new IllegalArgumentException("Null file");
+      return deploymentFactory.createVFSDeployment(file);
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,297 +1,297 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload.remoting;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.aop.joinpoint.InvocationResponse;
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.management.upload.SerializableDeploymentID;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-
-/**
- * An implementation of DeploymentTarget that uses remoting for streaming
- * content in distribute, and basic rpc for the other methods.
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class StreamingDeploymentTarget
-   implements DeploymentTarget, Serializable
-{
-   private static final long serialVersionUID = 1;
-   private static final Logger log = Logger.getLogger(StreamingDeploymentTarget.class);
-
-   /** The deployment target locator */
-   private InvokerLocator locator;
-   private String name;
-   private String subsystem;
-
-   /**
-    * Create a target given a remoting locator 
-    * @param locator -
-    * @param name - 
-    * @param subsystem - 
-    */
-   public StreamingDeploymentTarget(InvokerLocator locator, String name, String subsystem)
-   {
-      log.debug("new StreamingTarget: " + locator);
-      this.name = name;
-      this.subsystem = subsystem;
-      this.locator = locator;
-   }
-   
-   public String getDescription()
-   {
-      return name + "(" + locator + ")";
-   }
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public InvokerLocator getInvokerLocator()
-   {
-      return locator;
-   }
-
-   /**
-    * Distribute a deployment to the profile targets.
-    *
-    * @param deployment - the encapsulation of the deployment to distribute
-    * @throws Exception for any error
-    */
-   public void distribute(DeploymentID deployment) throws Exception
-   {
-      Client client = getClient();
-      try
-      {
-         log.debug("Begin distribute: " + deployment);
-         String[] rnames;
-         if (deployment.isCopyContent())
-         {
-            URL contentURL = deployment.getContentURL();
-            SerializableDeploymentID sdtID = new SerializableDeploymentID(deployment);
-            InputStream contentIS = contentURL.openStream();
-            sdtID.setContentIS(contentIS);
-            String repositoryName = transferDeployment(client, sdtID);
-            rnames = new String[]{repositoryName};
-         }
-         else
-         {
-            rnames = (String[])invoke(client, "distribute", createArgs(deployment));
-         }
-         // Update the repository names on the deployment
-         deployment.setRepositoryNames(rnames);
-         log.debug("End distribute, repositoryNames: "+ Arrays.asList(rnames));
-      }
-      finally
-      {
-         client.disconnect();
-      }
-   }
-
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
-   {
-      Client client = getClient();
-      try
-      {
-         log.debug("Begin getRepositoryNames: " + Arrays.asList(names));
-         HashMap<Object, Object> args = new HashMap<Object, Object>();
-         args.put("names", names);
-         args.put("phase", phase);
-         String[] rnames = (String[]) invoke(client, "getRepositoryNames", args);
-         log.debug("End getRepositoryNames: " + Arrays.asList(rnames));
-         return rnames;
-      }
-      finally
-      {
-         client.disconnect();
-      }
-   }
-
-   public void redeploy(DeploymentID deployment) throws Exception
-   {
-      throw new IllegalStateException("redeploy is not yet implemented");
-   }
-
-   public void prepare(DeploymentID deployment) throws Exception
-   {
-      throw new IllegalStateException("prepare is not yet implemented");
-   }
-
-   /**
-    * Create the client args.
-    *
-    * @param dtID the deployment id
-    * @return args map
-    */
-   protected Map<?, ?> createArgs(DeploymentID dtID)
-   {
-      return new HashMap<Object, Object>(Collections.singletonMap("DeploymentTargetID", dtID));
-   }
-
-   /**
-    * Start a given deployment(s)
-    */
-   public void start(DeploymentID dtID) throws Exception
-   {
-      Client client = getClient();
-      try
-      {
-         log.debug("Start: " + dtID);
-         invoke(client, "start", createArgs(dtID));
-         log.debug("End start: "+dtID);
-      }
-      finally
-      {
-         client.disconnect();
-      }
-   }
-
-   /**
-    * Stop a given module
-    */
-   public void stop(DeploymentID dtID) throws Exception
-   {
-      Client client = getClient();
-      try
-      {
-         log.debug("Begin stop: " + dtID);
-         invoke(client, "stop", createArgs(dtID));
-         log.debug("End stop");
-      }
-      finally
-      {
-         client.disconnect();
-      }
-   }
-
-   /**
-    * Undeploy a given module
-    */
-   public void undeploy(DeploymentID dtID) throws Exception
-   {
-      Client client = getClient();
-      try
-      {
-         log.debug("Begin undeploy: " + dtID);
-         invoke(client, "undeploy", createArgs(dtID));
-         log.debug("End undeploy");
-      }
-      finally
-      {
-         client.disconnect();
-      }
-   }
-
-   public String toString()
-   {
-      StringBuilder tmp = new StringBuilder();
-      tmp.append("name=");
-      tmp.append(name);
-      tmp.append(",locator=");
-      tmp.append(locator);
-      tmp.append(",subsystem=");
-      tmp.append(subsystem);
-      return tmp.toString();
-   }
-
-   /**
-    * Get the remoting client connection
-    * @return
-    * @throws Exception
-    */
-   private Client getClient() throws Exception
-   {
-      log.debug("Calling remoting server with locator of: " + locator);
-
-      Client remotingClient = new Client(locator, subsystem);
-      remotingClient.connect();
-      return remotingClient;
-   }
-
-   /**
-    * Stream a deployment to the server
-    * 
-    * @param client - the remoting client
-    * @param sdtID - the deployment content encapsulation
-    * @return the profile service repository unique name
-    * @throws Exception
-    */
-   private String transferDeployment(Client client, SerializableDeploymentID sdtID) throws Exception
-   {
-      InputStream is = sdtID.getContentIS();
-      try
-      {
-         // This return value depends on the proxy type
-         InvocationResponse response = (InvocationResponse) client.invoke(is, sdtID);
-         return (String) response.getResponse();
-      }
-      catch(Error e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch(Throwable e)
-      {
-         throw new RuntimeException(e);         
-      }
-      finally
-      {
-         try
-         {
-            is.close();
-         }
-         catch (IOException ignored)
-         {
-         }
-      }
-   }
-
-   private Object invoke(Client client, String name, Map<?, ?> args) throws Exception
-   {
-      try
-      {
-         return client.invoke(name, args);
-      }
-      catch(Error e)
-      {
-         throw new RuntimeException(e);
-      }
-      catch(Throwable e)
-      {
-         throw new RuntimeException(e);
-      }      
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.upload.remoting;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.aop.joinpoint.InvocationResponse;
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.management.upload.SerializableDeploymentID;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+
+/**
+ * An implementation of DeploymentTarget that uses remoting for streaming
+ * content in distribute, and basic rpc for the other methods.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class StreamingDeploymentTarget
+   implements DeploymentTarget, Serializable
+{
+   private static final long serialVersionUID = 1;
+   private static final Logger log = Logger.getLogger(StreamingDeploymentTarget.class);
+
+   /** The deployment target locator */
+   private InvokerLocator locator;
+   private String name;
+   private String subsystem;
+
+   /**
+    * Create a target given a remoting locator 
+    * @param locator -
+    * @param name - 
+    * @param subsystem - 
+    */
+   public StreamingDeploymentTarget(InvokerLocator locator, String name, String subsystem)
+   {
+      log.debug("new StreamingTarget: " + locator);
+      this.name = name;
+      this.subsystem = subsystem;
+      this.locator = locator;
+   }
+   
+   public String getDescription()
+   {
+      return name + "(" + locator + ")";
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public InvokerLocator getInvokerLocator()
+   {
+      return locator;
+   }
+
+   /**
+    * Distribute a deployment to the profile targets.
+    *
+    * @param deployment - the encapsulation of the deployment to distribute
+    * @throws Exception for any error
+    */
+   public void distribute(DeploymentID deployment) throws Exception
+   {
+      Client client = getClient();
+      try
+      {
+         log.debug("Begin distribute: " + deployment);
+         String[] rnames;
+         if (deployment.isCopyContent())
+         {
+            URL contentURL = deployment.getContentURL();
+            SerializableDeploymentID sdtID = new SerializableDeploymentID(deployment);
+            InputStream contentIS = contentURL.openStream();
+            sdtID.setContentIS(contentIS);
+            String repositoryName = transferDeployment(client, sdtID);
+            rnames = new String[]{repositoryName};
+         }
+         else
+         {
+            rnames = (String[])invoke(client, "distribute", createArgs(deployment));
+         }
+         // Update the repository names on the deployment
+         deployment.setRepositoryNames(rnames);
+         log.debug("End distribute, repositoryNames: "+ Arrays.asList(rnames));
+      }
+      finally
+      {
+         client.disconnect();
+      }
+   }
+
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
+   {
+      Client client = getClient();
+      try
+      {
+         log.debug("Begin getRepositoryNames: " + Arrays.asList(names));
+         HashMap<Object, Object> args = new HashMap<Object, Object>();
+         args.put("names", names);
+         args.put("phase", phase);
+         String[] rnames = (String[]) invoke(client, "getRepositoryNames", args);
+         log.debug("End getRepositoryNames: " + Arrays.asList(rnames));
+         return rnames;
+      }
+      finally
+      {
+         client.disconnect();
+      }
+   }
+
+   public void redeploy(DeploymentID deployment) throws Exception
+   {
+      throw new IllegalStateException("redeploy is not yet implemented");
+   }
+
+   public void prepare(DeploymentID deployment) throws Exception
+   {
+      throw new IllegalStateException("prepare is not yet implemented");
+   }
+
+   /**
+    * Create the client args.
+    *
+    * @param dtID the deployment id
+    * @return args map
+    */
+   protected Map<?, ?> createArgs(DeploymentID dtID)
+   {
+      return new HashMap<Object, Object>(Collections.singletonMap("DeploymentTargetID", dtID));
+   }
+
+   /**
+    * Start a given deployment(s)
+    */
+   public void start(DeploymentID dtID) throws Exception
+   {
+      Client client = getClient();
+      try
+      {
+         log.debug("Start: " + dtID);
+         invoke(client, "start", createArgs(dtID));
+         log.debug("End start: "+dtID);
+      }
+      finally
+      {
+         client.disconnect();
+      }
+   }
+
+   /**
+    * Stop a given module
+    */
+   public void stop(DeploymentID dtID) throws Exception
+   {
+      Client client = getClient();
+      try
+      {
+         log.debug("Begin stop: " + dtID);
+         invoke(client, "stop", createArgs(dtID));
+         log.debug("End stop");
+      }
+      finally
+      {
+         client.disconnect();
+      }
+   }
+
+   /**
+    * Undeploy a given module
+    */
+   public void undeploy(DeploymentID dtID) throws Exception
+   {
+      Client client = getClient();
+      try
+      {
+         log.debug("Begin undeploy: " + dtID);
+         invoke(client, "undeploy", createArgs(dtID));
+         log.debug("End undeploy");
+      }
+      finally
+      {
+         client.disconnect();
+      }
+   }
+
+   public String toString()
+   {
+      StringBuilder tmp = new StringBuilder();
+      tmp.append("name=");
+      tmp.append(name);
+      tmp.append(",locator=");
+      tmp.append(locator);
+      tmp.append(",subsystem=");
+      tmp.append(subsystem);
+      return tmp.toString();
+   }
+
+   /**
+    * Get the remoting client connection
+    * @return
+    * @throws Exception
+    */
+   private Client getClient() throws Exception
+   {
+      log.debug("Calling remoting server with locator of: " + locator);
+
+      Client remotingClient = new Client(locator, subsystem);
+      remotingClient.connect();
+      return remotingClient;
+   }
+
+   /**
+    * Stream a deployment to the server
+    * 
+    * @param client - the remoting client
+    * @param sdtID - the deployment content encapsulation
+    * @return the profile service repository unique name
+    * @throws Exception
+    */
+   private String transferDeployment(Client client, SerializableDeploymentID sdtID) throws Exception
+   {
+      InputStream is = sdtID.getContentIS();
+      try
+      {
+         // This return value depends on the proxy type
+         InvocationResponse response = (InvocationResponse) client.invoke(is, sdtID);
+         return (String) response.getResponse();
+      }
+      catch(Error e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch(Throwable e)
+      {
+         throw new RuntimeException(e);         
+      }
+      finally
+      {
+         try
+         {
+            is.close();
+         }
+         catch (IOException ignored)
+         {
+         }
+      }
+   }
+
+   private Object invoke(Client client, String name, Map<?, ?> args) throws Exception
+   {
+      try
+      {
+         return client.invoke(name, args);
+      }
+      catch(Error e)
+      {
+         throw new RuntimeException(e);
+      }
+      catch(Throwable e)
+      {
+         throw new RuntimeException(e);
+      }      
+   }
+}


Property changes on: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/src/resources/profileservice-hdscanner-jboss-beans.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/profileservice/src/test/main/org/jboss/test/ps/SerializableDeploymentRepositoryUnitTest.java
===================================================================
--- trunk/profileservice/src/test/main/org/jboss/test/ps/SerializableDeploymentRepositoryUnitTest.java	2008-11-14 15:09:16 UTC (rev 81065)
+++ trunk/profileservice/src/test/main/org/jboss/test/ps/SerializableDeploymentRepositoryUnitTest.java	2008-11-14 15:10:09 UTC (rev 81066)
@@ -1,144 +1,144 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ps;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.logging.Logger;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.AttachmentsSerializer;
-import org.jboss.profileservice.spi.DeploymentContentFlags;
-import org.jboss.profileservice.spi.ModificationInfo;
-import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.system.server.profileservice.repository.JavaSerializationAttachmentsSerializer;
-import org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository;
-
-
-/**
- * Tests of the SerializableDeploymentRepository implementation details.
- * 
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class SerializableDeploymentRepositoryUnitTest
-   extends TestCase
-{
-   private static Logger log = Logger.getLogger(SerializableDeploymentRepositoryUnitTest.class);
-
-   public SerializableDeploymentRepositoryUnitTest(String name)
-   {
-      super(name);
-   }
-
-   /**
-    * Test the behavior of the {@link DeploymentContentFlags#LOCKED} flag
-    * @throws Exception
-    */
-   public void testDeploymentContentFlagsLocked()
-      throws Exception
-   {
-      File root = getServerRoot();
-      URI[] appURIs = {root.toURI().resolve("default/deploy")};
-      ProfileKey key = new ProfileKey("default");
-      log.info("Creating SDR with root: "+root+", appURI: "+appURIs[0]);
-      SerializableDeploymentRepository sdr = new SerializableDeploymentRepository(root, appURIs, key);
-      AttachmentsSerializer serializer = new JavaSerializationAttachmentsSerializer();
-      sdr.setSerializer(serializer);
-      sdr.load();
-
-      log.info("DeploymentNames: "+sdr.getDeploymentNames());
-      // Validate we can get the ROOT.war
-      VFSDeployment rootWar = sdr.getDeployment("ROOT.war", DeploymentPhase.APPLICATION);
-      assertNotNull("deploy/ROOT.war", rootWar);
-
-      // Modify the ROOT.war
-      URI warURI = rootWar.getRoot().toURI();
-      File warFile = new File(warURI.getPath());
-      warFile.setLastModified(System.currentTimeMillis());
-      // Check its flags
-      int flags = sdr.getDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION);
-      assertEquals("ROOT.war flags", 0, flags);
-
-      // Validate the ROOT.war is in the modified deployments
-      Collection<ModificationInfo> mods = sdr.getModifiedDeployments();
-      assertEquals("Collection<ModificationInfo> size is 1", 1, mods.size());
-      ModificationInfo warMods = mods.iterator().next();
-      assertEquals("ModificationInfo.status is MODIFIED", ModificationInfo.ModifyStatus.MODIFIED, warMods.getStatus());
-      assertEquals("ModificationInfo.name is ROOT.war", "ROOT.war", warMods.getDeployment().getSimpleName());
-
-      // lock the war
-      flags = sdr.setDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION,
-            DeploymentContentFlags.LOCKED);
-      assertEquals(flags, DeploymentContentFlags.LOCKED);
-      warFile.setLastModified(System.currentTimeMillis()+1000);
-      // It should be modified, but not show up in the mods
-      assertTrue("vfsfile ROOT.war hasBeenModified", rootWar.getRoot().hasBeenModified());
-      mods = sdr.getModifiedDeployments();
-      assertEquals("Collection<ModificationInfo> size is 0", 0, mods.size());
-
-      // Validate that the locked flag overrides the modified flag
-      assertFalse("vfsfile ROOT.war hasBeenModified", rootWar.getRoot().hasBeenModified());
-      flags = DeploymentContentFlags.LOCKED | DeploymentContentFlags.MODIFIED;
-      sdr.setDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION, flags);
-      mods = sdr.getModifiedDeployments();
-      assertEquals("Collection<ModificationInfo> size is 0", 0, mods.size());
-
-      // Validate that the modified flag allows it to show
-      flags = sdr.clearDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION,
-            DeploymentContentFlags.LOCKED);
-      assertEquals("ROOT.war has MODIFIED flag", flags, DeploymentContentFlags.MODIFIED);
-      mods = sdr.getModifiedDeployments();
-      assertEquals("Collection<ModificationInfo> size is 1", 1, mods.size());
-      warMods = mods.iterator().next();
-      assertEquals("ModificationInfo.status is MODIFIED", ModificationInfo.ModifyStatus.MODIFIED, warMods.getStatus());
-      assertEquals("ModificationInfo.name is ROOT.war", "ROOT.war", warMods.getDeployment().getSimpleName());
-   }
-
-   /**
-    * Get the file for the jboss server directory. Relies on one
-    * of the following variables to be set:
-    * JBOSS_HOME env variable
-    * jboss.home system property
-    * 
-    * @return
-    * @throws IOException 
-    */
-   protected File getServerRoot() throws IOException
-   {
-      String home = System.getenv("JBOSS_HOME");
-      if(home == null)
-      {
-         home = System.getProperty("jboss.home");
-      }
-      File defaultDir = new File(home, "server");
-      if(defaultDir.exists() == false)
-         throw new FileNotFoundException(defaultDir.getAbsolutePath()+", check the JBOSS_HOME env variable or jboss.home system property");
-      return defaultDir;
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ps;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Collection;
+
+import junit.framework.TestCase;
+
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.spi.AttachmentsSerializer;
+import org.jboss.profileservice.spi.DeploymentContentFlags;
+import org.jboss.profileservice.spi.ModificationInfo;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.system.server.profileservice.repository.JavaSerializationAttachmentsSerializer;
+import org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository;
+
+
+/**
+ * Tests of the SerializableDeploymentRepository implementation details.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class SerializableDeploymentRepositoryUnitTest
+   extends TestCase
+{
+   private static Logger log = Logger.getLogger(SerializableDeploymentRepositoryUnitTest.class);
+
+   public SerializableDeploymentRepositoryUnitTest(String name)
+   {
+      super(name);
+   }
+
+   /**
+    * Test the behavior of the {@link DeploymentContentFlags#LOCKED} flag
+    * @throws Exception
+    */
+   public void testDeploymentContentFlagsLocked()
+      throws Exception
+   {
+      File root = getServerRoot();
+      URI[] appURIs = {root.toURI().resolve("default/deploy")};
+      ProfileKey key = new ProfileKey("default");
+      log.info("Creating SDR with root: "+root+", appURI: "+appURIs[0]);
+      SerializableDeploymentRepository sdr = new SerializableDeploymentRepository(root, appURIs, key);
+      AttachmentsSerializer serializer = new JavaSerializationAttachmentsSerializer();
+      sdr.setSerializer(serializer);
+      sdr.load();
+
+      log.info("DeploymentNames: "+sdr.getDeploymentNames());
+      // Validate we can get the ROOT.war
+      VFSDeployment rootWar = sdr.getDeployment("ROOT.war", DeploymentPhase.APPLICATION);
+      assertNotNull("deploy/ROOT.war", rootWar);
+
+      // Modify the ROOT.war
+      URI warURI = rootWar.getRoot().toURI();
+      File warFile = new File(warURI.getPath());
+      warFile.setLastModified(System.currentTimeMillis());
+      // Check its flags
+      int flags = sdr.getDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION);
+      assertEquals("ROOT.war flags", 0, flags);
+
+      // Validate the ROOT.war is in the modified deployments
+      Collection<ModificationInfo> mods = sdr.getModifiedDeployments();
+      assertEquals("Collection<ModificationInfo> size is 1", 1, mods.size());
+      ModificationInfo warMods = mods.iterator().next();
+      assertEquals("ModificationInfo.status is MODIFIED", ModificationInfo.ModifyStatus.MODIFIED, warMods.getStatus());
+      assertEquals("ModificationInfo.name is ROOT.war", "ROOT.war", warMods.getDeployment().getSimpleName());
+
+      // lock the war
+      flags = sdr.setDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION,
+            DeploymentContentFlags.LOCKED);
+      assertEquals(flags, DeploymentContentFlags.LOCKED);
+      warFile.setLastModified(System.currentTimeMillis()+1000);
+      // It should be modified, but not show up in the mods
+      assertTrue("vfsfile ROOT.war hasBeenModified", rootWar.getRoot().hasBeenModified());
+      mods = sdr.getModifiedDeployments();
+      assertEquals("Collection<ModificationInfo> size is 0", 0, mods.size());
+
+      // Validate that the locked flag overrides the modified flag
+      assertFalse("vfsfile ROOT.war hasBeenModified", rootWar.getRoot().hasBeenModified());
+      flags = DeploymentContentFlags.LOCKED | DeploymentContentFlags.MODIFIED;
+      sdr.setDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION, flags);
+      mods = sdr.getModifiedDeployments();
+      assertEquals("Collection<ModificationInfo> size is 0", 0, mods.size());
+
+      // Validate that the modified flag allows it to show
+      flags = sdr.clearDeploymentContentFlags("ROOT.war", DeploymentPhase.APPLICATION,
+            DeploymentContentFlags.LOCKED);
+      assertEquals("ROOT.war has MODIFIED flag", flags, DeploymentContentFlags.MODIFIED);
+      mods = sdr.getModifiedDeployments();
+      assertEquals("Collection<ModificationInfo> size is 1", 1, mods.size());
+      warMods = mods.iterator().next();
+      assertEquals("ModificationInfo.status is MODIFIED", ModificationInfo.ModifyStatus.MODIFIED, warMods.getStatus());
+      assertEquals("ModificationInfo.name is ROOT.war", "ROOT.war", warMods.getDeployment().getSimpleName());
+   }
+
+   /**
+    * Get the file for the jboss server directory. Relies on one
+    * of the following variables to be set:
+    * JBOSS_HOME env variable
+    * jboss.home system property
+    * 
+    * @return
+    * @throws IOException 
+    */
+   protected File getServerRoot() throws IOException
+   {
+      String home = System.getenv("JBOSS_HOME");
+      if(home == null)
+      {
+         home = System.getProperty("jboss.home");
+      }
+      File defaultDir = new File(home, "server");
+      if(defaultDir.exists() == false)
+         throw new FileNotFoundException(defaultDir.getAbsolutePath()+", check the JBOSS_HOME env variable or jboss.home system property");
+      return defaultDir;
+   }
+}


Property changes on: trunk/profileservice/src/test/main/org/jboss/test/ps/SerializableDeploymentRepositoryUnitTest.java
___________________________________________________________________
Name: svn:eol-style
   + native


Property changes on: trunk/profileservice/src/test/resources/log4j.properties
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list