[jboss-cvs] JBossAS SVN: r58562 - trunk/cluster/src/main/org/jboss/ha/singleton

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Nov 18 06:24:16 EST 2006


Author: bstansberry at jboss.com
Date: 2006-11-18 06:24:15 -0500 (Sat, 18 Nov 2006)
New Revision: 58562

Added:
   trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
   trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScannerMBean.java
Log:
Add a VFSScanner for doing deploy-hassingleton

Added: trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2006-11-18 11:23:33 UTC (rev 58561)
+++ trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2006-11-18 11:24:15 UTC (rev 58562)
@@ -0,0 +1,67 @@
+/*
+ * 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.ha.singleton;
+
+import java.net.URI;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.jboss.system.ServiceMBean;
+import org.jboss.system.server.profileservice.VFSDeploymentScannerImpl;
+
+/**
+ * VFSScanner that exposes methods whereby an HASingletonController
+ * can trigger the deployment or undeployment.
+ * 
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+public class HASingletonDeploymentScanner 
+   extends VFSDeploymentScannerImpl
+   implements HASingletonDeploymentScannerMBean
+{
+   public void deploySingletons(String uris) throws Exception
+   {
+      StringTokenizer tokenizer = new StringTokenizer(uris, ",");
+      while (tokenizer.hasMoreTokens())
+      {
+         String uri = tokenizer.nextToken();
+         uri = uri.trim();
+         addURI(new URI(uris));
+      }
+      
+      scan();
+   }
+   
+   public void undeploySingletons(String uris) throws Exception
+   {
+      StringTokenizer tokenizer = new StringTokenizer(uris, ",");
+      while (tokenizer.hasMoreTokens())
+      {
+         String uri = tokenizer.nextToken();
+         uri = uri.trim();
+         removeURI(new URI(uris));
+      }
+      
+      scan();
+   }
+}

Added: trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScannerMBean.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScannerMBean.java	2006-11-18 11:23:33 UTC (rev 58561)
+++ trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScannerMBean.java	2006-11-18 11:24:15 UTC (rev 58562)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.ha.singleton;
+
+import java.net.URI;
+import java.util.List;
+
+
+/**
+ * StandardMBean interface for {@link HASingletonDeploymentScanner}
+ * 
+ * @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
+ * @version $Revision: 1.1 $
+ */
+public interface HASingletonDeploymentScannerMBean
+{
+   void deploySingletons(String uri) throws Exception;
+   
+   void undeploySingletons(String uri) throws Exception;
+}




More information about the jboss-cvs-commits mailing list