Author: thomas.heute(a)jboss.com
Date: 2008-04-09 05:52:31 -0400 (Wed, 09 Apr 2008)
New Revision: 10520
Removed:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1976: WorkflowSoftDependency is not working correctly anymore
Removed it since it wasn't reliable.
Deleted:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java 2008-04-09
09:50:20 UTC (rev 10519)
+++
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/WorkflowSoftDependency.java 2008-04-09
09:52:31 UTC (rev 10520)
@@ -1,173 +0,0 @@
-/******************************************************************************
- * 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.services;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MBeanServerNotification;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanProxyCreationException;
-import org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationService;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.workflow.service.WorkflowService;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class WorkflowSoftDependency extends AbstractJBossService
-{
- private MBeanServer server;
-
- private IdentityUIConfigurationService identityUIConfigurationService;
-
- private NotificationListener notificationListener;
-
- private ObjectName mbeanServerDelegate;
-
- private ObjectName workflowServiceObjectName;
-
- /** The logger. */
- private Logger log = Logger.getLogger(WorkflowSoftDependency.class);
-
- public WorkflowSoftDependency()
- {
- server = (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
- try
- {
- mbeanServerDelegate = new
ObjectName("JMImplementation:type=MBeanServerDelegate");
- workflowServiceObjectName = new
ObjectName("portal:service=Workflow,type=WorkflowService");
- notificationListener = new
WorkflowServiceNotificationListener(workflowServiceObjectName);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void startService()
- {
- // Check if the workflow service is already registered
- if (server.isRegistered(workflowServiceObjectName))
- {
- try
- {
- WorkflowService workflowService =
(WorkflowService)MBeanProxy.get(WorkflowService.class, workflowServiceObjectName,
server);
- identityUIConfigurationService.setWorkflowService(workflowService);
- log.debug("Starting identityUIConfigurationService workflow
part");
- identityUIConfigurationService.startWorkflow();
- }
- catch (Exception e)
- {
- log.error("Error starting workflow", e);
- }
- }
-
- // Add the listener for registration/unregistration if the workflow service
- try
- {
- server.addNotificationListener(mbeanServerDelegate, notificationListener, null,
identityUIConfigurationService);
- }
- catch (Exception e)
- {
- log.error(e);
- }
- }
-
- public void stopService()
- {
- try
- {
- server.removeNotificationListener(mbeanServerDelegate, notificationListener);
- }
- catch (Exception e)
- {
- log.error(e);
- }
- }
-
- public void setIdentityUIConfigurationService(IdentityUIConfigurationService
identityUIConfigurationService)
- {
- this.identityUIConfigurationService = identityUIConfigurationService;
- }
-
- private class WorkflowServiceNotificationListener implements NotificationListener
- {
-
- ObjectName objectName = null;
-
- public WorkflowServiceNotificationListener(ObjectName objectName)
- {
- this.objectName = objectName;
- }
-
- public void handleNotification(Notification notification, Object object)
- {
- if (notification instanceof MBeanServerNotification)
- {
- MBeanServerNotification notif = (MBeanServerNotification)notification;
- try
- {
- if (notif.getMBeanName().equals(objectName))
- {
- IdentityUIConfigurationService identityUIConfigurationService =
(IdentityUIConfigurationService)object;
- if
(notif.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION))
- {
- try
- {
- WorkflowService workflowService =
(WorkflowService)MBeanProxy.get(WorkflowService.class, new
ObjectName("portal:service=Workflow,type=WorkflowService"), server);
-
identityUIConfigurationService.setWorkflowService(workflowService);
- log.debug("Starting identityUIConfigurationService workflow
part");
- identityUIConfigurationService.startWorkflow();
-
- }
- catch (MBeanProxyCreationException e)
- {
- log.error("Error starting workflow", e);
- }
- }
- else
- {
- // Unregistration
- log.debug("Stopping identityUIConfigurationService workflow
part");
- identityUIConfigurationService.stopWorkflow();
- identityUIConfigurationService.setWorkflowService(null);
- }
- }
- }
- catch (Exception e)
- {
- log.error(e);
- }
- }
- }
-
- }
-
-}
-
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2008-04-09
09:50:20 UTC (rev 10519)
+++
branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2008-04-09
09:52:31 UTC (rev 10520)
@@ -139,6 +139,7 @@
jndiBinding = new JNDI.Binding(jndiName, this);
jndiBinding.bind();
}
+ startWorkflow();
}
public void stopService() throws Exception
@@ -150,6 +151,7 @@
jndiBinding.unbind();
jndiBinding = null;
}
+ stopWorkflow();
}
public String getJNDIName()
@@ -243,7 +245,7 @@
}
catch(Exception e)
{
- throw new CoreIdentityConfigurationException("I don't like your
subscription mode! Please make sure that the file and the process name match - also check
the syntax.", e);
+ throw new CoreIdentityConfigurationException("I don't like your
subscription mode [" + processName + "] ! Please make sure that the file and the
process name match - also check the syntax.", e);
}
finally
{
Modified:
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2008-04-09
09:50:20 UTC (rev 10519)
+++
branches/JBoss_Portal_Branch_2_7/core-identity/src/resources/portal-identity-sar/META-INF/jboss-service.xml 2008-04-09
09:52:31 UTC (rev 10520)
@@ -58,6 +58,9 @@
<depends optional-attribute-name="IdentityServiceController"
proxy-type="attribute">
portal:service=Module,type=IdentityServiceController
</depends>
+ <depends optional-attribute-name="WorkflowService"
proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
<attribute
name="JNDIName">java:portal/IdentityUIConfigurationService</attribute>
</mbean>
@@ -129,14 +132,4 @@
proxy-type="attribute">portal:commandFactory=IdentityUI</depends>
</mbean>
- <mbean
- code="org.jboss.portal.core.identity.services.WorkflowSoftDependency"
- name="portal:service=WorkflowSoftDependency"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <depends
- optional-attribute-name="IdentityUIConfigurationService"
-
proxy-type="attribute">portal:service=IdentityUIConfigurationService,type=IdentityUI</depends>
- <xmbean/>
- </mbean>
</server>
\ No newline at end of file