[jboss-cvs] jboss-portal/cms/src/main/org/jboss/portal/cms/ha ...
Julien Viet
julien at jboss.com
Tue Jul 11 17:58:56 EDT 2006
User: julien
Date: 06/07/11 17:58:56
Modified: cms/src/main/org/jboss/portal/cms/ha
HASingletonInvoker.java
HASingletonInvokerMBean.java
Log:
make the portlet app deployer auto create instances only if it is the singleton on the cluster
Revision Changes Path
1.3 +16 -2 jboss-portal/cms/src/main/org/jboss/portal/cms/ha/HASingletonInvoker.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: HASingletonInvoker.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/cms/src/main/org/jboss/portal/cms/ha/HASingletonInvoker.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- HASingletonInvoker.java 27 Apr 2006 13:08:55 -0000 1.2
+++ HASingletonInvoker.java 11 Jul 2006 21:58:56 -0000 1.3
@@ -33,7 +33,7 @@
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
*/
public class HASingletonInvoker extends HASingletonSupport implements HASingletonInvokerMBean
{
@@ -197,18 +197,26 @@
public void startSingleton()
{
+ String name = callback.getDisplayName();
+
+ //
try
{
+
// Start the service.
+ log.debug("Starting singleton " + name);
callback.startSingleton();
+ log.debug("Singleton " + name + " started");
//
+ log.debug("Binding singleton proxy " + name);
Object proxy = server.getAttribute(proxyFactory, "Proxy");
Util.bind(new InitialContext(), jndiName, proxy);
+ log.debug("Singleton proxy " + name + " bound");
}
catch (Exception e)
{
- e.printStackTrace();
+ log.error("Not able to start singleton " + name + " bound", e);
}
}
@@ -217,7 +225,13 @@
// Stop the singleton
if (callback != null)
{
+ //
+ String name = callback.getDisplayName();
+
+ //
+ log.debug("Stopping singleton proxy " + name);
callback.stopSingleton();
+ log.debug("Singleton " + name + " stopped");
}
}
1.2 +6 -1 jboss-portal/cms/src/main/org/jboss/portal/cms/ha/HASingletonInvokerMBean.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: HASingletonInvokerMBean.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/cms/src/main/org/jboss/portal/cms/ha/HASingletonInvokerMBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- HASingletonInvokerMBean.java 21 Jan 2006 14:09:29 -0000 1.1
+++ HASingletonInvokerMBean.java 11 Jul 2006 21:58:56 -0000 1.2
@@ -32,7 +32,7 @@
* the capability to invoke the singleton service from the cluster.
*
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public interface HASingletonInvokerMBean extends HASingletonMBean
{
@@ -134,6 +134,11 @@
* Invocation callback
*/
Object invoke(String methodName, Class[] types, Object[] args) throws Exception;
+
+ /**
+ * Provide a simple display name for logging purpose.
+ */
+ String getDisplayName();
}
/**
More information about the jboss-cvs-commits
mailing list