Author: thomas.heute(a)jboss.com
Date: 2007-09-04 06:55:50 -0400 (Tue, 04 Sep 2007)
New Revision: 8141
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/management/CMSImpl.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java
Log:
- Fix Management mbeans (JBoss ON)
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/management/CMSImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/management/CMSImpl.java 2007-09-04
10:02:26 UTC (rev 8140)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/management/CMSImpl.java 2007-09-04
10:55:50 UTC (rev 8141)
@@ -30,6 +30,9 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
/**
+ * Unused. With the introduction of CMS security, this can
+ * no longer count CMS files.
+ *
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-04
10:02:26 UTC (rev 8140)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-04
10:55:50 UTC (rev 8141)
@@ -24,9 +24,11 @@
<server>
<!-- Management MBean -->
+ <!-- Unused, the bean doesn't bring any interesting value -->
+ <!--
<mbean
code="org.jboss.portal.cms.management.CMSImpl"
- name="portal:service=Management,type=CMS,name=Default"
+ name="portal.management:service=Management,type=CMS,name=Default"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<depends
@@ -34,7 +36,8 @@
proxy-type="attribute">portal:service=CMS</depends>
<xmbean/>
</mbean>
-
+ -->
+
<mbean
code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
name="portal:service=Hibernate,type=CMS"
Modified:
branches/JBoss_Portal_Branch_2_6/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml 2007-09-04
10:02:26 UTC (rev 8140)
+++
branches/JBoss_Portal_Branch_2_6/core-management/src/resources/portal-management-sar/META-INF/jboss-service.xml 2007-09-04
10:55:50 UTC (rev 8141)
@@ -33,6 +33,7 @@
<attribute name="InitialStartDate">NOW</attribute>
<attribute name="SchedulePeriod">30000</attribute>
<attribute name="InitialRepetitions">-1</attribute>
+ <attribute name="StartAtStartup">true</attribute>
</mbean>
<mbean
Modified:
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java
===================================================================
---
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java 2007-09-04
10:02:26 UTC (rev 8140)
+++
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/Identity.java 2007-09-04
10:55:50 UTC (rev 8141)
@@ -23,6 +23,7 @@
package org.jboss.portal.identity.management;
import javax.naming.InitialContext;
+import javax.naming.NamingException;
import javax.transaction.UserTransaction;
import org.jboss.portal.identity.UserModule;
@@ -40,6 +41,20 @@
public int getUserCount() throws Exception
{
+ if (userModule == null)
+ {
+ InitialContext ctx;
+ try
+ {
+ ctx = new InitialContext();
+ userModule = (UserModule)ctx.lookup("java:/portal/UserModule");
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
int nbUsers = 0;
InitialContext ctx;
ctx = new InitialContext();
@@ -52,6 +67,19 @@
public int getRoleCount() throws Exception
{
+ if (roleModule == null)
+ {
+ InitialContext ctx;
+ try
+ {
+ ctx = new InitialContext();
+ roleModule = (RoleModule)ctx.lookup("java:/portal/RoleModule");
+ }
+ catch (NamingException e)
+ {
+ e.printStackTrace();
+ }
+ }
int nbRoles = 0;
InitialContext ctx;
ctx = new InitialContext();
@@ -61,14 +89,4 @@
tx.commit();
return nbRoles;
}
-
- public void setRoleModule(RoleModule roleModule)
- {
- this.roleModule = roleModule;
- }
-
- public void setUserModule(UserModule userModule)
- {
- this.userModule = userModule;
- }
}
Modified:
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java
===================================================================
---
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java 2007-09-04
10:02:26 UTC (rev 8140)
+++
modules/identity/trunk/identity/src/main/org/jboss/portal/identity/management/IdentityMBean.java 2007-09-04
10:55:50 UTC (rev 8141)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.identity.management;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.UserModule;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -34,9 +32,4 @@
public int getUserCount() throws Exception;
public int getRoleCount() throws Exception;
-
- public void setRoleModule(RoleModule roleModule);
-
- public void setUserModule(UserModule userModule);
-
}
Show replies by date