portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container JetspeedContainerServlet.java
Date Tue, 06 Jan 2004 19:31:58 GMT
taylor      2004/01/06 11:31:58

  Modified:    commons/src/java/org/apache/jetspeed/container
                        JetspeedContainerServlet.java
  Log:
  - working with manipulating thread path
    this is still under construction
  
  Revision  Changes    Path
  1.5       +35 -1     jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
  
  Index: JetspeedContainerServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/commons/src/java/org/apache/jetspeed/container/JetspeedContainerServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JetspeedContainerServlet.java	31 Dec 2003 09:46:35 -0000	1.4
  +++ JetspeedContainerServlet.java	6 Jan 2004 19:31:58 -0000	1.5
  @@ -54,6 +54,8 @@
   package org.apache.jetspeed.container;
   
   import java.io.IOException;
  +import java.net.URL;
  +import java.net.URLClassLoader;
   
   import javax.portlet.ActionRequest;
   import javax.portlet.ActionResponse;
  @@ -218,6 +220,8 @@
                   init(request, response);
               }
   
  +            // infuseClasspath();
  +            
               PortletDefinition portletDefinition = (PortletDefinition) request.getAttribute(ContainerConstants.PORTLET_ENTITY);
               Portlet portlet = JetspeedPortletFactory.getPortlet(this.getServletConfig(),
portletDefinition);
   
  @@ -280,6 +284,36 @@
           log.info("Done shutting down!");
       }
   
  +    public static final String LOCAL_CLASSES = "/WEB-INF/classes/";    
  +    public static final String LOCAL_JARS = "/WEB-INF/lib/";    
   
  +    private void infuseClasspath()
  +    {
  +        try
  +        {
  +            ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();   
        
  +            
  +            ClassLoader loader; // = (ClassLoader)classLoaders.get(portletApplicationName);
           
  +//            if (null == loader)
  +            {
  +                StringBuffer localPath = new StringBuffer("file:");
  +                // localPath.append(jetspeedContext.getRealPath(JetspeedPortletContext.LOCAL_PA_ROOT));
  +                // localPath.append(portletApplicationName);
  +                String localAppPath = "file://c:/bluesunrise/apache/catalina/webapps/jetspeed";

  +                //localPath.toString(); 
  +                URL[] urls = {new URL(localAppPath + LOCAL_CLASSES),
  +                              new URL(localAppPath + LOCAL_JARS)};
  +                loader = new URLClassLoader(urls, oldLoader);
  +                // classLoaders.put(portletApplicationName, loader);
  +            }
  +            Thread.currentThread().setContextClassLoader(loader);                 
  +        }
  +        catch (Exception e)
  +        {
  +            e.printStackTrace();
  +            return;
  +        }
  +          
  +    }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message