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

@@ -62,6 +62,9 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
/** AVM Browse Bean reference */
protected AVMBrowseBean avmBrowseBean;
/** Data for virtualization server notification */
private List<SandboxInfo> sandboxInfoList;
/**
@@ -163,7 +166,8 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
// build the sandboxes now we have the manager list and complete user list
// and create an association to a node to represent each invited user
List<SandboxInfo> sandboxInfoList = new LinkedList<SandboxInfo>();
this.sandboxInfoList = new LinkedList<SandboxInfo>();
for (UserGroupRole userRole : this.userGroupRoles)
{
for (String userAuth : findNestedUserAuthorities(userRole.getAuthority()))
@@ -188,19 +192,36 @@ public class InviteWebsiteUsersWizard extends InviteUsersWizard
}
}
// reload virtualisation server for webapp in this web project
if (isStandalone())
{
for (SandboxInfo sandboxInfo : sandboxInfoList)
{
String newlyInvitedStoreName = AVMConstants.buildStagingStoreName(sandboxInfo.getMainStoreName());
String path = AVMConstants.buildStoreWebappPath(newlyInvitedStoreName, this.avmBrowseBean.getWebapp());
AVMConstants.updateVServerWebapp(path, true);
}
}
return outcome;
}
/**
* Handle notification to the virtualization server
* (this needs to occur after the sandbox is created).
*/
@Override
protected String doPostCommitProcessing(FacesContext context, String outcome)
{
// reload virtualisation server for webapp in this web project
if (isStandalone())
{
for (SandboxInfo sandboxInfo : this.sandboxInfoList)
{
String newlyInvitedStoreName =
AVMConstants.buildStagingStoreName(
sandboxInfo.getMainStoreName());
String path =
AVMConstants.buildStoreWebappPath(
newlyInvitedStoreName, this.avmBrowseBean.getWebapp());
AVMConstants.updateVServerWebapp(path, true);
}
}
return outcome;
}
/**
* Find all nested user authorities contained with an authority