JBoss Portal SVN: r8000 - in branches/JBoss_Portal_Branch_2_6/core/src: resources/portal-core-sar/META-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-08-19 19:06:08 -0400 (Sun, 19 Aug 2007)
New Revision: 8000
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
fix cluster support in users online service
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java 2007-08-19 22:45:01 UTC (rev 7999)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java 2007-08-19 23:06:08 UTC (rev 8000)
@@ -32,7 +32,7 @@
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision: 0.1 $
*/
-public interface UserActivityNotificationBroadcasterMBean //extends HAServiceMBean
+public interface UserActivityNotificationBroadcasterMBean extends HAServiceMBean
{
public String getPartitionName();
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java 2007-08-19 22:45:01 UTC (rev 7999)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java 2007-08-19 23:06:08 UTC (rev 8000)
@@ -77,7 +77,7 @@
private volatile Set activityResults = new HashSet();
- private UserActivityNotificationBroadcasterMBean activityBroadcaster;
+ private String activityBroadcasterName;
public UsersActivityStatsServiceImpl()
{
@@ -95,9 +95,9 @@
updaterExecutor.scheduleWithFixedDelay(new Updater(activityQueue), getUpdaterInterval(), getUpdaterInterval(), TimeUnit.MILLISECONDS);
- if (activityBroadcaster != null)
+ if (activityBroadcasterName != null)
{
- activityBroadcaster.addNotificationListener(this, null, null);
+ server.addNotificationListener(new ObjectName(activityBroadcasterName), this, null, null);
}
else
{
@@ -171,11 +171,14 @@
userActivity.getId());
- if (activityBroadcaster != null)
+ if (activityBroadcasterName != null)
{
log.debug("Broadcasting user activity notification ");
- activityBroadcaster.sendNotification(notification);
+ server.invoke(new ObjectName(activityBroadcasterName),
+ "sendNotification",
+ new Object[]{notification},
+ new String[]{Notification.class.getName()});
}
else
{
@@ -269,14 +272,14 @@
this.activityTimeout = activityTimeout;
}
- public UserActivityNotificationBroadcasterMBean getActivityBroadcaster()
+ public String getActivityBroadcasterName()
{
- return activityBroadcaster;
+ return activityBroadcasterName;
}
- public void setActivityBroadcaster(UserActivityNotificationBroadcasterMBean activityBroadcaster)
+ public void setActivityBroadcasterName(String activityBroadcasterName)
{
- this.activityBroadcaster = activityBroadcaster;
+ this.activityBroadcasterName = activityBroadcasterName;
}
private class Updater implements Runnable
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-19 22:45:01 UTC (rev 7999)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-19 23:06:08 UTC (rev 8000)
@@ -581,9 +581,7 @@
|Uncomment in clustered mode : broadcaster will spread info about user activity in cluster
@portal.single.xml.close@
- <depends
- optional-attribute-name="ActivityBroadcaster"
- proxy-type="attribute">portal:service=HAUserActivityNotificationBroadcaster</depends>
+ <attribute name="ActivityBroadcasterName">portal:service=HAUserActivityNotificationBroadcaster</attribute>
@portal.single.xml.open@
-->
18 years, 8 months
JBoss Portal SVN: r7999 - in modules/portlet/trunk: federation/src/main/org/jboss/portal/portlet/federation/impl and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-19 18:45:01 -0400 (Sun, 19 Aug 2007)
New Revision: 7999
Modified:
modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
modules/portlet/trunk/jboss-portal-portlet.iws
Log:
port to portlet module the bug fix from the portlet invoker registration service that was fixed in 2.6
Modified: modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
===================================================================
--- modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java 2007-08-19 22:42:16 UTC (rev 7998)
+++ modules/portlet/trunk/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java 2007-08-19 22:45:01 UTC (rev 7999)
@@ -74,12 +74,12 @@
this.federatingPortletInvoker = federatingPortletInvoker;
}
- protected void startService() throws Exception
+ public void start() throws Exception
{
federatingPortletInvoker.registerInvoker(id, portletInvoker);
}
- protected void stopService() throws Exception
+ public void stop() throws Exception
{
federatingPortletInvoker.unregisterInvoker(id);
}
Modified: modules/portlet/trunk/jboss-portal-portlet.iws
===================================================================
--- modules/portlet/trunk/jboss-portal-portlet.iws 2007-08-19 22:42:16 UTC (rev 7998)
+++ modules/portlet/trunk/jboss-portal-portlet.iws 2007-08-19 22:45:01 UTC (rev 7999)
@@ -130,7 +130,26 @@
</component>
<component name="FavoritesProjectViewPane" />
<component name="FileEditorManager">
- <leaf />
+ <leaf>
+ <file leaf-file-name="portal-beans.xml" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/portlet/src/resources/test/test-portal-war/WEB-INF/portal-beans.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="31" column="0" selection-start="1998" selection-end="1998" vertical-scroll-proportion="0.45869297">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="PortletInvokerRegistrationService.java" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="81" column="19" selection-start="3150" selection-end="3150" vertical-scroll-proportion="0.87299633">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ </leaf>
</component>
<component name="FindManager">
<FindUsagesManager>
@@ -218,8 +237,14 @@
<option name="myItemId" value="jboss-portal-portlet.ipr" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
+ </PATH>
+ <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="tools" />
+ <option name="myItemId" value="jboss-portal-portlet.ipr" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
</PATH>
@@ -229,11 +254,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="tools" />
+ <option name="myItemId" value="portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -243,17 +268,21 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="tools" />
+ <option name="myItemId" value="portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools/etc" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -261,36 +290,32 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="tools" />
+ <option name="myItemId" value="portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools/etc" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/tools/etc/buildfragments" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="jboss-portal-portlet.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources/test" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="jboss-portal-portlet.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources/test/test-portal-war" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="portlet" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources/test/test-portal-war/WEB-INF" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
@@ -306,6 +331,18 @@
<option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources/test" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -325,9 +362,21 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/resources" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal/test" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal/test/portlet" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -354,16 +403,10 @@
<option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="jboss-portal-portlet.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal/test" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="jsr168api" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -371,35 +414,27 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="jsr168api" />
+ <option name="myItemId" value="portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/jsr168api" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="jboss-portal-portlet.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="federation" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- </PATH>
- <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="jboss-portal-portlet.ipr" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="federation" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
- </PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/federation" />
+ <option name="myItemId" value="PsiDirectory:$PROJECT_DIR$/portlet/src/main/org/jboss/portal/portlet" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -416,7 +451,7 @@
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
- <showStructure PackagesPane="false" ProjectPane="false" />
+ <showStructure PackagesPane="false" Scope="false" ProjectPane="false" />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
@@ -436,18 +471,6 @@
<component name="RecentsManager" />
<component name="RestoreUpdateTree" />
<component name="RunManager">
- <configuration default="true" type="Applet" factoryName="Applet">
- <module name="" />
- <option name="MAIN_CLASS_NAME" />
- <option name="HTML_FILE_NAME" />
- <option name="HTML_USED" value="false" />
- <option name="WIDTH" value="400" />
- <option name="HEIGHT" value="300" />
- <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
- <option name="VM_PARAMETERS" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- </configuration>
<configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -463,6 +486,9 @@
<option name="TEST_SEARCH_SCOPE">
<value defaultName="wholeProject" />
</option>
+ <method>
+ <option name="Make" value="true" />
+ </method>
</configuration>
<configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
<option name="MAIN_CLASS_NAME" />
@@ -481,12 +507,33 @@
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
+ <configuration default="true" type="Applet" factoryName="Applet">
+ <module name="" />
+ <option name="MAIN_CLASS_NAME" />
+ <option name="HTML_FILE_NAME" />
+ <option name="HTML_USED" value="false" />
+ <option name="WIDTH" value="400" />
+ <option name="HEIGHT" value="300" />
+ <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
+ <option name="VM_PARAMETERS" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" />
+ </configuration>
<configuration name="<template>" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
- <component name="ScopeViewComponent" />
+ <component name="ScopeViewComponent">
+ <subPane subId="Project">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
<component name="SelectInManager" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
@@ -553,13 +600,13 @@
</component>
<component name="ToolWindowManager">
<frame x="3" y="34" width="1680" height="958" extended-state="0" />
- <editor active="false" />
+ <editor active="true" />
<layout>
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
<window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="7" />
- <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.329859" order="0" />
+ <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.329859" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.329849" order="1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
@@ -715,6 +762,41 @@
</state>
</provider>
</entry>
+ <entry file="file://$PROJECT_DIR$/portlet/src/main/org/jboss/portal/portlet/deployment/JBossApplicationMetaDataFactory.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="37" column="13" selection-start="2379" selection-end="2379" vertical-scroll-proportion="0.1356784">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/portlet/src/main/org/jboss/portal/test/portlet/session/ReplicatedValue.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="32" column="13" selection-start="2041" selection-end="2041" vertical-scroll-proportion="0.1356784">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/portlet/src/main/org/jboss/portal/test/portlet/session/SessionSynchronizationTestCase.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="30" column="13" selection-start="1955" selection-end="1955" vertical-scroll-proportion="0.13316892">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/portlet/src/resources/test/test-portal-war/WEB-INF/portal-beans.xml">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="31" column="0" selection-start="1998" selection-end="1998" vertical-scroll-proportion="0.45869297">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ <entry file="file://$PROJECT_DIR$/federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="81" column="19" selection-start="3150" selection-end="3150" vertical-scroll-proportion="0.87299633">
+ <folding />
+ </state>
+ </provider>
+ </entry>
</component>
</project>
18 years, 8 months
JBoss Portal SVN: r7998 - branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/server.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-19 18:42:16 -0400 (Sun, 19 Aug 2007)
New Revision: 7998
Modified:
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/server/server.iml
Log:
improve intellij idea file libraries referencing
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/server/server.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/server/server.iml 2007-08-19 22:19:15 UTC (rev 7997)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/server/server.iml 2007-08-19 22:42:16 UTC (rev 7998)
@@ -92,6 +92,33 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/web/lib/portal-web-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss-portal/modules/common/lib/portal-common-portal-lib.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
18 years, 8 months
JBoss Portal SVN: r7997 - in branches/JBoss_Portal_Branch_2_6: server/src/main/org/jboss/portal/web/jboss and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-19 18:19:15 -0400 (Sun, 19 Aug 2007)
New Revision: 7997
Modified:
branches/JBoss_Portal_Branch_2_6/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java
Log:
- update to use latest web module snapshot
- fix the PortletInvokerRegistrationService life cycle callbacks that were not properly written (since I removed the subclassing of AbstractJBossService)
Modified: branches/JBoss_Portal_Branch_2_6/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java 2007-08-19 21:19:58 UTC (rev 7996)
+++ branches/JBoss_Portal_Branch_2_6/portlet-federation/src/main/org/jboss/portal/portlet/federation/impl/PortletInvokerRegistrationService.java 2007-08-19 22:19:15 UTC (rev 7997)
@@ -74,12 +74,12 @@
this.federatingPortletInvoker = federatingPortletInvoker;
}
- protected void startService() throws Exception
+ public void start() throws Exception
{
federatingPortletInvoker.registerInvoker(id, portletInvoker);
}
- protected void stopService() throws Exception
+ public void stop() throws Exception
{
federatingPortletInvoker.unregisterInvoker(id);
}
Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java 2007-08-19 21:19:58 UTC (rev 7996)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/web/jboss/JBossWebContext.java 2007-08-19 22:19:15 UTC (rev 7997)
@@ -26,6 +26,7 @@
import org.jboss.portal.server.servlet.ServletCommand;
import org.jboss.portal.web.spi.ServletContainerContext;
import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.WebAppListener;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -141,4 +142,14 @@
}
}
}
+
+ public boolean addWebAppListener(WebAppListener webAppListener) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not implemented in 2.6");
+ }
+
+ public boolean removeWebAppListener(WebAppListener webAppListener) throws IllegalArgumentException
+ {
+ throw new UnsupportedOperationException("Not implemented in 2.6");
+ }
}
18 years, 8 months
JBoss Portal SVN: r7996 - modules/web/trunk/web.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-19 17:19:58 -0400 (Sun, 19 Aug 2007)
New Revision: 7996
Modified:
modules/web/trunk/web/build.xml
Log:
don't produce tomcat.war as it is not used anymore
Modified: modules/web/trunk/web/build.xml
===================================================================
--- modules/web/trunk/web/build.xml 2007-08-19 21:19:12 UTC (rev 7995)
+++ modules/web/trunk/web/build.xml 2007-08-19 21:19:58 UTC (rev 7996)
@@ -150,15 +150,6 @@
<fileset dir="${build.classes}"/>
</jar>
- <!-- portal-web.jar -->
- <copy todir="${build.resources}/test/tomcat-war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="portal-web-lib.jar"/>
- <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-lib.jar"/>
- </copy>
- <jar jarfile="${build.lib}/tomcat.war">
- <fileset dir="${build.resources}/test/tomcat-war"/>
- </jar>
-
</target>
<!-- ================================================================== -->
18 years, 8 months
JBoss Portal SVN: r7995 - in modules/web/trunk: build/ide/intellij/idea60/modules/web and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-19 17:19:12 -0400 (Sun, 19 Aug 2007)
New Revision: 7995
Added:
modules/web/trunk/web/src/main/org/jboss/portal/web/ServletContainer.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebApp.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppEvent.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppLifeCycleEvent.java
modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppListener.java
modules/web/trunk/web/src/main/org/jboss/portal/web/command/
modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandDispatcher.java
modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandServlet.java
modules/web/trunk/web/src/main/org/jboss/portal/web/command/ServletCommand.java
modules/web/trunk/web/src/main/org/jboss/portal/web/impl/
modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/
modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebApp.java
modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebAppIdFactory.java
Modified:
modules/web/trunk/build/build-thirdparty.xml
modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml
modules/web/trunk/web/build.xml
modules/web/trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
Log:
started to improve and complete the web module by defining more precisely the contract with the servlet container
Modified: modules/web/trunk/build/build-thirdparty.xml
===================================================================
--- modules/web/trunk/build/build-thirdparty.xml 2007-08-19 21:08:39 UTC (rev 7994)
+++ modules/web/trunk/build/build-thirdparty.xml 2007-08-19 21:19:12 UTC (rev 7995)
@@ -51,6 +51,7 @@
<componentref name="apache-log4j" version="1.2.8"/>
<componentref name="junit" version="3.8.1"/>
<componentref name="sun-servlet" version="2.4"/>
+ <componentref name="apache-tomcat" version="5.0.30"/>
</build>
<synchronizeinfo/>
Modified: modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml
===================================================================
--- modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml 2007-08-19 21:08:39 UTC (rev 7994)
+++ modules/web/trunk/build/ide/intellij/idea60/modules/web/web.iml 2007-08-19 21:19:12 UTC (rev 7995)
@@ -17,8 +17,30 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../../jboss-portal-test/thirdparty/apache-log4j/lib/log4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-tomcat/lib/catalina.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
+ <component name="VcsManagerConfiguration">
+ <option name="ACTIVE_VCS_NAME" value="svn" />
+ <option name="USE_PROJECT_VCS" value="false" />
+ </component>
<component name="copyright">
<Base>
<setting name="state" value="1" />
Modified: modules/web/trunk/web/build.xml
===================================================================
--- modules/web/trunk/web/build.xml 2007-08-19 21:08:39 UTC (rev 7994)
+++ modules/web/trunk/web/build.xml 2007-08-19 21:19:12 UTC (rev 7995)
@@ -92,6 +92,7 @@
<path refid="sun.servlet.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
+ <path refid="apache.tomcat.classpath"/>
</path>
<!-- Configure modules -->
@@ -149,6 +150,15 @@
<fileset dir="${build.classes}"/>
</jar>
+ <!-- portal-web.jar -->
+ <copy todir="${build.resources}/test/tomcat-war/WEB-INF/lib">
+ <fileset dir="${build.lib}" includes="portal-web-lib.jar"/>
+ <fileset dir="${jboss.portal/modules/common.lib}" includes="portal-common-lib.jar"/>
+ </copy>
+ <jar jarfile="${build.lib}/tomcat.war">
+ <fileset dir="${build.resources}/test/tomcat-war"/>
+ </jar>
+
</target>
<!-- ================================================================== -->
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/ServletContainer.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/ServletContainer.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/ServletContainer.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+import org.jboss.portal.web.spi.ServletContainerContext;
+
+/**
+ * A static registry for the servlet container context.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServletContainer
+{
+
+ /** . */
+ private static ServletContainerContext _context;
+
+ /**
+ * Register a servlet container context. The registration is considered as successful if no existing context
+ * is already registered.
+ *
+ * @param context the servlet container context to register
+ * @return true if the registration is successful
+ * @throws IllegalArgumentException if the context is null
+ */
+ public synchronized static boolean registerContext(ServletContainerContext context) throws IllegalArgumentException
+ {
+ if (context == null)
+ {
+ throw new IllegalArgumentException("No null context accepted");
+ }
+ if (_context == null)
+ {
+ _context = context;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ /**
+ * Returns the existing servlet container context or null if none is registered.
+ *
+ * @return the registered servlet container context
+ */
+ public synchronized static ServletContainerContext getContext()
+ {
+ return _context;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/WebApp.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebApp.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebApp.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+import java.net.URL;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * Abstraction of a web application.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface WebApp
+{
+
+ /**
+ * Returns the URL of the WEB-INF directory of the web application.
+ *
+ * @return the URL of the WEB-INF directory
+ */
+ URL getWEBINFURL();
+
+ /**
+ * Returns an identifier for the web application valid in the scope of all the web applications deployed.
+ *
+ * @return the web application identifier
+ */
+ String getId();
+
+ /**
+ * Returns the class loader of the web application.
+ *
+ * @return the web application class loader
+ */
+ ClassLoader getClassLoader();
+
+ /**
+ * Returns the context path of the web application.
+ *
+ * @return the web application context path
+ */
+ String getContextPath();
+
+ /**
+ * Import a file in the war file. The file could not be created for some reasons which are :
+ * <ul>
+ * <li>The parent dir exists and is a file</li>
+ * <li>The parent dir does not exist and its creation failed</li>
+ * <li>An underlying exception occurs when writing bytes from the source <code>Inputstream</code> to the target <code>OutputStream</code></li>
+ * </ul>
+ *
+ * @param parentDirRelativePath the parent relative path in the web app starting from the app root
+ * @param name the name the created file should have
+ * @param source the data of the target file
+ * @param overwrite if false and the file already exists nothing is done
+ * @return true if the file has been created
+ * @throws IOException if the file cannot be created
+ */
+ boolean importFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite) throws IOException;
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppEvent.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppEvent.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppEvent.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+/**
+ * Base class for web application events.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class WebAppEvent
+{
+
+ /** The web application. */
+ private final WebApp webApp;
+
+ /**
+ * Construct a new web application event.
+ *
+ * @param webApp the web application
+ * @throws IllegalArgumentException if the provided web application is null
+ */
+ public WebAppEvent(WebApp webApp) throws IllegalArgumentException
+ {
+ if (webApp == null)
+ {
+ throw new IllegalArgumentException("No null web application accepted");
+ }
+ this.webApp = webApp;
+ }
+
+ /**
+ * Returns the web application.
+ *
+ * @return the web application
+ */
+ public WebApp getWebApp()
+ {
+ return webApp;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppLifeCycleEvent.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppLifeCycleEvent.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppLifeCycleEvent.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebAppLifeCycleEvent extends WebAppEvent
+{
+
+ /** Application is removed. */
+ public final static int REMOVED = 0;
+
+ /** Application is added. */
+ public final static int ADDED = 1;
+
+ /** The type of the life cycle which can be <code>ADDED</code> or <code>REMOVED</code> . */
+ private final int type;
+
+ /**
+ * Creates a new web application life cycle event.
+ *
+ * @param webApp the web application
+ * @param type the life cycle type
+ * @throws IllegalArgumentException if the web application is null or the type value is not valid
+ */
+ public WebAppLifeCycleEvent(WebApp webApp, int type)
+ throws IllegalArgumentException
+ {
+ super(webApp);
+
+ //
+ if (type < REMOVED || type > ADDED)
+ {
+ throw new IllegalArgumentException("Type " + type + " not accepted");
+ }
+
+ //
+ this.type = type;
+ }
+
+ /**
+ * Returns the life cycle type.
+ *
+ * @return the life cycle type
+ */
+ public int getType()
+ {
+ return type;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppListener.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppListener.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/WebAppListener.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web;
+
+/**
+ * Defines the contract for listening web application events.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface WebAppListener
+{
+
+ /**
+ * Signal a web application event to the listener.
+ *
+ * @param event the web application event
+ */
+ void onEvent(WebAppEvent event);
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandDispatcher.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandDispatcher.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandDispatcher.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,139 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.command;
+
+import org.jboss.portal.web.RequestDispatchCallback;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CommandDispatcher
+{
+
+ /** . */
+ private static final ThreadLocal localResponse = new ThreadLocal();
+
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception
+ {
+ try
+ {
+ //
+ ServletCommand cmd = new InvokeNextCommand(targetServletContext, callback, handback);
+
+ //
+ CommandServlet.include(req, resp, cmd, targetServletContext);
+
+ // Rethrow any InvocationException
+ Object response = localResponse.get();
+
+ //
+ if (response instanceof Exception)
+ {
+ throw (Exception)response;
+ }
+ else
+ {
+ return response;
+ }
+ }
+ catch (IOException e)
+ {
+ throw e;
+ }
+ catch (ServletException e)
+ {
+ // Unwrap underlying exception if any
+ Throwable t = e.getRootCause();
+
+ //
+ if (t instanceof Error)
+ {
+ // Rethrow any error
+ throw(Error)t;
+ }
+ else if (t instanceof RuntimeException)
+ {
+ throw (RuntimeException)t;
+ }
+ else if (t instanceof Exception)
+ {
+ throw (Exception)t;
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ finally
+ {
+ localResponse.set(null);
+ }
+ }
+
+ public static class InvokeNextCommand implements ServletCommand
+ {
+
+ /** . */
+ private final ServletContext servletContext;
+
+ /** . */
+ private final RequestDispatchCallback invocation;
+
+ /** . */
+ private final Object handback;
+
+ public InvokeNextCommand(ServletContext servletContext, RequestDispatchCallback invocation, Object handback)
+ {
+ this.servletContext = servletContext;
+ this.invocation = invocation;
+ this.handback = handback;
+ }
+
+ public void execute(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ try
+ {
+ Object response = invocation.doCallback(servletContext, req, resp, handback);
+
+ //
+ localResponse.set(response);
+ }
+ catch (Exception e)
+ {
+ localResponse.set(e);
+ }
+ }
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandServlet.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandServlet.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/command/CommandServlet.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,149 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.command;
+
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * This servlet is used to execute command coming from another context through a dispatching request.
+ * <p/>
+ * The command invocation is detyped to allow it working on redeploy and avoid class cast exception.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class CommandServlet extends HttpServlet
+{
+
+ /** . */
+// private static final Logger log = Logger.getLogger(CommandServlet.class);
+
+ /** . */
+ private static final ThreadLocal localCmd = new ThreadLocal();
+
+ /**
+ * Execute a command after having performed a request dispatch in the target servlet context.
+ *
+ * @param cmd the command to execute after the inclusion is done
+ * @param ctx the target servlet context
+ * @throws IOException
+ * @throws ServletException
+ */
+ public static void include(
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ ServletCommand cmd,
+ ServletContext ctx) throws IOException, ServletException
+ {
+ try
+ {
+ localCmd.set(cmd);
+ RequestDispatcher switcher = ctx.getRequestDispatcher("/jbossportlet");
+ switcher.include(req, resp);
+ }
+ finally
+ {
+ localCmd.set(null);
+ }
+ }
+
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ Object cmd = localCmd.get();
+ if (cmd != null)
+ {
+ try
+ {
+ Method methods = cmd.getClass().getMethod(
+ "execute",
+ new Class[]{
+ HttpServletRequest.class,
+ HttpServletResponse.class});
+ methods.invoke(cmd, new Object[]{req, resp});
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new ServletException("No execute method found on the command", e);
+ }
+ catch (InvocationTargetException e)
+ {
+ // Log the wrappee
+ Throwable wrappee = e.getTargetException();
+ // log.error("Exception in command invocation", wrappee);
+
+ // Rethrow the checked ServletException
+ if (wrappee instanceof ServletException)
+ {
+ ServletException se = (ServletException)wrappee;
+ if (se.getCause() == null && se.getRootCause() != null)
+ {
+ se.initCause(se.getRootCause());
+ }
+ throw(ServletException)wrappee;
+ }
+ // Rethrow the checked IOException
+ if (wrappee instanceof IOException)
+ {
+ throw(IOException)wrappee;
+ }
+ // Rethrow RuntimeException
+ if (wrappee instanceof RuntimeException)
+ {
+ throw(RuntimeException)wrappee;
+ }
+ // Rethrow Error
+ if (wrappee instanceof Error)
+ {
+ throw(Error)wrappee;
+ }
+ // Here we wrap it and rethrow
+ ServletException se = new ServletException("The invoked command threw an exception", wrappee);
+ se.initCause(wrappee);
+ throw se;
+ }
+ catch (IllegalAccessException e)
+ {
+ ServletException se = new ServletException("Unexpected IllegalAccessException during command invocation", e);
+ se.initCause(e);
+ throw se;
+ }
+ }
+ else
+ {
+ throw new ServletException("No command found");
+ }
+ }
+
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ doGet(req, resp);
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/command/ServletCommand.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/command/ServletCommand.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/command/ServletCommand.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.command;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+/**
+ * Command to be executed in the command servlet.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ServletCommand
+{
+ void execute(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException;
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6ServletContainerContext.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,253 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl.tomcat;
+
+import org.jboss.portal.web.WebAppListener;
+import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.WebAppEvent;
+import org.jboss.portal.web.WebAppLifeCycleEvent;
+import org.jboss.portal.web.command.CommandDispatcher;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.apache.catalina.LifecycleListener;
+import org.apache.catalina.ContainerListener;
+import org.apache.catalina.LifecycleEvent;
+import org.apache.catalina.Lifecycle;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
+import org.apache.catalina.Container;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.ContainerEvent;
+import org.apache.catalina.Context;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * An implementation of the <code>ServletContainerContext</code> for Tomcat.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6ServletContainerContext implements ServletContainerContext, LifecycleListener, ContainerListener
+{
+
+ /** The monitored hosts. */
+ private final Set monitoredHosts = new HashSet();
+
+ /** The event listeners. */
+ private final ArrayList listeners = new ArrayList();
+
+ /** The web applications. */
+ private final Map webAppMap = new HashMap();
+
+ /** . */
+ private final CommandDispatcher dispatcher = new CommandDispatcher();
+
+ public Object include(
+ ServletContext targetServletContext,
+ HttpServletRequest request,
+ HttpServletResponse response,
+ RequestDispatchCallback callback,
+ Object handback) throws Exception
+ {
+ return dispatcher.include(targetServletContext, request, response, callback, handback);
+ }
+
+ public synchronized boolean addWebAppListener(WebAppListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (listeners.contains(listener))
+ {
+ return false;
+ }
+ listeners.add(listener);
+ for (Iterator i = webAppMap.values().iterator(); i.hasNext();)
+ {
+ TC6WebApp webApp = (TC6WebApp)i.next();
+ WebAppLifeCycleEvent event = new WebAppLifeCycleEvent(webApp, WebAppLifeCycleEvent.ADDED);
+ fireEvent(listener, event);
+ }
+ return true;
+ }
+
+ public synchronized boolean removeWebAppListener(WebAppListener listener)
+ {
+ if (listener == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (listeners.remove(listener))
+ {
+ for (Iterator i = webAppMap.values().iterator(); i.hasNext();)
+ {
+ TC6WebApp webApp = (TC6WebApp)i.next();
+ WebAppLifeCycleEvent event = new WebAppLifeCycleEvent(webApp, WebAppLifeCycleEvent.REMOVED);
+ fireEvent(listener, event);
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public synchronized void lifecycleEvent(LifecycleEvent lifecycleEvent)
+ {
+ Lifecycle lifecycle = lifecycleEvent.getLifecycle();
+ System.out.println("lifecycle = " + lifecycle);
+ if (lifecycle instanceof Server)
+ {
+ Server server = (Server)lifecycle;
+ Service[] services = server.findServices();
+ for (int i = 0; i < services.length; i++)
+ {
+ Service service = services[i];
+ handleContainer(service.getContainer());
+ }
+ }
+ }
+
+ public synchronized void containerEvent(ContainerEvent containerEvent)
+ {
+ if (containerEvent.getData() instanceof Context)
+ {
+ Context context = (Context)containerEvent.getData();
+ String webAppId = TC6WebAppIdFactory.createId(context);
+
+ if ("addChild".equals(containerEvent.getType()))
+ {
+ System.out.println("Context added " + context.getPath());
+ try
+ {
+ if (webAppMap.containsKey(webAppId))
+ {
+ System.out.println("Web application " + webAppId + " is already registered");
+ }
+ else
+ {
+ TC6WebApp webApp = new TC6WebApp(context);
+ System.out.println("Web application " + webAppId + " registration");
+ webApp.instrument();
+ webAppMap.put(webApp.getId(), webApp);
+ fireEvent(new WebAppLifeCycleEvent(webApp, WebAppLifeCycleEvent.ADDED));
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else if ("removeChild".equals(containerEvent.getType()))
+ {
+ try
+ {
+ TC6WebApp webApp = (TC6WebApp)webAppMap.remove(webAppId);
+ if (webApp != null)
+ {
+ System.out.println("Web application " + webAppId + " cleanup");
+ fireEvent(new WebAppLifeCycleEvent(webApp, WebAppLifeCycleEvent.REMOVED));
+ webApp.cleanup();
+ }
+ else
+ {
+ System.out.println("Web application " + webAppId + " is already registered");
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+// synchronized(webAppMap)
+// {
+// for (Iterator i = webAppMap.values().iterator();i.hasNext();)
+// {
+// TC6WebApp webApp = (TC6WebApp)i.next();
+// System.out.println("Web application " + webApp.getId() + " unregistration");
+// webApp.cleanup();
+// i.remove();
+// }
+// }
+
+ private void handleContainer(Container container)
+ {
+ if (container instanceof Engine)
+ {
+ Engine engine = (Engine)container;
+ Container[] childrenContainers = engine.findChildren();
+ for (int i = 0; i < childrenContainers.length; i++)
+ {
+ Container childContainer = childrenContainers[i];
+ handleContainer(childContainer);
+ }
+ }
+ else if (container instanceof Host)
+ {
+ Host host = (Host)container;
+ if (!monitoredHosts.contains(host.getName()))
+ {
+ host.addContainerListener(this);
+ monitoredHosts.add(host.getName());
+ }
+ }
+ else
+ {
+ System.out.println("Container not handled " + container);
+ }
+ }
+
+ private void fireEvent(WebAppListener listener, WebAppEvent event)
+ {
+ try
+ {
+ listener.onEvent(event);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ private void fireEvent(WebAppEvent event)
+ {
+ for (Iterator i = listeners.iterator();i.hasNext();)
+ {
+ fireEvent((WebAppListener)i.next(), event);
+ }
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebApp.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebApp.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebApp.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,139 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl.tomcat;
+
+import org.w3c.dom.Document;
+import org.apache.catalina.Context;
+import org.apache.catalina.Wrapper;
+import org.jboss.portal.web.command.CommandServlet;
+import org.jboss.portal.web.WebApp;
+
+import javax.servlet.ServletContext;
+import java.net.URL;
+import java.io.InputStream;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6WebApp implements WebApp
+{
+
+ /** The logger. */
+// protected final Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private Document descriptor;
+
+ /** . */
+ private ServletContext servletContext;
+
+ /** . */
+ private ClassLoader loader;
+
+ /** . */
+ private URL webinfurl;
+
+ /** . */
+ private String id;
+
+ /** . */
+ private String contextPath;
+
+ /** . */
+ private final Context context;
+
+ /** . */
+ private Wrapper commandServlet;
+
+ TC6WebApp(Context context) throws Exception
+ {
+ this.context = context;
+
+ //
+ servletContext = context.getServletContext();
+ loader = context.getLoader().getClassLoader();
+ id = context.getPath();
+ contextPath = context.getPath();
+ webinfurl = servletContext.getResource("/WEB-INF");
+ }
+
+ void instrument() throws Exception
+ {
+ try
+ {
+ commandServlet = context.createWrapper();
+ commandServlet.setName("JBossServlet");
+ commandServlet.setLoadOnStartup(0);
+ commandServlet.setServletClass(CommandServlet.class.getName());
+ context.addChild(commandServlet);
+ context.addServletMapping("/jbossportlet", "JBossServlet");
+ }
+ catch (Exception e)
+ {
+ cleanup();
+ throw e;
+ }
+ }
+
+ void cleanup()
+ {
+ if (commandServlet != null)
+ {
+ try
+ {
+ context.removeServletMapping("jbossportlet");
+ context.removeChild(commandServlet);
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+
+ public URL getWEBINFURL()
+ {
+ return webinfurl;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return loader;
+ }
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
+ public boolean importFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite) throws IOException
+ {
+ return false;
+ }
+}
Added: modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebAppIdFactory.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebAppIdFactory.java (rev 0)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/impl/tomcat/TC6WebAppIdFactory.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.web.impl.tomcat;
+
+import org.apache.catalina.Context;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TC6WebAppIdFactory
+{
+ public static String createId(Context context)
+ {
+ return context.getPath();
+ }
+}
Modified: modules/web/trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java
===================================================================
--- modules/web/trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java 2007-08-19 21:08:39 UTC (rev 7994)
+++ modules/web/trunk/web/src/main/org/jboss/portal/web/spi/ServletContainerContext.java 2007-08-19 21:19:12 UTC (rev 7995)
@@ -23,13 +23,15 @@
package org.jboss.portal.web.spi;
import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.WebAppListener;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletContext;
/**
- * Defines the service provider interface that a servlet container offers.
+ * Defines the service provider interface for a servlet container. It is an attempt to abstract the non
+ * portable services required by a portal with respect to the web container layer.
*
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -52,4 +54,30 @@
HttpServletResponse response,
RequestDispatchCallback callback,
Object handback) throws Exception;
+
+ /**
+ * Try to add a web application listener on the servlet container context. If the listener is already registered then it
+ * has no effect and the method call returns false, otherwise it adds the listener and returns true. When a listener
+ * is added it will receive add notifications for all web applications already registered. When a new web application
+ * is added in the context, all listeners will receive a notification.
+ *
+ * @param listener the listener
+ * @return true if the listener has been added
+ * @throws IllegalArgumentException if the listener argument is null
+ */
+ boolean addWebAppListener(WebAppListener listener) throws IllegalArgumentException;
+
+ /**
+ * Try to remove a web application listener on the servlet container context. If the listener is not registered then
+ * it has no effect and the method call returns false, otherwise it removes the listener and returns true. When a
+ * listener is removed it will receive remove notifications for all the web applications that are still registered.
+ * When a registered web application is removes from the context, all listeners will receive a notification.
+ *
+ * @param listener
+ * @return
+ * @throws IllegalArgumentException
+ */
+ boolean removeWebAppListener(WebAppListener listener) throws IllegalArgumentException;
+
+
}
18 years, 8 months
JBoss Portal SVN: r7994 - branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-08-19 17:08:39 -0400 (Sun, 19 Aug 2007)
New Revision: 7994
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
Log:
ups... left some system out messages
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java 2007-08-19 19:31:23 UTC (rev 7993)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java 2007-08-19 21:08:39 UTC (rev 7994)
@@ -173,13 +173,13 @@
if (activityBroadcaster != null)
{
- System.out.println("### Broadcasting user activity notification ");
+ log.debug("Broadcasting user activity notification ");
activityBroadcaster.sendNotification(notification);
}
else
{
- System.out.println("### Sending local user activity notification ");
+ log.debug("Sending local user activity notification ");
sendNotification(notification);
}
@@ -195,7 +195,7 @@
public void handleNotification(Notification notification, Object object)
{
- System.out.println("### Handling user activity notification ");
+ log.debug("Handling user activity notification ");
final UserActivity ac = new UserActivity(notification);
FutureTask task = new FutureTask(new Callable()
18 years, 8 months
JBoss Portal SVN: r7993 - trunk/core/src/main/org/jboss/portal/core/model/portal.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-08-19 15:31:23 -0400 (Sun, 19 Aug 2007)
New Revision: 7993
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java
Log:
forgot to sync code revert from 2.6 branch
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java 2007-08-19 18:01:55 UTC (rev 7992)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectPath.java 2007-08-19 19:31:23 UTC (rev 7993)
@@ -365,10 +365,7 @@
{
break;
}
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- length++;
- }
+ length++;
previous = next + 1;
}
@@ -376,26 +373,17 @@
String[] names = new String[length];
length = 0;
previous = 1;
- int next = 1;
while (true)
{
- next = value.indexOf(PATH_SEPARATOR, next);
+ int next = value.indexOf(PATH_SEPARATOR, previous);
if (next == -1)
{
break;
}
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- String name = value.substring(previous, next);
- name = decodeName(name);
- names[length++] = name;
- previous = next + 1;
- }
- next++;
+ names[length++] = value.substring(previous, next);
+ previous = next + 1;
}
- String name = value.substring(previous);
- name = decodeName(name);
- names[length] = name;
+ names[length] = value.substring(previous);
//
return names;
@@ -418,23 +406,11 @@
{
throw new IllegalArgumentException("No null name expected in the name string array");
}
- name = encodeName(name);
tmp.append(PATH_SEPARATOR).append(name);
}
return tmp.toString();
}
}
-
- protected String decodeName(String name)
- {
- return name.replaceAll("\\/", "/");
- }
-
- protected String encodeName(String name)
- {
- return name.replaceAll("/", "\\/");
- }
-
}
;
@@ -462,25 +438,18 @@
int length = 1;
for (int next = value.indexOf('.'); next != -1; next = value.indexOf('.', next + 1))
{
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- length++;
- }
+ length++;
}
//
String[] names = new String[length];
length = 0;
int previous = 0;
- for (int next = value.indexOf('.'); next != -1; next = value.indexOf('.', next + 1))
+ for (int next = value.indexOf('.'); next != -1; previous = next + 1, next = value.indexOf('.', next + 1))
{
- if (next > 0 && value.charAt(next-1) != '\\')
- {
- String name = value.substring(previous, next);
- name = decodeName(name);
- names[length++] = name;
- previous = next + 1;
- }
+ String name = value.substring(previous, next);
+ name = decodeName(name);
+ names[length++] = name;
}
String name = value.substring(previous);
name = decodeName(name);
@@ -521,12 +490,12 @@
protected String decodeName(String name)
{
- return name.replaceAll("\\.", ".");
+ return name;
}
protected String encodeName(String name)
{
- return name.replaceAll(".", "\\.");
+ return name;
}
}
18 years, 8 months
JBoss Portal SVN: r7992 - in branches/JBoss_Portal_Branch_2_6: build/ide/intellij/idea60/modules/core and 20 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-08-19 14:01:55 -0400 (Sun, 19 Aug 2007)
New Revision: 7992
Added:
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/CurrentUsersPortlet.java
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/event/
branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/event/UserEventListener.java
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/META-INF/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jboss-portlet.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/oneUser.jsp
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portal-lib.tld
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet-instances.xml
branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcaster.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsService.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
Modified:
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core/core.iml
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/identity/identity.iml
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/migration/migration.iml
branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/widget/widget.iml
branches/JBoss_Portal_Branch_2_6/core-samples/build.xml
branches/JBoss_Portal_Branch_2_6/core/build.xml
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
Log:
JBPORTAL-1606 - Portlet and service to see current users online.
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -295,6 +295,7 @@
<copy file="../core-samples/output/lib/portal-news-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-samples/output/lib/portal-jsp-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-samples/output/lib/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../core-samples/output/lib/portal-users-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<!--<copy file="../core-search/output/lib/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>-->
<copy file="../widget/output/lib/widget.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../wsrp/output/lib/portal-wsrp.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
@@ -312,6 +313,7 @@
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-news-samples.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-jsp-samples.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-users-samples.sar"/>
<!--<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
<delete file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core/core.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core/core.iml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core/core.iml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -276,6 +276,33 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/oswego-concurrent/lib/concurrent.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jboss/backport-concurrent/lib/jboss-backport-concurrent.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jbossha.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core-samples/core-samples.iml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/core-samples/core-samples.iml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -51,6 +51,15 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-jmx.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/identity/identity.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/identity/identity.iml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/identity/identity.iml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -82,7 +82,6 @@
<SOURCES />
</library>
</orderEntry>
- <orderEntry type="module" module-name="jems" />
<orderEntry type="module-library">
<library>
<CLASSES>
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/migration/migration.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/migration/migration.iml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/migration/migration.iml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -79,7 +79,7 @@
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
- <option name="ACTIVE_VCS_NAME" value="CVS" />
+ <option name="ACTIVE_VCS_NAME" value="svn" />
<option name="USE_PROJECT_VCS" value="false" />
</component>
<component name="copyright">
Modified: branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/widget/widget.iml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/widget/widget.iml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/build/ide/intellij/idea60/modules/widget/widget.iml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -48,6 +48,24 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-common.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: branches/JBoss_Portal_Branch_2_6/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -90,6 +90,7 @@
<path refid="jboss.portal/modules/common.classpath"/>
<path refid="jboss.portal/modules/web.classpath"/>
<path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss/backport.concurrent.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="jboss.cache.classpath"/>
<path refid="jbossas/core.libs.classpath"/>
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivity.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,117 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.identity;
+
+import javax.management.Notification;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:jedim@vige.it">Luca Stancapiano</a>
+ * @version $Revision: 0.1 $
+ */
+public class UserActivity
+{
+
+ public static final int NAVIGATION = 0;
+
+ public static final int SIGN_OUT = 1;
+
+ private String id;
+
+ private long timestamp;
+
+ private final int type;
+
+ private UserActivity()
+ {
+ this.type = NAVIGATION;
+ }
+
+ public UserActivity(String id, long timestamp, int type)
+ {
+ if (id == null)
+ {
+ throw new IllegalArgumentException("Id cannot be null");
+ }
+
+ this.id = id;
+ this.timestamp = timestamp;
+ this.type = type;
+ }
+
+ public UserActivity(Notification notification)
+ {
+ if (notification.getMessage() == null)
+ {
+ throw new IllegalArgumentException("Id (notification message) cannot be null");
+ }
+ this.id = notification.getMessage();
+ this.timestamp = notification.getTimeStamp();
+ this.type = Integer.parseInt(notification.getType());
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public long getTimestamp()
+ {
+ return timestamp;
+ }
+
+ public int getType()
+ {
+ return type;
+ }
+
+
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ UserActivity that = (UserActivity)o;
+
+ if (!id.equals(that.id))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = id.hashCode();
+ return result;
+ }
+
+}
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcaster.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcaster.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcaster.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,37 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.identity;
+
+import org.jboss.ha.jmx.HAServiceMBeanSupport;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class UserActivityNotificationBroadcaster extends HAServiceMBeanSupport implements UserActivityNotificationBroadcasterMBean
+{
+ /**
+ * Nothing special at the moment...
+ */
+
+}
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UserActivityNotificationBroadcasterMBean.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,42 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.identity;
+
+import org.jboss.ha.jmx.HAServiceMBean;
+
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.NotificationFilter;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public interface UserActivityNotificationBroadcasterMBean //extends HAServiceMBean
+{
+ public String getPartitionName();
+
+ public void sendNotification(Notification notification);
+
+ public void addNotificationListener(NotificationListener notificationListener, NotificationFilter notificationFilter, Object object);
+}
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsService.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsService.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,41 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.identity;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public interface UsersActivityStatsService
+{
+
+ public Set getActiveUsersIds(long period);
+
+ public Set getActiveUsersNames(long period);
+
+ public Set getUsersActivities(long period);
+
+ public void registerActivity(final UserActivity userActivity);
+}
Added: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/identity/UsersActivityStatsServiceImpl.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,322 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.portal.core.identity;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.logging.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+
+import java.util.Set;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.ScheduledExecutorService;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.Executors;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+import edu.emory.mathcs.backport.java.util.concurrent.FutureTask;
+import edu.emory.mathcs.backport.java.util.concurrent.Callable;
+import edu.emory.mathcs.backport.java.util.Queue;
+
+import javax.management.NotificationListener;
+import javax.management.Notification;
+import javax.management.ObjectName;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
+ * @author <a href="mailto:jedim@vige.it">Luca Stancapiano</a>
+ * @version $Revision: 0.1 $
+ */
+public class UsersActivityStatsServiceImpl extends AbstractJBossService implements UsersActivityStatsService, NotificationListener
+{
+ /** Our logger. */
+ private static final Logger log = Logger.getLogger(UsersActivityStatsServiceImpl.class);
+
+ //TODO: some value just to begin - find some good default
+ private int userTrackerThreadsNumber = 10;
+
+ private int updaterThreadsNumber = 1;
+
+ private int updaterInterval = 1000;
+
+ private int activityQueueLimit = 1000;
+
+ private long activityTimeout = 1800000;
+
+ private Executor userTrackerExecutor;
+
+ private ScheduledExecutorService updaterExecutor;
+
+ private Queue activityQueue;
+
+ private volatile Set activityResults = new HashSet();
+
+ private UserActivityNotificationBroadcasterMBean activityBroadcaster;
+
+ public UsersActivityStatsServiceImpl()
+ {
+ }
+
+ protected void startService() throws Exception
+ {
+ super.startService();
+
+ activityQueue = new LinkedBlockingQueue(getActivityQueueLimit());
+
+ userTrackerExecutor = Executors.newFixedThreadPool(getUserTrackerThreadsNumber());
+
+ updaterExecutor = Executors.newScheduledThreadPool(getUpdaterThreadsNumber());
+
+ updaterExecutor.scheduleWithFixedDelay(new Updater(activityQueue), getUpdaterInterval(), getUpdaterInterval(), TimeUnit.MILLISECONDS);
+
+ if (activityBroadcaster != null)
+ {
+ activityBroadcaster.addNotificationListener(this, null, null);
+ }
+ else
+ {
+ addNotificationListener(this, null, null);
+ }
+
+
+ }
+
+ protected void stopService() throws Exception
+ {
+ super.stopService();
+
+ // /TODO: stop all the threads
+ }
+
+ public Set getActiveUsersIds(long period)
+ {
+ long currentTime = System.currentTimeMillis();
+
+ Set results = new HashSet();
+ for (Iterator iterator = activityResults.iterator(); iterator.hasNext();)
+ {
+ UserActivity ua = (UserActivity)iterator.next();
+ if (currentTime - ua.getTimestamp() < period)
+ {
+ results.add(ua.getId());
+ }
+ }
+ return results;
+ }
+
+ public Set getActiveUsersNames(long period)
+ {
+ long currentTime = System.currentTimeMillis();
+ Set results = new HashSet();
+ for (Iterator iterator = activityResults.iterator(); iterator.hasNext();)
+ {
+ UserActivity ua = (UserActivity)iterator.next();
+ if (currentTime - ua.getTimestamp() < period)
+ {
+ results.add(ua.getId());
+ }
+ }
+ return results;
+ }
+
+ public Set getUsersActivities(long period)
+ {
+ long currentTime = System.currentTimeMillis();
+ Set results = new HashSet();
+ for (Iterator iterator = activityResults.iterator(); iterator.hasNext();)
+ {
+ UserActivity ua = (UserActivity)iterator.next();
+ if (currentTime - ua.getTimestamp() < period)
+ {
+ results.add(ua);
+ }
+ }
+ return results;
+ }
+
+ public void registerActivity(final UserActivity userActivity)
+ {
+ try
+ {
+ Notification notification = new Notification(Integer.toString(userActivity.getType()),
+ this.getServiceName(),
+ userActivity.getTimestamp(),
+ userActivity.getTimestamp(),
+ userActivity.getId());
+
+
+ if (activityBroadcaster != null)
+ {
+ System.out.println("### Broadcasting user activity notification ");
+
+ activityBroadcaster.sendNotification(notification);
+ }
+ else
+ {
+ System.out.println("### Sending local user activity notification ");
+ sendNotification(notification);
+ }
+
+ }
+ catch (Exception e)
+ {
+ log.error("Failed to send user activity notification: ", e);
+ }
+
+
+
+ }
+
+ public void handleNotification(Notification notification, Object object)
+ {
+ System.out.println("### Handling user activity notification ");
+ final UserActivity ac = new UserActivity(notification);
+
+ FutureTask task = new FutureTask(new Callable()
+ {
+ public Object call() throws Exception
+ {
+
+ boolean success = activityQueue.offer(ac);
+ if (log.isTraceEnabled())
+ {
+ if (!success)
+ {
+ log.trace("Failed track user activity - activityQueue is full ");
+ }
+ }
+ return null;
+ }
+ });
+
+ userTrackerExecutor.execute(task);
+ }
+
+
+ public int getUserTrackerThreadsNumber()
+ {
+ return userTrackerThreadsNumber;
+ }
+
+ public void setUserTrackerThreadsNumber(int userTrackerThreadsNumber)
+ {
+ this.userTrackerThreadsNumber = userTrackerThreadsNumber;
+ }
+
+ public int getUpdaterThreadsNumber()
+ {
+ return updaterThreadsNumber;
+ }
+
+ public void setUpdaterThreadsNumber(int updaterThreadsNumber)
+ {
+ this.updaterThreadsNumber = updaterThreadsNumber;
+ }
+
+ public int getUpdaterInterval()
+ {
+ return updaterInterval;
+ }
+
+ public void setUpdaterInterval(int updaterInterval)
+ {
+ this.updaterInterval = updaterInterval;
+ }
+
+ public int getActivityQueueLimit()
+ {
+ return activityQueueLimit;
+ }
+
+ public void setActivityQueueLimit(int activityQueueLimit)
+ {
+ this.activityQueueLimit = activityQueueLimit;
+ }
+
+ public long getActivityTimeout()
+ {
+ return activityTimeout;
+ }
+
+ public void setActivityTimeout(long activityTimeout)
+ {
+ this.activityTimeout = activityTimeout;
+ }
+
+ public UserActivityNotificationBroadcasterMBean getActivityBroadcaster()
+ {
+ return activityBroadcaster;
+ }
+
+ public void setActivityBroadcaster(UserActivityNotificationBroadcasterMBean activityBroadcaster)
+ {
+ this.activityBroadcaster = activityBroadcaster;
+ }
+
+ private class Updater implements Runnable
+ {
+ private final Queue activityQueue;
+
+ public Updater(Queue activityQueue)
+ {
+ this.activityQueue = activityQueue;
+ }
+
+ //never run
+ private Updater()
+ {
+ this.activityQueue = null;
+ }
+
+ public void run()
+ {
+ long currentTime = System.currentTimeMillis();
+
+ Set stillActive = getUsersActivities(activityTimeout);
+
+ while (!activityQueue.isEmpty())
+ {
+ UserActivity activity = (UserActivity)activityQueue.poll();
+ if (activity != null && ((currentTime - activity.getTimestamp()) < activityTimeout))
+ {
+ if (activity.getType() != UserActivity.SIGN_OUT)
+ stillActive.add(activity);
+ else
+ stillActive.remove(activity);
+ }
+ }
+
+ activityResults = Collections.unmodifiableSet(stillActive);
+
+ }
+ }
+
+
+}
+
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -66,7 +66,7 @@
name="portal:service=AuthorizationDomainRegistry"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
+ <xmbean/>
</mbean>
<mbean
code="org.jboss.portal.security.impl.jacc.JACCPortalAuthorizationManagerFactory"
@@ -451,7 +451,7 @@
<attribute name="CacheMode">REPL_SYNC</attribute>
<attribute name="ClusterName">portal.hibernate</attribute>
</mbean>
-
+
<mbean
code="org.jboss.portal.jems.hibernate.JBossTreeCacheProvider"
name="portal:service=TreeCacheProvider,type=hibernate">
@@ -570,6 +570,38 @@
<attribute name="AuthConfig">conf/login-config.xml</attribute>
</mbean>
+ <!-- a service to schedule activity of the users -->
+ <mbean
+ code="org.jboss.portal.core.identity.UsersActivityStatsServiceImpl"
+ name="portal:service=Module,type=UsersActivityStatsService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <!--
+ |Uncomment in clustered mode : broadcaster will spread info about user activity in cluster
+ @portal.single.xml.close@
+
+ <depends
+ optional-attribute-name="ActivityBroadcaster"
+ proxy-type="attribute">portal:service=HAUserActivityNotificationBroadcaster</depends>
+
+ @portal.single.xml.open@
+ -->
+ </mbean>
+
+ <!--
+ |Uncomment in clustered mode : broadcaster will spread info about user activity in cluster
+ @portal.single.xml.close@
+
+ <mbean code="org.jboss.portal.core.identity.UserActivityNotificationBroadcaster"
+ name="portal:service=HAUserActivityNotificationBroadcaster">
+ <depends>jboss:service=${jboss.partition.name:DefaultPartition}</depends>
+ </mbean>
+
+ @portal.single.xml.open@
+ -->
+
+
<!-- Registries -->
<mbean
code="org.jboss.portal.portlet.impl.container.PortletApplicationRegistryImpl"
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -163,6 +163,12 @@
<region>left</region>
<height>1</height>
</window>
+ <window>
+ <window-name>CurrentUsersPortletWindow</window-name>
+ <instance-ref>CurrentUsersPortletInstance</instance-ref>
+ <region>left</region>
+ <height>2</height>
+ </window>
</page>
</portal>
</deployment>
Modified: branches/JBoss_Portal_Branch_2_6/core-samples/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/build.xml 2007-08-18 20:25:26 UTC (rev 7991)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/build.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -235,6 +235,22 @@
<fileset dir="${build.classes}" includes="org/jboss/portal/core/samples/weather/**"/>
</jar>
+
+ <!-- portal-users-samples-lib.jar -->
+ <jar jarfile="${build.lib}/portal-users-samples-lib.jar">
+ <fileset dir="${build.classes}" includes="org/jboss/portal/core/samples/users/**">
+ </fileset>
+ </jar>
+ <copy todir="${build.resources}/portal-users-samples.sar">
+ <fileset dir="${build.resources}/portal-users-samples-sar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-users-samples.sar/portal-users-samples.war">
+ <fileset dir="${build.resources}/portal-users-samples-war"/>
+ </copy>
+ <copy todir="${build.resources}/portal-users-samples.sar/lib">
+ <fileset dir="${build.lib}" includes="portal-users-samples-lib.jar"/>
+ </copy>
+
</target>
<!-- Build the portal-basic-samples.sar -->
@@ -251,6 +267,9 @@
<implode
dir="${build.resources}/portal-weather-samples.war"
tofile="${build.lib}/portal-weather-samples.war"/>
+ <implode
+ dir="${build.resources}/portal-users-samples.sar"
+ tofile="${build.lib}/portal-users-samples.sar"/>
</target>
<!-- create artifacts for running the portlet tests (except TCK) target output should have already been executed -->
@@ -300,7 +319,8 @@
<copy file="${build.lib}/portal-basic-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="${build.lib}/portal-jsp-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="${build.lib}/portal-news-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
- <copy file="${build.lib}/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="${build.lib}/portal-users-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
<!--
@@ -314,6 +334,7 @@
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-jsp-samples.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-news-samples.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-users-samples.sar"/>
</target>
<target name="tests" depends="init, _buildmagic:configure:deployment">
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/CurrentUsersPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/CurrentUsersPortlet.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/CurrentUsersPortlet.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.portal.core.samples.users;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Set;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.UnavailableException;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.core.identity.UsersActivityStatsService;
+import org.jboss.portal.core.servlet.jsp.PortalJsp;
+import org.jboss.portal.core.servlet.jsp.taglib.context.DelegateContext;
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+/**
+ * Read the current users online and write them in output.
+ *
+ * @author <a href="mailto:jedim@vige.it">Luca Stancapiano</a>
+ */
+public class CurrentUsersPortlet extends JBossPortlet {
+
+ /**
+ * Logger
+ */
+ public static Logger log = Logger.getLogger(CurrentUsersPortlet.class);
+
+ protected void doView(JBossRenderRequest rRequest, JBossRenderResponse rResponse)
+ throws PortletException, IOException, UnavailableException {
+ UsersActivityStatsService uass = (UsersActivityStatsService) this
+ .getPortletContext().getAttribute("UsersActivityStats");
+
+ rResponse.setContentType("text/html");
+ PrintWriter writer = rResponse.getWriter();
+
+ //TODO: this is wrong - should pass period instead of current time - actually it works by a coincedence...
+ Set users = uass.getActiveUsersNames(System.currentTimeMillis());
+
+ if (users.size() == 1) {
+ DelegateContext ctx = new DelegateContext();
+ ctx.put("USERS", users.toString());
+ ctx.put("USERS_COUNT", Integer.toString(users.size()));
+ rRequest.setAttribute(PortalJsp.CTX_REQUEST, ctx);
+ PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/users/oneUser.jsp");
+ rd.include(rRequest, rResponse);
+ } else if (users.size() > 1) {
+ DelegateContext ctx = new DelegateContext();
+ ctx.put("USERS", users.toString());
+ ctx.put("USERS_COUNT", Integer.toString(users.size()));
+ rRequest.setAttribute(PortalJsp.CTX_REQUEST, ctx);
+ PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/users/users.jsp");
+ rd.include(rRequest, rResponse);
+ } else {
+ PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/users/noUser.jsp");
+ rd.include(rRequest, rResponse);
+ }
+
+
+ writer.close();
+ }
+}
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/event/UserEventListener.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/event/UserEventListener.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/main/org/jboss/portal/core/samples/user/event/UserEventListener.java 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.samples.users.event;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.log4j.Logger;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.portal.api.event.PortalEvent;
+import org.jboss.portal.api.event.PortalEventContext;
+import org.jboss.portal.api.event.PortalEventListener;
+import org.jboss.portal.api.user.event.UserAuthenticationEvent;
+import org.jboss.portal.core.identity.UserActivity;
+import org.jboss.portal.core.identity.UsersActivityStatsService;
+
+/**
+ * @author <a href="mailto:jedim@vige.it">Luca Stancapiano</a>
+ * @version $Revision: 1.1 $
+ */
+public class UserEventListener implements PortalEventListener
+{
+
+ /**
+ * Our logger.
+ */
+ private static final Logger log = Logger
+ .getLogger(UserEventListener.class);
+
+ private UsersActivityStatsService activityService;
+
+ public UsersActivityStatsService getStatsService()
+ {
+ if (activityService == null)
+ {
+ try
+ {
+ MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+ activityService = (UsersActivityStatsService)MBeanProxy
+ .get(
+ UsersActivityStatsService.class,
+ new ObjectName(
+ "portal:service=Module,type=UsersActivityStatsService"),
+ mbeanServer);
+ }
+ catch (MBeanProxyCreationException e)
+ {
+ log
+ .error(
+ "could not obtain a proxy for User Activity Statistics Service",
+ e);
+ }
+ catch (MalformedObjectNameException e2)
+ {
+ log
+ .error(
+ "object name to obtain User Activity Statistics Service is wrong",
+ e2);
+ }
+ }
+ return activityService;
+ }
+
+ public void onEvent(PortalEventContext eventContext, PortalEvent event)
+ {
+ if (event instanceof UserAuthenticationEvent)
+ {
+
+ UserAuthenticationEvent userEvent = (UserAuthenticationEvent)event;
+
+ UserActivity userActivity = null;
+
+ if (userEvent.getType() == UserAuthenticationEvent.SIGN_IN)
+ {
+ userActivity = new UserActivity(userEvent.getUserId(), System
+ .currentTimeMillis(), UserActivity.NAVIGATION);
+ }
+ else if (userEvent.getType() == UserAuthenticationEvent.SIGN_OUT)
+ {
+ userActivity = new UserActivity(userEvent.getUserId(), System
+ .currentTimeMillis(), UserActivity.SIGN_OUT);
+ }
+ getStatsService().registerActivity(userActivity);
+ }
+ }
+}
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/META-INF/jboss-service.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-sar/META-INF/jboss-service.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=counter_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">counter_listener</attribute>
+ <attribute name="ListenerClassName">org.jboss.portal.core.samples.users.event.UserEventListener</attribute>
+ </mbean>
+
+</server>
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource.properties (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource.properties 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,32 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+
+NO_USERS_ONLINE=No user is logged
+ONE_USER_ONLINE_0=Actually there is <b>
+ONE_USER_ONLINE_1=</b> user online:
+ONE_USER_IS_0=<b>
+ONE_USER_IS_1=</b>
+USERS_ONLINE_0=Actually there are <b>
+USERS_ONLINE_1=</b> users online:
+USERS_ARE_0=<b>
+USERS_ARE_1=</b>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/classes/Resource_it.properties 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,32 @@
+################################################################################
+# JBoss, a division of Red Hat #
+# Copyright 2006, Red Hat Middleware, LLC, and individual #
+# contributors as indicated by the @authors tag. See the #
+# copyright.txt in the distribution for a full listing of #
+# individual contributors. #
+# #
+# This is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU Lesser General Public License as #
+# published by the Free Software Foundation; either version 2.1 of #
+# the License, or (at your option) any later version. #
+# #
+# This software is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
+# Lesser General Public License for more details. #
+# #
+# You should have received a copy of the GNU Lesser General Public #
+# License along with this software; if not, write to the Free #
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA #
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
+################################################################################
+
+NO_USERS_ONLINE=Nessun utente e' online
+ONE_USER_ONLINE_0=Al momento c'e' <b>
+ONE_USER_ONLINE_1=</b> utente online:
+ONE_USER_IS_0=<b>
+ONE_USER_IS_1=</b>
+USERS_ONLINE_0=Al momento ci sono <b>
+USERS_ONLINE_1=</b> utenti online:
+USERS_ARE_0=<b>
+USERS_ARE_1=</b>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jboss-portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jboss-portlet.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jboss-portlet.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,40 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <remotable>true</remotable>
+
+ <portlet>
+ <portlet-name>CurrentUsersPortlet</portlet-name>
+ </portlet>
+
+ <service>
+ <service-name>UsersActivityStats</service-name>
+ <service-class>org.jboss.portal.core.identity.UsersActivityStatsService</service-class>
+ <service-ref>:service=Module,type=UsersActivityStatsService</service-ref>
+ </service>
+</portlet-app>
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/noUser.jsp 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,40 @@
+<%@ page import="org.jboss.portal.core.CoreConstants" %>
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ JBoss, a division of Red Hat ~
+~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+~ contributors as indicated by the @authors tag. See the ~
+~ copyright.txt in the distribution for a full listing of ~
+~ individual contributors. ~
+~ ~
+~ This is free software; you can redistribute it and/or modify it ~
+~ under the terms of the GNU Lesser General Public License as ~
+~ published by the Free Software Foundation; either version 2.1 of ~
+~ the License, or (at your option) any later version. ~
+~ ~
+~ This software is distributed in the hope that it will be useful, ~
+~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+~ Lesser General Public License for more details. ~
+~ ~
+~ You should have received a copy of the GNU Lesser General Public ~
+~ License along with this software; if not, write to the Free ~
+~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+<portlet:defineObjects/>
+
+<div class="box" align="center">
+ <table border="0" class="portlet-font" cellspacing="0" cellpadding="2">
+ <tr>
+ <td colspan="1">
+ <span class="portlet-text">
+ ${n:i18n("NO_USERS_ONLINE")}
+ </span>
+ </td>
+ </tr>
+ </table>
+</div>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/oneUser.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/oneUser.jsp (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/oneUser.jsp 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,46 @@
+<%@ page import="org.jboss.portal.core.CoreConstants" %>
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ JBoss, a division of Red Hat ~
+~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+~ contributors as indicated by the @authors tag. See the ~
+~ copyright.txt in the distribution for a full listing of ~
+~ individual contributors. ~
+~ ~
+~ This is free software; you can redistribute it and/or modify it ~
+~ under the terms of the GNU Lesser General Public License as ~
+~ published by the Free Software Foundation; either version 2.1 of ~
+~ the License, or (at your option) any later version. ~
+~ ~
+~ This software is distributed in the hope that it will be useful, ~
+~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+~ Lesser General Public License for more details. ~
+~ ~
+~ You should have received a copy of the GNU Lesser General Public ~
+~ License along with this software; if not, write to the Free ~
+~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+<portlet:defineObjects/>
+
+<div class="box" align="center">
+ <table border="0" class="portlet-font" cellspacing="0" cellpadding="2">
+ <tr>
+ <td colspan="1">
+ <span class="portlet-text">
+ ${n:i18n("ONE_USER_ONLINE_0")}
+ ${n:out("USERS_COUNT")}
+ ${n:i18n("ONE_USER_ONLINE_1")}
+ <br/><br/>
+ ${n:i18n("ONE_USER_IS_0")}
+ ${n:out("USERS")}
+ ${n:i18n("ONE_USER_IS_1")}
+ </span>
+ </td>
+ </tr>
+ </table>
+</div>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/jsp/users/users.jsp 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,46 @@
+<%@ page import="org.jboss.portal.core.CoreConstants" %>
+<%--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+~ JBoss, a division of Red Hat ~
+~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+~ contributors as indicated by the @authors tag. See the ~
+~ copyright.txt in the distribution for a full listing of ~
+~ individual contributors. ~
+~ ~
+~ This is free software; you can redistribute it and/or modify it ~
+~ under the terms of the GNU Lesser General Public License as ~
+~ published by the Free Software Foundation; either version 2.1 of ~
+~ the License, or (at your option) any later version. ~
+~ ~
+~ This software is distributed in the hope that it will be useful, ~
+~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+~ Lesser General Public License for more details. ~
+~ ~
+~ You should have received a copy of the GNU Lesser General Public ~
+~ License along with this software; if not, write to the Free ~
+~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--%>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+<portlet:defineObjects/>
+
+<div class="box" align="center">
+ <table border="0" class="portlet-font" cellspacing="0" cellpadding="2">
+ <tr>
+ <td colspan="1">
+ <span class="portlet-text">
+ ${n:i18n("USERS_ONLINE_0")}
+ ${n:out("USERS_COUNT")}
+ ${n:i18n("USERS_ONLINE_1")}
+ <br/><br/>
+ ${n:i18n("USERS_ARE_0")}
+ ${n:out("USERS")}
+ ${n:i18n("USERS_ARE_1")}
+ </span>
+ </td>
+ </tr>
+ </table>
+</div>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portal-lib.tld
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portal-lib.tld (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portal-lib.tld 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,104 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+ version="2.0">
+ <tlib-version>1.1</tlib-version>
+ <short-name>JBoss-Portal-tags</short-name>
+
+ <tag>
+ <name>if</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>iterate</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>include</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>page</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>error</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>key</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>errors</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorsTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+
+ <tag>
+ <name>success</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.SuccessTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+ <function>
+ <name>i18n</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String getMessage(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>out</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String out(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>i18nout</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature>
+ </function>
+
+</taglib>
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet-instances.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet-instances.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet-instances.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>CurrentUsersPortletInstance</instance-id>
+ <portlet-ref>CurrentUsersPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Added: branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/core-samples/src/resources/portal-users-samples-war/WEB-INF/portlet.xml 2007-08-19 18:01:55 UTC (rev 7992)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Current users portlet</description>
+ <portlet-name>CurrentUsersPortlet</portlet-name>
+ <display-name>Current Users Portlet</display-name>
+ <portlet-class>org.jboss.portal.core.samples.users.CurrentUsersPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <supported-locale>it</supported-locale>
+ <resource-bundle>Resource</resource-bundle>
+ <portlet-info>
+ <title>Current users</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>
18 years, 8 months