Author: julien(a)jboss.com
Date: 2007-01-17 17:16:04 -0500 (Wed, 17 Jan 2007)
New Revision: 6023
Added:
trunk/build/ide/intellij/idea60/modules/core-management/
trunk/build/ide/intellij/idea60/modules/core-management/core-management.iml
trunk/core-management/
trunk/core-management/build.bat
trunk/core-management/build.sh
trunk/core-management/build.xml
trunk/core-management/src/
trunk/core-management/src/main/
trunk/core-management/src/main/org/
trunk/core-management/src/main/org/jboss/
trunk/core-management/src/main/org/jboss/portal/
trunk/core-management/src/main/org/jboss/portal/core/
trunk/core-management/src/main/org/jboss/portal/core/management/
trunk/core-management/src/main/org/jboss/portal/core/management/Portal.java
trunk/core-management/src/main/org/jboss/portal/core/management/PortalImpl.java
trunk/core-management/src/main/org/jboss/portal/core/management/PortletDiscoveryService.java
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagement.java
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagementMBean.java
trunk/core-management/src/resources/
trunk/core-management/src/resources/portal-management-sar/
trunk/core-management/src/resources/portal-management-sar/META-INF/
trunk/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml
Removed:
trunk/core/src/main/org/jboss/portal/core/management/
Modified:
trunk/core/build.xml
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/tools/etc/buildfragments/modules.ent
Log:
modulaized core management integration into core-management
Added: trunk/build/ide/intellij/idea60/modules/core-management/core-management.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core-management/core-management.iml
(rev 0)
+++ trunk/build/ide/intellij/idea60/modules/core-management/core-management.iml 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="true">
+ <exclude-output />
+ <content
url="file://$MODULE_DIR$/../../../../../../core-management">
+ <sourceFolder
url="file://$MODULE_DIR$/../../../../../../core-management/src/main"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module" module-name="core" />
+ <orderEntry type="module" module-name="portlet" />
+ <orderEntry type="module" module-name="common" />
+ <orderEntry type="module" module-name="jems" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/../../../../../../thirdparty/jbossas/core-libs/lib/jboss-system.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <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>
+ <orderEntry type="module" module-name="federation" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-01-17 21:32:24 UTC (rev 6022)
+++ trunk/core/build.xml 2007-01-17 22:16:04 UTC (rev 6023)
@@ -506,13 +506,6 @@
<copy file="${build.lib}/jboss-portal-ha.sar"
todir="${jboss.home}/server/${portal-ha.deploy.dir}"/>
</target>
- <target name="deploy-management"
- description="Deploy."
- depends="output">
- <require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/portal-management.war"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
- </target>
-
<!--
| Undeploy the application
-->
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-17
21:32:24 UTC (rev 6022)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-01-17
22:16:04 UTC (rev 6023)
@@ -23,52 +23,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<server>
- <!-- Management -->
-
- <!-- Portlet discovery executed every 30 seconds -->
- <mbean code="org.jboss.varia.scheduler.Scheduler"
- name="portal:service=Management,type=Scheduler">
- <attribute
name="SchedulableMBean">portal:service=Management,type=PortletDiscoveryManagement,name=Default</attribute>
- <attribute
name="SchedulableMBeanMethod">processPortletDiscovery()</attribute>
- <attribute name="InitialStartDate">NOW</attribute>
- <attribute name="SchedulePeriod">30000</attribute>
- <attribute name="InitialRepetitions">-1</attribute>
- </mbean>
- <mbean
- code="org.jboss.portal.core.management.PortalImpl"
- name="portal.management:service=Management,type=Portal,name=Default"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <depends
- optional-attribute-name="InstanceContainer"
- proxy-type="attribute">portal:container=Instance</depends>
- <xmbean/>
- </mbean>
-
- <mbean
- code="org.jboss.portal.identity.management.Identity"
- name="portal.management:service=Management,type=Identity,name=Default"
- >
-
<depends>portal:service=Module,type=IdentityServiceController</depends>
- <xmbean/>
- </mbean>
-
- <mbean
- code="org.jboss.portal.core.management.PortletDiscoveryService"
-
name="portal:service=Management,type=PortletDiscoveryManagement,name=Default"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <depends
- optional-attribute-name="FederatingPortletInvoker"
-
proxy-type="attribute">portal:service=PortletInvoker,type=Federating</depends>
- <depends
- optional-attribute-name="Interceptor"
-
proxy-type="attribute">portal:service=Interceptor,type=Portlet,name=PortletContainerManagement</depends>
- <xmbean/>
- </mbean>
-
-
<!-- Server configuration service -->
<mbean
code="org.jboss.portal.server.config.ServerConfigService"
@@ -229,15 +184,7 @@
</mbean>
<!-- Instance stack -->
- <!-- Management MBean, can be removed if management is not used -->
<mbean
-
code="org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl"
-
name="portal:service=Interceptor,type=Portlet,name=PortletContainerManagement"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
- <mbean
code="org.jboss.portal.core.model.instance.InstanceSecurityInterceptor"
name="portal:service=Interceptor,type=Portlet,name=InstanceSecurity"
xmbean-dd=""
@@ -266,7 +213,6 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<depends-list optional-attribute-name="InterceptorNames">
-
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortletContainerManagement</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ConsumerCache</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=InstanceSecurity</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=PortalSessionSynchronization</depends-list-element>
Added: trunk/core-management/build.bat
===================================================================
--- trunk/core-management/build.bat (rev 0)
+++ trunk/core-management/build.bat 2007-01-17 22:16:04 UTC (rev 6023)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1015 2005-11-04 20:15:13Z mholzner $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/core-management/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-management/build.sh
===================================================================
--- trunk/core-management/build.sh (rev 0)
+++ trunk/core-management/build.sh 2007-01-17 22:16:04 UTC (rev 6023)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1015 2005-11-04 20:15:13Z mholzner $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/core-management/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/core-management/build.xml
===================================================================
--- trunk/core-management/build.xml (rev 0)
+++ trunk/core-management/build.xml 2007-01-17 22:16:04 UTC (rev 6023)
@@ -0,0 +1,325 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.cache.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="apache.myfaces.classpath"/>
+ <path refid="apache.tomahawk.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="jakarta.cactus.classpath"/>
+ <path refid="apache.fileupload.classpath"/>
+ <path refid="jakarta.io.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.javamail.classpath"/>
+ <path refid="jwebunit.jwebunit.classpath"/>
+ <path refid="dbunit.dbunit.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="portals.bridges.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="facelets.facelets.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ <pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-federation.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+ <call target="configure-explode"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-core-management-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-management-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+
+ <!-- portal-management.sar -->
+ <copy todir="${build.resources}/portal-management">
+ <fileset dir="${build.resources}/portal-management-sar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-management/lib">
+ <fileset dir="${build.lib}"
includes="portal-core-management-lib.jar"/>
+ </copy>
+
+ </target>
+
+ <!-- Build the jboss-portal-ha.sar -->
+ <target name="output-ha" depends="artifacts">
+ <copy todir="${build.resources}/portal-management-ha.sar">
+ <fileset dir="${build.resources}/portal-management"
excludes="**/*.xml"/>
+ </copy>
+
+ <copy todir="${build.resources}/portal-management-ha.sar">
+ <filterset>
+ <filtersfile file="../build/etc/clustered.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-management"
includes="**/*.xml"/>
+ </copy>
+
+ <implode
+ dir="${build.resources}/portal-management-ha.sar"
+ tofile="${build.lib}/portal-management-ha.sar"/>
+ </target>
+
+ <!-- Build the jboss-portal.sar -->
+ <target name="output" depends="artifacts">
+ <!-- Build configurations -->
+ <copy todir="${build.resources}/portal-management.sar">
+ <fileset dir="${build.resources}/portal-management"
excludes="**/*.xml"/>
+ </copy>
+
+ <copy todir="${build.resources}/portal-management.sar">
+ <filterset>
+ <filtersfile file="../build/etc/single.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-management"
includes="**/*.xml"/>
+ </copy>
+ <!-- Build archives -->
+ <implode
+ dir="${build.resources}/portal-management.sar"
+ tofile="${build.lib}/portal-management.sar"/>
+ </target>
+
+ <!-- create artifacts for running the portlet tests (except TCK) target output
should have already been executed -->
+ <target name="package-tests" depends="init">
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Deploy the application
+ -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-management.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ </target>
+
+ <target name="deploy-ha"
+ description="Deploy high availability."
+ depends="output-ha">
+ <require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ <copy file="${build.lib}/portal-management-ha.sar"
todir="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ </target>
+
+ <!--
+ | Undeploy the application
+ -->
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-management.sar"/>
+ </target>
+
+ <target name="undeploy-ha"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
+ <delete
file="${jboss.home}/server/${portal-ha.deploy.dir}/portal-management-ha.sar"/>
+ </target>
+
+ <target name="tests" depends="init,
_buildmagic:configure:deployment">
+ </target>
+</project>
Added: trunk/core-management/src/main/org/jboss/portal/core/management/Portal.java
===================================================================
--- trunk/core-management/src/main/org/jboss/portal/core/management/Portal.java
(rev 0)
+++ trunk/core-management/src/main/org/jboss/portal/core/management/Portal.java 2007-01-17
22:16:04 UTC (rev 6023)
@@ -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. *
+ ******************************************************************************/
+package org.jboss.portal.core.management;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface Portal {
+
+ public int getNbInstances();
+}
Added: trunk/core-management/src/main/org/jboss/portal/core/management/PortalImpl.java
===================================================================
--- trunk/core-management/src/main/org/jboss/portal/core/management/PortalImpl.java
(rev 0)
+++
trunk/core-management/src/main/org/jboss/portal/core/management/PortalImpl.java 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.management;
+
+import org.jboss.portal.core.management.Portal;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortalImpl extends AbstractJBossService implements Portal {
+
+ private InstanceContainer instanceContainer;
+
+ public int getNbInstances()
+ {
+ return instanceContainer.getDefinitions().size();
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+}
Added:
trunk/core-management/src/main/org/jboss/portal/core/management/PortletDiscoveryService.java
===================================================================
---
trunk/core-management/src/main/org/jboss/portal/core/management/PortletDiscoveryService.java
(rev 0)
+++
trunk/core-management/src/main/org/jboss/portal/core/management/PortletDiscoveryService.java 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,147 @@
+package org.jboss.portal.core.management;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.management.ObjectName;
+
+import org.jboss.portal.federation.FederatedPortletInvoker;
+import org.jboss.portal.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.management.LocalPortletManagement;
+import org.jboss.portal.portlet.management.PortletContainerManagementInterceptor;
+import org.jboss.system.ServiceMBeanSupport;
+
+public class PortletDiscoveryService extends ServiceMBeanSupport
+{
+ public static final String WSRP_JMX_PREFIX =
"portal.management:service=Management,type=WSRPPorlet,name=";
+ public static final String LOCAL_JMX_PREFIX =
"portal.management:service=Management,type=LocalPortlet,name=";
+
+ private PortletContainerManagementInterceptor interceptor;
+
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ private Map registeredPortlets = new HashMap();
+
+ public void start()
+ {
+ try
+ {
+ processPortletDiscovery();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void stop()
+ {
+ Iterator it = registeredPortlets.values().iterator();
+ while (it.hasNext())
+ {
+ ObjectName objectName = (ObjectName)it.next();
+ try
+ {
+ getServer().unregisterMBean(objectName);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ if (registeredPortlets.size() != 0)
+ {
+ log.error("Unable to remove all the Portlet management MBeans");
+ }
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ public void setInterceptor(PortletContainerManagementInterceptor interceptor)
+ {
+ this.interceptor = interceptor;
+ }
+
+ public void processPortletDiscovery() throws Exception
+ {
+ Collection federatedInvokers = federatingPortletInvoker.getFederatedInvokers();
+ Iterator it = federatedInvokers.iterator();
+ while (it.hasNext())
+ {
+ FederatedPortletInvoker federatedPortletInvoker = (FederatedPortletInvoker)
it.next();
+ if (federatedPortletInvoker.getId().equals("local"))
+ {
+ registerPortlets(federatedPortletInvoker.getPortlets(), false);
+ }
+ else
+ {
+ registerPortlets(federatedPortletInvoker.getPortlets(), true);
+ }
+ }
+ }
+
+ private void registerPortlets(Collection portlets, boolean wsrp)
+ {
+ Iterator it = portlets.iterator();
+ while (it.hasNext())
+ {
+ Portlet portlet = (Portlet) it.next();
+ String portletId = portlet.getContext().getId();
+ boolean used = interceptor.getPortletInfo(portletId).isUsed();
+ if ((!registeredPortlets.containsKey(portletId))&&(used))
+ {
+ try
+ {
+ ObjectName objectName = createManagementMBean(portlet, wsrp);
+ registeredPortlets.put(portletId, objectName);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private ObjectName createManagementMBean(Portlet portlet, boolean wsrp) throws
Exception
+ {
+ Object management = null;
+ if (wsrp)
+ {
+ management = new WSRPPortletManagement(portlet, interceptor);
+ }
+ else
+ {
+ management = new LocalPortletManagement(portlet, interceptor);
+ }
+ ObjectName objectName = new ObjectName(getMBeanName(portlet, wsrp));
+ getServer().registerMBean(management, objectName);
+ log.debug("Registered Management MBean for: " +
portlet.getContext().getId());
+ return objectName;
+ }
+
+ private String getMBeanName(Portlet portlet, boolean wsrp)
+ {
+ String id = portlet.getContext().getId();
+ if (wsrp)
+ {
+ return WSRP_JMX_PREFIX + id;
+ }
+ else
+ {
+ return LOCAL_JMX_PREFIX + id;
+ }
+ }
+
+}
Added:
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagement.java
===================================================================
---
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagement.java
(rev 0)
+++
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagement.java 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,88 @@
+/******************************************************************************
+ * 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.management;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.management.PortletContainerManagementInterceptor;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class WSRPPortletManagement implements WSRPPortletManagementMBean
+{
+ private Portlet portlet;
+
+ private PortletContainerManagementInterceptor interceptor;
+
+ public WSRPPortletManagement(Portlet portlet, PortletContainerManagementInterceptor
interceptor)
+ {
+ this.portlet = portlet;
+ this.interceptor = interceptor;
+ }
+
+ public String getId()
+ {
+ return portlet.getContext().getId();
+ }
+
+ public float getAverageRenderTime()
+ {
+ return interceptor.getPortletInfo(getId()).getAverageRenderTime();
+ }
+
+ public float getAverageActionTime()
+ {
+ return interceptor.getPortletInfo(getId()).getAverageActionTime();
+ }
+
+ public long getMaxRenderTime()
+ {
+ return interceptor.getPortletInfo(getId()).getMaxRenderTime();
+ }
+
+ public long getMaxActionTime()
+ {
+ return interceptor.getPortletInfo(getId()).getMaxActionTime();
+ }
+
+ public long getRenderRequestCount()
+ {
+ return interceptor.getPortletInfo(getId()).getRenderRequestCount();
+ }
+
+ public long getActionRequestCount()
+ {
+ return interceptor.getPortletInfo(getId()).getActionRequestCount();
+ }
+
+ public long getActionErrorCount()
+ {
+ return interceptor.getPortletInfo(getId()).getActionErrorCount();
+ }
+
+ public long getRenderErrorCount()
+ {
+ return interceptor.getPortletInfo(getId()).getRenderErrorCount();
+ }
+}
Added:
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagementMBean.java
===================================================================
---
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagementMBean.java
(rev 0)
+++
trunk/core-management/src/main/org/jboss/portal/core/management/WSRPPortletManagementMBean.java 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.management;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface WSRPPortletManagementMBean
+{
+ public float getAverageRenderTime();
+
+ public float getAverageActionTime();
+
+ public long getMaxRenderTime();
+
+ public long getMaxActionTime();
+
+ public long getRenderRequestCount();
+
+ public long getActionRequestCount();
+
+ public long getActionErrorCount();
+
+ public long getRenderErrorCount();
+}
Added:
trunk/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml
(rev 0)
+++
trunk/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml 2007-01-17
22:16:04 UTC (rev 6023)
@@ -0,0 +1,88 @@
+<?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>
+
+ <!-- Portlet discovery executed every 30 seconds -->
+ <mbean
+ code="org.jboss.varia.scheduler.Scheduler"
+ name="portal:service=Management,type=Scheduler">
+ <attribute
name="SchedulableMBean">portal:service=Management,type=PortletDiscoveryManagement,name=Default</attribute>
+ <attribute
name="SchedulableMBeanMethod">processPortletDiscovery()</attribute>
+ <attribute name="InitialStartDate">NOW</attribute>
+ <attribute name="SchedulePeriod">30000</attribute>
+ <attribute name="InitialRepetitions">-1</attribute>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.core.management.PortalImpl"
+ name="portal.management:service=Management,type=Portal,name=Default"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <depends
+ optional-attribute-name="InstanceContainer"
+ proxy-type="attribute">portal:container=Instance</depends>
+ <xmbean/>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.identity.management.Identity"
+
name="portal.management:service=Management,type=Identity,name=Default">
+
<depends>portal:service=Module,type=IdentityServiceController</depends>
+ <xmbean/>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.core.management.PortletDiscoveryService"
+
name="portal:service=Management,type=PortletDiscoveryManagement,name=Default"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <depends
+ optional-attribute-name="FederatingPortletInvoker"
+
proxy-type="attribute">portal:service=PortletInvoker,type=Federating</depends>
+ <depends
+ optional-attribute-name="Interceptor"
+
proxy-type="attribute">portal:service=Interceptor,type=Portlet,name=PortletContainerManagement</depends>
+ <xmbean/>
+ </mbean>
+
+ <mbean
+
code="org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl"
+
name="portal:service=Interceptor,type=Portlet,name=PortletContainerManagement"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.server.impl.invocation.JBossInterceptorRegistration"
+
name="portal:service=InterceptorRegistration,type=Portlet,name=PortletContainerManagement"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+
optional-attribute-name="StackFactory">portal:service=InterceptorStackFactory,type=Instance</depends>
+ <depends
+
optional-attribute-name="InterceptorName">portal:service=Interceptor,type=Portlet,name=PortletContainerManagement</depends>
+ </mbean>
+</server>
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2007-01-17 21:32:24 UTC (rev 6022)
+++ trunk/tools/etc/buildfragments/modules.ent 2007-01-17 22:16:04 UTC (rev 6023)
@@ -99,6 +99,13 @@
<pathelement
path="${jboss.portal-core-cms.lib}/portal-core-cms-lib.jar"/>
</path>
+ <!-- core-management -->
+ <property name="jboss.portal-core-management.root"
value="${project.root}/core-management/output"/>
+ <property name="jboss.portal-core-management.lib"
value="${jboss.portal-core-management.root}/lib"/>
+ <path id="jboss.portal-core-management.classpath">
+ <pathelement
path="${jboss.portal-core-management.lib}/portal-core-management-lib.jar"/>
+ </path>
+
<!-- theme -->
<property name="jboss.portal-theme.root"
value="${project.root}/theme/output"/>
<property name="jboss.portal-theme.lib"
value="${jboss.portal-theme.root}/lib"/>