[jboss-cvs] jboss-seam/src/main/org/jboss/seam/init ...

Gavin King gavin.king at jboss.com
Wed Jun 20 17:12:46 EDT 2007


  User: gavin   
  Date: 07/06/20 17:12:46

  Modified:    src/main/org/jboss/seam/init        
                        ComponentDescriptor.java DependencyManager.java
                        FactoryDescriptor.java GroovyHotRedeployable.java
                        JavaHotRedeployable.java NamespaceDescriptor.java
                        NoHotRedeployable.java RedeployableStrategy.java
  Log:
  minor
  
  Revision  Changes    Path
  1.3       +1 -1      jboss-seam/src/main/org/jboss/seam/init/ComponentDescriptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ComponentDescriptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/ComponentDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- ComponentDescriptor.java	4 May 2007 11:31:36 -0000	1.2
  +++ ComponentDescriptor.java	20 Jun 2007 21:12:46 -0000	1.3
  @@ -9,7 +9,7 @@
   import org.jboss.seam.core.Init;
   import org.jboss.seam.servlet.AbstractResource;
   
  -public class ComponentDescriptor 
  +class ComponentDescriptor 
       implements Comparable<ComponentDescriptor>
   {
       protected String name;
  
  
  
  1.3       +100 -49   jboss-seam/src/main/org/jboss/seam/init/DependencyManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DependencyManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/DependencyManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- DependencyManager.java	12 Mar 2007 06:12:22 -0000	1.2
  +++ DependencyManager.java	20 Jun 2007 21:12:46 -0000	1.3
  @@ -7,27 +7,34 @@
   import java.util.Set;
   import java.util.TreeSet;
   
  -public class DependencyManager {
  +class DependencyManager 
  +{
       private Map<String, Set<ComponentDescriptor>> componentDescriptors;
       private Set<ComponentDescriptor> currentTestSet;
       private Set<ComponentDescriptor> installedSet;
   
  -    public DependencyManager(Map<String, Set<ComponentDescriptor>> componentDescriptors) {        
  +    public DependencyManager(Map<String, Set<ComponentDescriptor>> componentDescriptors) 
  +    {
           this.componentDescriptors = new HashMap<String, Set<ComponentDescriptor>>(componentDescriptors);
       }
       
       
  -    public Set<ComponentDescriptor> installedSet() {            
  +    public Set<ComponentDescriptor> installedSet()
  +    {
           computeInstallSet();
           return installedSet;        
       }
       
       private static final Comparator<ComponentDescriptor> ORDER = new Comparator<ComponentDescriptor>() 
       { 
  -       public int compare(ComponentDescriptor x, ComponentDescriptor y) { return x.getName().compareTo( y.getName() ); } 
  +       public int compare(ComponentDescriptor x, ComponentDescriptor y) 
  +       { 
  +          return x.getName().compareTo( y.getName() ); 
  +       } 
       };
           
  -    private void computeInstallSet() {
  +    private void computeInstallSet() 
  +    {
           installedSet = new TreeSet<ComponentDescriptor>(ORDER);
           Set<String> keys = componentDescriptors.keySet();
           for (String key: keys) {
  @@ -41,30 +48,37 @@
           }        
       }
       
  -    private boolean tryToInstall(String key) {       
  +    private boolean tryToInstall(String key) 
  +    {
           Set<ComponentDescriptor> descriptors = componentDescriptors.get(key);
  -        if (descriptors == null) {
  +        if (descriptors == null) 
  +        {
               return false;
           }
           
  -        for (ComponentDescriptor descriptor : descriptors) {
  +        for (ComponentDescriptor descriptor : descriptors) 
  +        {
               
               Set<ComponentDescriptor> saved = new HashSet<ComponentDescriptor>(currentTestSet);
  -            if (tryToInstall(descriptor)) {                
  +            if (tryToInstall(descriptor)) 
  +            {                
                   return true;
  -            } else {               
  +            } 
  +            else 
  +            {               
                   currentTestSet = saved;
               }
               
  -            
           }            
           
           return false;
       }
       
   
  -    private boolean tryToInstall(ComponentDescriptor descriptor) {        
  -        if (isInInstallSet(descriptor.getName())) {            
  +    private boolean tryToInstall(ComponentDescriptor descriptor) 
  +    {        
  +        if (isInInstallSet(descriptor.getName())) 
  +        {            
               return true;
           }
           
  @@ -73,7 +87,8 @@
           return checkAllDependencies(descriptor);
       }
       
  -    private boolean checkAllDependencies(ComponentDescriptor descriptor) {
  +    private boolean checkAllDependencies(ComponentDescriptor descriptor) 
  +    {
           return descriptor.isInstalled() &&
                  checkClassDependencies(descriptor) &&
                  checkComponentDependencies(descriptor) &&
  @@ -81,14 +96,18 @@
       }
       
       
  -    private boolean checkComponentDependencies(ComponentDescriptor descriptor) {
  +    private boolean checkComponentDependencies(ComponentDescriptor descriptor) 
  +    {
           String[] dependencies = descriptor.getDependencies();
  -        if (dependencies == null) { 
  +        if (dependencies == null) 
  +        { 
              return true;
           }
           
  -        for (String componentName: dependencies) {
  -            if (!tryToInstall(componentName)) {
  +        for (String componentName: dependencies) 
  +        {
  +            if (!tryToInstall(componentName)) 
  +            {
                   return false;
               }
           }
  @@ -97,17 +116,23 @@
       }
   
   
  -    private boolean checkClassDependencies(ComponentDescriptor descriptor) {
  +    private boolean checkClassDependencies(ComponentDescriptor descriptor) 
  +    {
           String[] classDependencies = descriptor.getClassDependencies();
           
  -        if (classDependencies == null) {
  +        if (classDependencies == null) 
  +        {
               return true;   
           }
               
  -        for (String className: classDependencies) {   
  -            try {   
  +        for (String className: classDependencies) 
  +        {   
  +            try 
  +            {   
                   descriptor.getComponentClass().getClassLoader().loadClass(className);
  -            } catch (Exception e){
  +            } 
  +            catch (Exception e)
  +            {
                   return false;                 
               }
           }
  @@ -115,17 +140,22 @@
           return true;
       }
       
  -    private boolean checkGenericDependencies(ComponentDescriptor descriptor) {
  +    private boolean checkGenericDependencies(ComponentDescriptor descriptor) 
  +    {
           Class[] dependencies = descriptor.getGenericDependencies();
  -        if (dependencies == null) {
  +        if (dependencies == null) 
  +        {
               return true;
           }
           
  -        for (Class dependency: dependencies) {
  -            if (!isInInstallSet(dependency)) {                                
  +        for (Class dependency: dependencies) 
  +        {
  +            if (!isInInstallSet(dependency)) 
  +            {                                
                   Set<String> searchList = findPotentialComponents(dependency);
                                  
  -                if (!tryToSatisfyDependencyUsing(dependency, searchList)) {
  +                if (!tryToSatisfyDependencyUsing(dependency, searchList)) 
  +                {
                       return false;
                   }
               }
  @@ -135,15 +165,20 @@
       }
       
       
  -    private boolean tryToSatisfyDependencyUsing(Class dependency, Set<String> searchList) {
  -        for (String componentName:searchList) {
  +    private boolean tryToSatisfyDependencyUsing(Class dependency, Set<String> searchList) 
  +    {
  +        for (String componentName:searchList) 
  +        {
   
               Set<ComponentDescriptor> saved = new HashSet<ComponentDescriptor>(currentTestSet);
               
               // the second check is important for edge case
  -            if (tryToInstall(componentName) && isInInstallSet(dependency)) {
  +            if (tryToInstall(componentName) && isInInstallSet(dependency)) 
  +            {
                   return true;
  -            } else {                        
  +            } 
  +            else 
  +            {                        
                   currentTestSet = saved;
               }
           }
  @@ -151,11 +186,14 @@
       }
   
   
  -    private Set<String> findPotentialComponents(Class dependency) {
  +    private Set<String> findPotentialComponents(Class dependency) 
  +    {
           Set<String> keys = new HashSet<String>();
           
  -        for (String candidateKey: componentDescriptors.keySet()) {            
  -            if (componentMightSatisfy(candidateKey, dependency)) {
  +        for (String candidateKey: componentDescriptors.keySet()) 
  +        {            
  +            if (componentMightSatisfy(candidateKey, dependency)) 
  +            {
                   keys.add(candidateKey);
               }
           }
  @@ -163,9 +201,12 @@
           return keys;
       }
   
  -    private boolean componentMightSatisfy(String candidateKey, Class dependency) {
  -        for (ComponentDescriptor descriptor: componentDescriptors.get(candidateKey)) {            
  -            if (descriptor.getComponentClass().equals(dependency)) {
  +    private boolean componentMightSatisfy(String candidateKey, Class dependency) 
  +    {
  +        for (ComponentDescriptor descriptor: componentDescriptors.get(candidateKey)) 
  +        {            
  +            if (descriptor.getComponentClass().equals(dependency)) 
  +            {
                   return true;
               }
           }
  @@ -173,15 +214,20 @@
       }
   
   
  -    private boolean isInInstallSet(Class dependency) {
  -        for (ComponentDescriptor descriptor: currentTestSet) {
  -            if (dependency.equals(descriptor.getComponentClass())) {
  +    private boolean isInInstallSet(Class dependency) 
  +    {
  +        for (ComponentDescriptor descriptor: currentTestSet) 
  +        {
  +            if (dependency.equals(descriptor.getComponentClass())) 
  +            {
                   return true;
               }
           }
           
  -        for (ComponentDescriptor descriptor: installedSet) {
  -            if (dependency.equals(descriptor.getComponentClass())) {
  +        for (ComponentDescriptor descriptor: installedSet) 
  +        {
  +            if (dependency.equals(descriptor.getComponentClass())) 
  +            {
                   return true;
               }
           }
  @@ -191,15 +237,20 @@
   
   
       // install set is already installed or the current working set
  -    private boolean isInInstallSet(String key) {
  -        for (ComponentDescriptor descriptor: currentTestSet) {
  -            if (key.equals(descriptor.getName())) {
  +    private boolean isInInstallSet(String key) 
  +    {
  +        for (ComponentDescriptor descriptor: currentTestSet) 
  +        {
  +            if (key.equals(descriptor.getName())) 
  +            {
                   return true;
               }
           }
           
  -        for (ComponentDescriptor descriptor: installedSet) {
  -            if (key.equals(descriptor.getName())) {
  +        for (ComponentDescriptor descriptor: installedSet) 
  +        {
  +            if (key.equals(descriptor.getName())) 
  +            {
                   return true;
               }
           }
  
  
  
  1.2       +1 -1      jboss-seam/src/main/org/jboss/seam/init/FactoryDescriptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FactoryDescriptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/FactoryDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- FactoryDescriptor.java	10 Mar 2007 05:50:40 -0000	1.1
  +++ FactoryDescriptor.java	20 Jun 2007 21:12:46 -0000	1.2
  @@ -2,7 +2,7 @@
   
   import org.jboss.seam.ScopeType;
   
  -public class FactoryDescriptor
  +class FactoryDescriptor
   {
      private String name;
      private ScopeType scope;
  
  
  
  1.4       +2 -2      jboss-seam/src/main/org/jboss/seam/init/GroovyHotRedeployable.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: GroovyHotRedeployable.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/GroovyHotRedeployable.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- GroovyHotRedeployable.java	18 May 2007 06:44:03 -0000	1.3
  +++ GroovyHotRedeployable.java	20 Jun 2007 21:12:46 -0000	1.4
  @@ -1,4 +1,4 @@
  -//$Id: GroovyHotRedeployable.java,v 1.3 2007/05/18 06:44:03 gavin Exp $
  +//$Id: GroovyHotRedeployable.java,v 1.4 2007/06/20 21:12:46 gavin Exp $
   package org.jboss.seam.init;
   
   import groovy.lang.GroovyClassLoader;
  @@ -15,7 +15,7 @@
    *
    * @author Emmanuel Bernard
    */
  -public class GroovyHotRedeployable extends JavaHotRedeployable
  +class GroovyHotRedeployable extends JavaHotRedeployable
   {
      private static final String DEFAULT_SCRIPT_EXTENSION = new CompilerConfiguration().getDefaultScriptExtension();
   
  
  
  
  1.4       +2 -2      jboss-seam/src/main/org/jboss/seam/init/JavaHotRedeployable.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JavaHotRedeployable.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/JavaHotRedeployable.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- JavaHotRedeployable.java	18 May 2007 06:44:03 -0000	1.3
  +++ JavaHotRedeployable.java	20 Jun 2007 21:12:46 -0000	1.4
  @@ -1,4 +1,4 @@
  -//$Id: JavaHotRedeployable.java,v 1.3 2007/05/18 06:44:03 gavin Exp $
  +//$Id: JavaHotRedeployable.java,v 1.4 2007/06/20 21:12:46 gavin Exp $
   package org.jboss.seam.init;
   
   import java.io.File;
  @@ -13,7 +13,7 @@
    *
    * @author Emmanuel Bernard
    */
  -public class JavaHotRedeployable implements RedeployableStrategy
  +class JavaHotRedeployable implements RedeployableStrategy
   {
   
      protected File[] paths;
  
  
  
  1.2       +1 -1      jboss-seam/src/main/org/jboss/seam/init/NamespaceDescriptor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NamespaceDescriptor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/NamespaceDescriptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- NamespaceDescriptor.java	10 Mar 2007 05:50:41 -0000	1.1
  +++ NamespaceDescriptor.java	20 Jun 2007 21:12:46 -0000	1.2
  @@ -2,7 +2,7 @@
   
   import org.jboss.seam.annotations.Namespace;
   
  -public class NamespaceDescriptor
  +class NamespaceDescriptor
   {
      private Namespace namespace;
      private Package pkg;
  
  
  
  1.4       +2 -2      jboss-seam/src/main/org/jboss/seam/init/NoHotRedeployable.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: NoHotRedeployable.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/NoHotRedeployable.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- NoHotRedeployable.java	8 Jun 2007 04:55:21 -0000	1.3
  +++ NoHotRedeployable.java	20 Jun 2007 21:12:46 -0000	1.4
  @@ -1,4 +1,4 @@
  -//$Id: NoHotRedeployable.java,v 1.3 2007/06/08 04:55:21 gavin Exp $
  +//$Id: NoHotRedeployable.java,v 1.4 2007/06/20 21:12:46 gavin Exp $
   package org.jboss.seam.init;
   
   import java.io.File;
  @@ -10,7 +10,7 @@
    * 
    * @author Emmanuel Bernard
    */
  -public class NoHotRedeployable implements RedeployableStrategy
  +class NoHotRedeployable implements RedeployableStrategy
   {
      public NoHotRedeployable(File resource) {}
      
  
  
  
  1.3       +2 -2      jboss-seam/src/main/org/jboss/seam/init/RedeployableStrategy.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: RedeployableStrategy.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/init/RedeployableStrategy.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- RedeployableStrategy.java	24 Apr 2007 00:06:40 -0000	1.2
  +++ RedeployableStrategy.java	20 Jun 2007 21:12:46 -0000	1.3
  @@ -1,4 +1,4 @@
  -//$Id: RedeployableStrategy.java,v 1.2 2007/04/24 00:06:40 gavin Exp $
  +//$Id: RedeployableStrategy.java,v 1.3 2007/06/20 21:12:46 gavin Exp $
   package org.jboss.seam.init;
   
   import java.io.File;
  @@ -12,7 +12,7 @@
    *
    * @author Emmanuel Bernard
    */
  -public interface RedeployableStrategy
  +interface RedeployableStrategy
   {
      /*
       * Mandatory constructor
  
  
  



More information about the jboss-cvs-commits mailing list