taylor 2004/08/16 11:31:20
Modified: portal/src/java/org/apache/jetspeed/deployment/impl
DeployPortletAppEventListener.java
Log:
adding support for full language support for JSR 168, contribution from Shinsuke
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.17 +46 -2
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java
Index: DeployPortletAppEventListener.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/deployment/impl/DeployPortletAppEventListener.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- DeployPortletAppEventListener.java 1 Aug 2004 15:44:35 -0000 1.16
+++ DeployPortletAppEventListener.java 16 Aug 2004 18:31:19 -0000 1.17
@@ -21,14 +21,13 @@
import org.apache.jetspeed.deployment.DeploymentException;
import org.apache.jetspeed.deployment.DeploymentObject;
import org.apache.jetspeed.factory.PortletFactory;
-import org.apache.jetspeed.tools.pamanager.PortletApplicationException;
import org.apache.jetspeed.tools.pamanager.PortletApplicationManagement;
import org.apache.jetspeed.util.DirectoryHelper;
+import org.apache.jetspeed.util.FileSystemHelper;
import org.apache.jetspeed.util.descriptor.PortletApplicationWar;
import org.apache.pluto.om.portlet.PortletApplicationDefinition;
import org.jdom.Document;
import org.jdom.Element;
-import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
/**
@@ -217,6 +216,21 @@
{
portletFactory.addClassLoader(paWar.createClassloader(getClass().getClassLoader()));
}
+ else
+ {
+ try
+ {
+ ClassLoader classloader =
createPortletClassloader(getClass().getClassLoader(), id);
+ if (classloader != null)
+ {
+ portletFactory.addClassLoader(classloader);
+ }
+ }
+ catch (IOException e1)
+ {
+ log.info("Could not add Portlet Class Loader: " + id);
+ }
+ }
return;
}
@@ -235,6 +249,18 @@
{
log.info("Deploying portlet applicaion WAR " + fileName);
pam.deploy(paWar);
+ try
+ {
+ ClassLoader classloader =
createPortletClassloader(getClass().getClassLoader(), id);
+ if (classloader != null)
+ {
+ portletFactory.addClassLoader(classloader);
+ }
+ }
+ catch (IOException e1)
+ {
+ log.info("Could not add Portlet Class Loader: " + id);
+ }
}
}
else if
(event.getEventType().equals(DeploymentEvent.EVENT_TYPE_REDEPLOY))
@@ -288,5 +314,23 @@
public void invokeRedeploy( DeploymentEvent event ) throws DeploymentException
{
doDeploy(event);
+ }
+
+ /**
+ * <p>
+ * createPortletClassloader
+ * </p>
+ *
+ * @param parent
+ * @param id
+ * @return
+ * @throws IOException
+ */
+ private ClassLoader createPortletClassloader(ClassLoader parent, String id)
throws IOException
+ {
+ String portletAppDirectory = pam.getDeploymentPath(id);
+ FileSystemHelper target = new DirectoryHelper(new
File(portletAppDirectory));
+ PortletApplicationWar targetWar = new PortletApplicationWar(target, id, "/"
+ id);
+ return targetWar.createClassloader(parent);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]