[Jboss-cvs] JBossAS SVN: r55487 - branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 10 10:23:51 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-08-10 10:23:50 -0400 (Thu, 10 Aug 2006)
New Revision: 55487

Added:
   branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeployersBarrier.java
Log:
A barrier class used to allow beans dependent on all deployers being started to use a demands statement to achieve this dependency.

Added: branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeployersBarrier.java
===================================================================
--- branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeployersBarrier.java	2006-08-10 13:06:48 UTC (rev 55486)
+++ branches/MC_VDF_WORK/system/src/main/org/jboss/deployers/plugins/DeployersBarrier.java	2006-08-10 14:23:50 UTC (rev 55487)
@@ -0,0 +1,62 @@
+/*
+ * 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.deployers.plugins;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.deployers.spi.AspectDeployer;
+import org.jboss.util.JBossObject;
+
+/**
+ * A barrier class used to allow beans dependent on all deployers being started
+ * to use a demands statement to achieve this dependency.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class DeployersBarrier extends JBossObject
+{
+   private List<AspectDeployer> deployers = new CopyOnWriteArrayList<AspectDeployer>();
+
+   public AspectDeployer[] getDeployers()
+   {
+      AspectDeployer[] tmp = new AspectDeployer[deployers.size()];
+      deployers.toArray(tmp);
+      return tmp;
+   }
+   public void setDeployers(AspectDeployer[] deployers)
+   {
+      this.deployers.clear();
+      this.deployers.addAll(Arrays.asList(deployers));
+   }
+
+   public void start()
+   {
+      log.debug("Started, deployers: "+deployers);
+   }
+   public void stop()
+   {
+      log.debug("Stopped, deployers: "+deployers);
+   }
+}




More information about the jboss-cvs-commits mailing list