Dynamic reload for virtualization server.

The highlights of this checkin are:

    o  No need to manually remove virt server work dir anymore

    o  Now contents of work dir are virtualized in addition 
       to the jars in memory.   Starts  / reloads faster,
       plus a lot more scalable.

    o  You can create users & invite them to web project, 
       delete their sandboxe, etc.  Works.

    o  Virt server picks up new web projects properly
       even when these projects were created after
       the virt server was started.


 Not done:
        
    o  Need to play the same game with classes dirs that 
       I'm doing with lib dirs.  Should be easy now.

    o  Some cleanup is needed in the way that sandboxes
       are destroyed.  Works, but on the brittle side.
       Not urgent.

    o  Because of problems with RMI auth, you still need
       to startup the alfreco webapp before the virt server,
       and if one poops out, the auth code does not recover
       that well yet.  Britt & I will have to deal with
       this over the next few days.


Gory details:


   root/projects/catalina-virtual/config/server.xml
        Turned off autoDeploy entirely.
        Now all reloading is explicit via JMX

        Put the request dumper valve into a comment.
        It's for debugging purposes only (and slows stuff down).

   root/projects/catalina-virtual/source/java/org/alfresco/catalina/host/AVMHost.java
        Cleaned up api a bit.

   root/projects/catalina-virtual/source/java/org/alfresco/catalina/host/AVMHostConfig.java
        Recursive reload of webapps.

   root/projects/catalina-virtual/source/java/org/alfresco/catalina/loader/AVMWebappLoader.java
        Recursive reload of webapps.

  root/projects/catalina-virtual/source/java/org/alfresco/catalina/valve/AVMUrlValve.java
        Cleaned up & refactoring

   root/projects/catalina-virtual/source/java/org/alfresco/mbeans/VirtServerRegistrationThread.java
        Using new api from AVMFileDirContext

   root/projects/jndi-client/source/java/org/alfresco/jndi/AVMFileDirContext.java
        Cleaned up api, made non-fatal log messages 'debug' rather than 'info'.


   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/AVMConstants.java
        Added new constant.
        This file needs to be refactored soon.


   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/AddAvmContentDialog.java
        Moved virt server notification to doPostCommitProcessing


   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/DeleteSandboxDialog.java
        Fixed notification of virt server.

   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/ImportWebsiteDialog.java
        Moved virt server notification to doPostCommitProcessing

   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/InviteWebsiteUsersWizard.java
        Moved virt server notification to doPostCommitProcessing

   root/projects/web-client/source/java/org/alfresco/web/bean/wcm/SandboxFactory.java
        Added new property to sandboxes to make recursive reload efficient.

   root/projects/web-client/source/java/org/alfresco/web/forms/ServletContextFormDataFunctionsAdapter.java
        Now uses new AVMFileDirContext api.
        Removed System.err.prinln() statements.





git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4839 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jon Cox
2007-01-15 22:27:24 +00:00
parent d1324409be
commit 3bcea2653f
7 changed files with 164 additions and 49 deletions

View File

@@ -44,6 +44,9 @@ public class AddAvmContentDialog extends AddContentDialog
/** AVM Browse Bean reference */
protected AVMBrowseBean avmBrowseBean;
/** */
protected String path;
/**
@@ -75,11 +78,11 @@ public class AddAvmContentDialog extends AddContentDialog
// create the file
this.avmService.createFile(parent, this.fileName);
String path = parent + '/' + this.fileName;
NodeRef fileNodeRef = AVMNodeConverter.ToNodeRef(-1, path);
this.path = parent + '/' + this.fileName;
NodeRef fileNodeRef = AVMNodeConverter.ToNodeRef(-1, this.path);
if (logger.isDebugEnabled())
logger.debug("Created AVM file: " + path);
logger.debug("Created AVM file: " + this.path);
// apply the titled aspect - title and description
Map<QName, Serializable> titledProps = new HashMap<QName, Serializable>(2, 1.0f);
@@ -100,11 +103,6 @@ public class AddAvmContentDialog extends AddContentDialog
writer.putContent(strContent == null ? "" : strContent);
}
// reload the virtualisation server as required
if (logger.isDebugEnabled())
logger.debug("Reloading virtualisation server on path: " + path);
AVMConstants.updateVServerWebapp(path, false);
// remember the created node now
this.createdNode = fileNodeRef;
}
@@ -116,6 +114,22 @@ public class AddAvmContentDialog extends AddContentDialog
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
clearUpload();
// Notify virtualization server
//
// This must be done in doPostCommitProcessing so that the notification
// can only be received by the virtualization server *after* the content
// update transaction within the AVM has completed. Otherwise, there's
// a race condition that can cause the virtualization server to not be
// able to read the new (or modified) web.xml file within the virtual
// webapps being relaoded via the call to updateVServerWebapp.
if (logger.isDebugEnabled())
{
logger.debug("Reloading virtualisation server on path: " + this.path);
}
AVMConstants.updateVServerWebapp(this.path, false);
return outcome;
}