User: schaefera
  Date: 01/11/26 13:46:51

  Modified:    src/main/org/jboss/ejb Application.java
                        ContainerFactory.java ContainerFactoryMBean.java
  Log:
  Added the next layer of the JSR-77 implementation. Right now the application
  (EAR) as well as the EJB-Module is added and removed dynamically.
  
  Revision  Changes    Path
  1.22      +12 -1     jboss/src/main/org/jboss/ejb/Application.java
  
  Index: Application.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/Application.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Application.java  2001/11/16 01:33:50     1.21
  +++ Application.java  2001/11/26 21:46:51     1.22
  @@ -28,7 +28,7 @@
    * @see ContainerFactory
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  - * @version $Revision: 1.21 $
  + * @version $Revision: 1.22 $
    */
   public class Application
      implements Service
  @@ -50,6 +50,9 @@
      /** Url where this application was deployed from. */
      URL url;
      
  +   /** Module Object Name (JSr-77) **/
  +   private String moduleName;
  +   
      // Static --------------------------------------------------------
   
      // Public --------------------------------------------------------
  @@ -180,6 +183,14 @@
         // if name hasn't been set yet, use the url
         if (name.equals(""))
            name = url.toString();
  +   }
  +   
  +   public String getModuleName() {
  +      return moduleName;
  +   }
  +   
  +   public void setModuleName( String pModuleName ) {
  +      moduleName = pModuleName;
      }
        
      // Service implementation ----------------------------------------
  
  
  
  1.99      +23 -35    jboss/src/main/org/jboss/ejb/ContainerFactory.java
  
  Index: ContainerFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactory.java,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- ContainerFactory.java     2001/11/26 03:12:24     1.98
  +++ ContainerFactory.java     2001/11/26 21:46:51     1.99
  @@ -52,6 +52,8 @@
   import org.jboss.web.WebServiceMBean;
   import org.w3c.dom.Element;
   
  +import org.jboss.management.j2ee.EjbModule;
  +
   /**
    * A ContainerFactory is used to deploy EJB applications. It can be given a
    * URL to an EJB-jar or EJB-JAR XML file, which will be used to instantiate
  @@ -68,7 +70,7 @@
   * @author <a href="mailto:[EMAIL PROTECTED]";>Peter Antman</a>.
   * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>
   * @author <a href="mailto:[EMAIL PROTECTED]";>Sacha Labourey</a>
  -* @version $Revision: 1.98 $
  +* @version $Revision: 1.99 $
   */
   public class ContainerFactory
      extends ServiceMBeanSupport
  @@ -274,27 +276,17 @@
         this.validateDTDs = validate;
      }
   
  -   /**
  -    * Deploy the file at this URL. This method is typically called from
  -    * remote administration tools that cannot handle java.net.URL's as
  -    * parameters to methods
  -    *
  -    * @param url
  -    *
  -    * @throws MalformedURLException
  -    * @throws DeploymentException
  -    */
  -   public void deploy( String url, String appId )
  +   public void deploy( String pParentId, String url, String appId )
         throws MalformedURLException, DeploymentException
      {
         // Delegate to "real" deployment
  -      deploy( new URL( url ), appId );
  +      deploy( pParentId, new URL( url ), appId );
      }
   
      //
      // Richard Gyger
      //
  -   public void deploy( String appUrl, String[] jarUrls, String appId )
  +   public void deploy( String pParentId, String appUrl, String[] jarUrls, String 
appId )
         throws MalformedURLException, DeploymentException
      {
         getLog().info("got to deploy in ContainerFactory");
  @@ -304,7 +296,7 @@
         for( int i = 0; i < tmp.length; i++ )
            tmp[ i ] = new URL( jarUrls[ i ] );
   
  -      deploy( new URL( appUrl ), tmp, appId );
  +      deploy( pParentId, new URL( appUrl ), tmp, appId );
      }
   
      /**
  @@ -335,16 +327,16 @@
       *
       * @throws DeploymentException
       */
  -   public synchronized void deploy( URL url, String appId )
  +   public synchronized void deploy( String pParentId, URL url, String appId )
         throws DeploymentException
      {
  -      deploy( url, new URL[]{ url }, appId );
  +      deploy( pParentId, url, new URL[]{ url }, appId );
      }
   
      //
      // Richard Gyger
      //
  -   public synchronized void deploy( URL appUrl, URL[] jarUrls, String appId )
  +   public synchronized void deploy( String pParentId, URL appUrl, URL[] jarUrls, 
String appId )
         throws DeploymentException
      {
         // Create application
  @@ -373,7 +365,7 @@
            cl.setWebURLs(codebase);
   
            for( int i = 0; i < jarUrls.length; i++ )
  -            deploy( app, jarUrls[ i ], cl );
  +            deploy( app, jarUrls[ i ], cl, pParentId, appId );
   
            // Init application
            //app.init();
  @@ -398,26 +390,20 @@
   
            throw new DeploymentException( "Could not deploy " + appUrl.toString(), e 
);
         }
  -      // Inform the Data Collector that new/old EJBs were deployed
  -/* AS Temporary not available
  -      try
  -      {
  -         getServer().invoke(new ObjectName( "Management", "service", "Collector" ),
  -                            "refresh",
  -                            new Object[] {},
  -                            new String[] {}
  -                            );
  -      }
  -      catch( Exception e )
  -      {
  -         Logger.exception(e);
  -      }
  -*/
      }
   
  -   private void deploy( Application app, URL url, ClassLoader cl )
  +   private void deploy( Application app, URL url, ClassLoader cl, String pParentId, 
String pAppId )
         throws NamingException, Exception
      {
  +      // Create JSR-77 EJB-Module
  +      String lModule = EjbModule.create(
  +         getServer(),
  +         pParentId,
  +         pAppId,
  +         url
  +      ).toString();
  +      app.setModuleName( lModule );
  +
         // Create a file loader with which to load the files
         XmlFileLoader efm = new XmlFileLoader(validateDTDs);
   
  @@ -518,6 +504,8 @@
         } finally {
            // Remove deployment
            deployments.remove( url );
  +         // Remove JSR-77 Module
  +         EjbModule.destroy( getServer(), app.getModuleName() );
            // Done
            log.info( "Undeployed application: " + app.getName() );
         }
  
  
  
  1.18      +5 -3      jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java
  
  Index: ContainerFactoryMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/ejb/ContainerFactoryMBean.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ContainerFactoryMBean.java        2001/11/26 03:12:24     1.17
  +++ ContainerFactoryMBean.java        2001/11/26 21:46:51     1.18
  @@ -20,7 +20,7 @@
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Juha Lindfors</a>
  - * @version $Revision: 1.17 $
  + * @version $Revision: 1.18 $
    */
   public interface ContainerFactoryMBean
      extends ServiceMBean
  @@ -36,6 +36,7 @@
      /**
       * Deploy an application
       *
  +    * @param pParentId  Id of the Parent or Container of this application
       * @param url      URL to the directory with the given EJBs to be deployed
       * @param appId    Id of the application this EJBs belongs to
       *                 used for management
  @@ -43,12 +44,13 @@
       * @throws MalformedURLException
       * @throws DeploymentException
       */
  -   void deploy(String url, String appId )
  +   void deploy( String pParentId, String url, String appId )
         throws MalformedURLException, DeploymentException;
   
      /**
       * Deploy an application
       *
  +    * @param pParentId  Id of the Parent or Container of this application
       * @param appUrl     Url to the application itself
       * @param jarUrls    Array of URLs to the JAR files containing the EJBs
       * @param appId      Id of the application this EJBs belongs to
  @@ -57,7 +59,7 @@
       * @throws MalformedURLException
       * @throws DeploymentException
       */
  -   void deploy( String appUurl, String[] jarUrls, String appId )
  +   void deploy( String pParentId, String appUrl, String[] jarUrls, String appId )
         throws MalformedURLException, DeploymentException;
   
      /**
  
  
  

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

Reply via email to