[jboss-cvs] JBossAS SVN: r57742 - tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 19 17:40:23 EDT 2006


Author: ryan.campbell at jboss.com
Date: 2006-10-19 17:40:23 -0400 (Thu, 19 Oct 2006)
New Revision: 57742

Modified:
   tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java
   tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetCommand.java
Log:
remove changes to release tag.  Releases should be frozen.

Modified: tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java
===================================================================
--- tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java	2006-10-19 20:53:57 UTC (rev 57741)
+++ tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetAttrsCommand.java	2006-10-19 21:40:23 UTC (rev 57742)
@@ -1,24 +1,11 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- */
+/***************************************
+ *                                     *
+ *  JBoss: The OpenSource J2EE WebOS   *
+ *                                     *
+ *  Distributable under LGPL license.  *
+ *  See terms of license at gnu.org.   *
+ *                                     *
+ ***************************************/
 
 package org.jboss.console.twiddle.command;
 
@@ -53,7 +40,6 @@
 
    /** List<String>. Contains names and values */
    private List attributeNames = new ArrayList(5);
-   private boolean prefix = true;
 
 
    public SetAttrsCommand()
@@ -105,36 +91,35 @@
                throw new CommandException
                   ("Option requires an argument: " + args[getopt.getOptind() - 1]);
 
-			case '?':
-        	{
-				String arg = args[getopt.getOptind() - 1];
+            case '?':
+               throw new CommandException
+                  ("Invalid (or ambiguous) option: " + args[getopt.getOptind() - 1]);
 
-				argidx=setArgValues(argidx,arg);
+            case 0x1000:
+               break;
+                  
+               // non-option arguments
+            case 1:
+               {
+                  String arg = getopt.getOptarg();
 
-				break;
+                  switch (argidx++)
+                  {
+                     case 0:
+                        objectName = createObjectName(arg);
+                        log.debug("mbean name: " + objectName);
+                        break;
 
-				
-        	}
+                     default:
+                        log.debug("adding attribute name: " + arg);
+                        attributeNames.add(arg);
+                        break;
+                  }
+                  break;
+               }
+         }
+      }
 
-			case 0x1000:
-				prefix = false;
-				break;
-              
-				// non-option arguments
-			case 1:
-				{
-					String arg = getopt.getOptarg();
-					
-					argidx=setArgValues(argidx,arg);
-
-					break;
-				}
-		}
-		
-		
-	}
-
-
       return true;
    }
 
@@ -204,27 +189,4 @@
       }
       return null;
    }
-   
-  //Channge is made to set all possible arguments to MBean
-   
-   private int setArgValues(int argdixValue, String argValue) throws CommandException{
-	   
-	   switch (argdixValue++)
-		{
-			case 0:
-				objectName = createObjectName(argValue);
-				log.debug("mbean name: " + objectName);
-				break;
-
-			default:
-				log.debug("adding attribute name: " + argValue);
-				attributeNames.add(argValue);
-				break;
-		}
-	   
-	   return argdixValue;
-	   
-   }
 }
-
-

Modified: tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetCommand.java
===================================================================
--- tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetCommand.java	2006-10-19 20:53:57 UTC (rev 57741)
+++ tags/JBoss_4_0_3_SP1/console/src/main/org/jboss/console/twiddle/command/SetCommand.java	2006-10-19 21:40:23 UTC (rev 57742)
@@ -1,24 +1,11 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.
- */
+/***************************************
+ *                                     *
+ *  JBoss: The OpenSource J2EE WebOS   *
+ *                                     *
+ *  Distributable under LGPL license.  *
+ *  See terms of license at gnu.org.   *
+ *                                     *
+ ***************************************/
 package org.jboss.console.twiddle.command;
 
 import gnu.getopt.Getopt;
@@ -105,16 +92,9 @@
 						("Option requires an argument: " + args[getopt.getOptind() - 1]);
 
 				case '?':
-            	{
-					String arg = args[getopt.getOptind() - 1];
+					throw new CommandException
+						("Invalid (or ambiguous) option: " + args[getopt.getOptind() - 1]);
 
-					argidx=setArgValues(argidx,arg);
-
-					break;
-
-					
-            	}
-
 				case 0x1000:
 					prefix = false;
 					break;
@@ -123,20 +103,26 @@
 				case 1:
 					{
 						String arg = getopt.getOptarg();
-						
-						argidx=setArgValues(argidx,arg);
 
+						switch (argidx++)
+						{
+							case 0:
+								objectName = createObjectName(arg);
+								log.debug("mbean name: " + objectName);
+								break;
+
+							default:
+								log.debug("adding attribute name: " + arg);
+								attributeNames.add(arg);
+								break;
+						}
 						break;
 					}
 			}
-			
-			
 		}
 
 		return true;
 	}
-	
-	
    
 
    public void execute(String[] args) throws Exception
@@ -162,8 +148,6 @@
 		MBeanAttributeInfo[] attrs = info.getAttributes();
 		
 		MBeanAttributeInfo attr=null;
-		
-//		System.out.println("I am here shak's msg");
 
 		boolean found = false;
 		for (int i=0;i < attrs.length ; i++ ) 
@@ -204,28 +188,7 @@
 		
 
    }
-   
-   //Channge is made to set all possible arguments to MBean
-   
-   private int setArgValues(int argdixValue, String argValue) throws CommandException{
-	   
-	   switch (argdixValue++)
-		{
-			case 0:
-				objectName = createObjectName(argValue);
-				log.debug("mbean name: " + objectName);
-				break;
 
-			default:
-				log.debug("adding attribute name: " + argValue);
-				attributeNames.add(argValue);
-				break;
-		}
-	   
-	   return argdixValue;
-	   
-   }
-
 	/**
 	 * Convert val into an Object of type type
 	 * @param val The given value




More information about the jboss-cvs-commits mailing list