User: d_jencks
  Date: 01/09/26 14:47:05

  Modified:    src/main/org/jboss/system ServiceController.java
                        ServiceLibraries.java URLClassLoader.java
                        URLClassLoaderMBean.java
  Log:
  ServiceDeployer: added local dir support, undeploy support for depends, reworked 
classpath dependencies. Changed config files to work. REMOVE core-service.xml or 
build.sh cleancvs update -d -P >update11.log
  
  Revision  Changes    Path
  1.8       +10 -5     jboss/src/main/org/jboss/system/ServiceController.java
  
  Index: ServiceController.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServiceController.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ServiceController.java    2001/09/20 18:23:41     1.7
  +++ ServiceController.java    2001/09/26 21:47:05     1.8
  @@ -40,7 +40,7 @@
    * @see org.jboss.system.Service
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>David Jencks</a>
  - * @version $Revision: 1.7 $ <p>
  + * @version $Revision: 1.8 $ <p>
    *
    * <b>Revisions:</b> <p>
    *
  @@ -229,15 +229,12 @@
       */
      public void undeploy(ObjectName objectName) throws Exception
      {
  -      if (log.isDebugEnabled()) {
  -         log.debug("undeploying " + objectName + "from server");
  -      }
         
         // Do we have a deployed MBean?
         if (server.isRegistered(objectName))
         {
            if (log.isDebugEnabled()) {
  -            log.debug("undeploying " + objectName + "from server");
  +            log.debug("undeploying " + objectName + " from server");
            }
            
            //Remove from local maps
  @@ -252,6 +249,14 @@
               new ObjectName("ZClassLoaders:id=" + objectName.hashCode());
            server.unregisterMBean(loader);
         }
  +      else 
  +      {
  +         if (log.isDebugEnabled()) {
  +            log.debug("no need to undeploy " + objectName + " from server");
  +         }
  +
  +      } // end of else
  +      
      }
   
      // MBeanRegistration implementation ----------------------------------------
  
  
  
  1.4       +3 -3      jboss/src/main/org/jboss/system/ServiceLibraries.java
  
  Index: ServiceLibraries.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/ServiceLibraries.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServiceLibraries.java     2001/09/08 17:08:32     1.3
  +++ ServiceLibraries.java     2001/09/26 21:47:05     1.4
  @@ -29,7 +29,7 @@
    *
    * @see <related>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.3 $ <p>
  + * @version $Revision: 1.4 $ <p>
    *
    *      <b>20010830 marc fleury:</b>
    *      <ul>initial import
  @@ -184,11 +184,11 @@
            if (!classLoaders.contains(cl))
            {
               classLoaders.add(cl);
  -            System.out.println("Libraries adding URLClassLoader " + cl.hashCode() + 
" URL " + ((URLClassLoader)cl).getURL().toString());
  +            System.out.println("Libraries adding URLClassLoader " + cl.hashCode() + 
" key URL " + ((URLClassLoader)cl).getKeyURL().toString());
            }
            else
            {
  -            System.out.println("Libraries skipping duplicate URLClassLoader for URL 
" + ((URLClassLoader)cl).getURL().toString());
  +            System.out.println("Libraries skipping duplicate URLClassLoader for key 
URL " + ((URLClassLoader)cl).getKeyURL().toString());
            }
         }
      }
  
  
  
  1.4       +40 -35    jboss/src/main/org/jboss/system/URLClassLoader.java
  
  Index: URLClassLoader.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/URLClassLoader.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- URLClassLoader.java       2001/09/12 02:10:23     1.3
  +++ URLClassLoader.java       2001/09/26 21:47:05     1.4
  @@ -29,7 +29,7 @@
    *    resources and classes.
    *
    * @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    * 
    * <p><b>20010830 marc fleury:</b>
    * <ul>
  @@ -40,10 +40,15 @@
      extends java.net.URLClassLoader
      implements URLClassLoaderMBean
   {
  -   /** One URL per classLoader in our case */
  -   private URL url = null;
  +   /** One URL per classLoader in our case 
  +    * This is just a key used for identifying the classloader,
  +    * nothing is actually loaded from it.  Classes and resources are 
  +    * loaded from local copies or unpacked local copies.
  +    */   
  +   private URL keyUrl = null;
  +
      /** An SCL can also be loading on behalf of an MBean */
  -   private ObjectName mbean = null;
  +    //private ObjectName mbean = null; not used
        
      /** All SCL are just in orbit around a basic ServiceLibraries */
      private static ServiceLibraries libraries;
  @@ -54,38 +59,33 @@
        * @param String application
        * @param ClassLoader parent
        */
  -     public URLClassLoader( String pUrl )
  -     {
  +    /*public URLClassLoader( String pUrl )
  +   {
         super( new URL[] {} );
         try {
            URL lUrl = new URL( pUrl );
            addURL( lUrl );
  -         this.url = lUrl;
  +         this.keyUrl = lUrl;
         }
         catch( Exception e ) {
  -                     System.out.println("[GPA] WARNING: URL "+url+" is not valid");
  +         System.out.println("[GPA] WARNING: URL "+keyUrl+" is not valid");
         }
  -      
  -             try {
  +      try {
                        
  -                     url.openStream();
  +         //url.openStream();
                        
                        
  -                     if (libraries == null) libraries = 
ServiceLibraries.getLibraries();
  +         if (libraries == null) libraries = ServiceLibraries.getLibraries();
                        
  -/*
  -                     //Reload the library if necessary
  -                     if (reload) 
  -                                     libraries.removeClassLoader(this) ;
  -*/
   
  -                     // A URL enabled SCL must register itself with the libraries 
to be queried
  -                     libraries.addClassLoader(this);
  -             }
  -             catch(Exception e) { 
  -                     System.out.println("[GPA] WARNING: URL "+url+" could not be 
opened");
  -             }
  -     }
  +         // A URL enabled SCL must register itself with the libraries to be queried
  +         libraries.addClassLoader(this);
  +      }
  +      catch(Exception e) 
  +      { 
  +         System.out.println("[GPA] WARNING: URL "+keyUrl+" could not be opened");
  +      }
  +      }*/
        
      /**
       * One url per SCL
  @@ -94,15 +94,15 @@
       * @param ClassLoader parent
       */
        
  -   public URLClassLoader(URL[] urls)
  +   public URLClassLoader(URL[] urls, URL keyUrl)
      {
                
         super(urls);
                
  -      this.url = urls[0];
  +      this.keyUrl = keyUrl;
                
         try {
  -         url.openStream();
  +          //url.openStream();
                        
            if (libraries == null) {
               libraries = ServiceLibraries.getLibraries();
  @@ -119,12 +119,12 @@
            libraries.addClassLoader(this);
         }
         catch(Exception e) { 
  -         System.out.println("[GPA] WARNING: URL "+url+" could not be opened");
  +         System.out.println("[GPA] WARNING: URL "+keyUrl+" could not be opened");
         }
      }
   
  -   public URL getURL() {
  -      return url;
  +   public URL getKeyURL() {
  +      return keyUrl;
      }
        
      /**
  @@ -187,10 +187,10 @@
        
      public InputStream getResourceAsStream(String name) {
         try {
  -         URL url = getResource(name);
  +         URL resourceUrl = getResource(name);
                        
  -         if (url != null) {
  -            return url.openStream();
  +         if (resourceUrl != null) {
  +            return resourceUrl.openStream();
            }
         } catch (Exception ignore) {}
         
  @@ -199,15 +199,20 @@
        
      public int hashCode() 
      {
  -      return url.hashCode();
  +      return keyUrl.hashCode();
      }
        
      public boolean equals(Object other) 
      {
         if (other instanceof URLClassLoader) 
         {
  -         return ((URLClassLoader) other).getURL().equals(url);
  +         return ((URLClassLoader) other).getKeyURL().equals(keyUrl);
         }
         return false;
  +   }
  +
  +   public String toString()
  +   {
  +      return "JBoss URLClassloader: keyURL : " + getKeyURL() + ", URLS: " + 
getURLs();
      }
   }
  
  
  
  1.4       +2 -2      jboss/src/main/org/jboss/system/URLClassLoaderMBean.java
  
  Index: URLClassLoaderMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/system/URLClassLoaderMBean.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- URLClassLoaderMBean.java  2001/09/12 02:10:23     1.3
  +++ URLClassLoaderMBean.java  2001/09/26 21:47:05     1.4
  @@ -12,11 +12,11 @@
    * The management interface for the {@link URLClassLoader} mbean.
    * 
    * @author <a href="[EMAIL PROTECTED]">Marc Fleury</a>
  - * @version $Revision: 1.3 $
  + * @version $Revision: 1.4 $
    */
   public interface URLClassLoaderMBean 
   {
  -   public URL getURL();
  +   public URL getKeyURL();
      // Empty, just a trick for the MBean base man jmx is dumb sometimes
   }
   
  
  
  

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

Reply via email to