User: user57  
  Date: 02/02/12 20:26:40

  Modified:    src/main/org/jboss/deployment MainDeployer.java
                        SARDeployer.java
  Log:
   o These are all kinda related, so I am commiting them together
   o This is the second half of the migration to using ObjectName OBJECT_NAME
   o Not using jboss.system.* properties anywhere (one place in testsuite
     which I am ignoring for now)
   o StateManager will now read its config from a url (configURL), and only
     attempt to write it back out if that is a file URL.  Need to fix this
     to not need to write back to a config file.
   o Still setting jboss.home & jboss.system.home, but use ServerConfigMBean
     to get the proper bits, will eventually abstract all file access out
   o Added a simple locator to find a mbean server.  This is trivial code,
     but helps clean up client code and makes it obvious what it does.
  
  Revision  Changes    Path
  1.17      +2 -2      jboss/src/main/org/jboss/deployment/MainDeployer.java
  
  Index: MainDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/MainDeployer.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- MainDeployer.java 13 Feb 2002 03:38:32 -0000      1.16
  +++ MainDeployer.java 13 Feb 2002 04:26:39 -0000      1.17
  @@ -45,7 +45,7 @@
    * Takes a series of URL to watch, detects changes and calls the appropriate 
Deployers 
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.16 $
  + * @version $Revision: 1.17 $
    */
   public class MainDeployer
      extends ServiceMBeanSupport
  @@ -104,7 +104,7 @@
         while (urls.hasMoreTokens())
         {
            addDirectory(urls.nextToken().trim()) ;
  -      } 
  +     } 
      }
      
      public void addDirectory(String url) throws MalformedURLException
  
  
  
  1.12      +29 -25    jboss/src/main/org/jboss/deployment/SARDeployer.java
  
  Index: SARDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/SARDeployer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SARDeployer.java  12 Feb 2002 06:59:23 -0000      1.11
  +++ SARDeployer.java  13 Feb 2002 04:26:40 -0000      1.12
  @@ -67,7 +67,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Maplesden</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Jencks</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    *
    * <p><b>20010830 marc fleury:</b>
    * <ul>
  @@ -114,22 +114,18 @@
      /** A proxy to the MainDeployer. */
      private MainDeployerMBean mainDeployer;
   
  -   /** The system state data directory. */
  -   private File stateDataDir;
  +   /** The system data directory. */
  +   private File dataDir;
  +
  +   /** The system install URL. */
  +   private URL installURL;
  +
  +   /** The system library URL. */
  +   private URL libraryURL;
      
      // Public --------------------------------------------------------
      
      /**
  -    * Gets the Name of the ServiceDeployer object
  -    *
  -    * @return   returns "ServiceDeployer"
  -    */
  -   public String getName()
  -   {
  -      return "ServiceDeployer";
  -   }
  -   
  -   /**
       * Gets the FilenameFilter that the AutoDeployer uses to decide which files
       * will be deployed by the ServiceDeployer. Currently .jsr, .sar, and files
       * ending in service.xml are accepted.
  @@ -155,7 +151,6 @@
               // We watch the top only, no directory support
               di.watch = di.url;
            }
  -         
            else if(di.url.getProtocol().startsWith("file"))
            {
               File file = new File(di.url.getFile());
  @@ -195,10 +190,10 @@
   
               // Get the url of the local copy from the classloader.
               if (debug) {
  -               log.debug("copying from " + di.localUrl + path + " -> " + 
stateDataDir);
  +               log.debug("copying from " + di.localUrl + path + " -> " + dataDir);
               }
               
  -            inflateJar(di.localUrl, stateDataDir, path);
  +            inflateJar(di.localUrl, dataDir, path);
            }
         }
         catch (Exception e) 
  @@ -282,7 +277,6 @@
               log.debug("Found classpath element: " + classpathElement);
            }
            
  -         //String codebase = System.getProperty("jboss.system.libraryDirectory");
            String codebase = "";
            String archives = "";
            
  @@ -305,7 +299,12 @@
               if (!(codebase.startsWith("http:") || codebase.startsWith("file:"))) 
               {
                  // put the jboss/system base in front of it
  -               codebase = 
System.getProperty("jboss.system.installationURL")+codebase;
  +               try {
  +                  codebase = new URL(installURL, codebase).toString();
  +               }
  +               catch (MalformedURLException e) {
  +                  throw new DeploymentException(e);
  +               }
               }
               
               // Let's make sure the formatting of the codebase ends with the /
  @@ -384,8 +383,9 @@
            else if (!archives.equals(""))
            {
               // Still no codebase? safeguard
  -            if (codebase.equals(""))
  -               codebase = System.getProperty("jboss.system.libraryDirectory");
  +            if (codebase.equals("")) {
  +               codebase = libraryURL.toString();
  +            }
                  
               if (archives.equals("*")) 
               {
  @@ -580,11 +580,15 @@
                           ServiceControllerMBean.OBJECT_NAME,
                           server);
         
  -      // get the state directory
  -      stateDataDir = (File)
  -         server.getAttribute(ServerConfigMBean.OBJECT_NAME, "StateDataDir");
  -      
  -      return name == null ? new ObjectName(OBJECT_NAME) : name;
  +      // get the data directory, install url & library url
  +      dataDir = (File)
  +         server.getAttribute(ServerConfigMBean.OBJECT_NAME, "DataDir");
  +      installURL = (URL)
  +         server.getAttribute(ServerConfigMBean.OBJECT_NAME, "InstallURL");
  +      libraryURL = (URL)
  +         server.getAttribute(ServerConfigMBean.OBJECT_NAME, "LibraryURL");
  +
  +      return name == null ? OBJECT_NAME : name;
      }
   
      public void preDeregister()
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to