[jboss-cvs] JBossAS SVN: r105486 - projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jun 1 11:36:35 EDT 2010


Author: alesj
Date: 2010-06-01 11:36:34 -0400 (Tue, 01 Jun 2010)
New Revision: 105486

Added:
   projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/NameIgnoreMechanismFactory.java
Modified:
   projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractParsingDeployerWithOutput.java
Log:
Use factory for default.

Modified: projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractParsingDeployerWithOutput.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractParsingDeployerWithOutput.java	2010-06-01 15:32:50 UTC (rev 105485)
+++ projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractParsingDeployerWithOutput.java	2010-06-01 15:36:34 UTC (rev 105486)
@@ -59,7 +59,7 @@
    private boolean buildManagedObject = false;
 
    /** The name ignore mechanism */
-   private NameIgnoreMechanism nameIgnoreMechanism = DelegateNameIgnoreMechanism.INSTANCE;
+   private NameIgnoreMechanism nameIgnoreMechanism = NameIgnoreMechanismFactory.create();
 
    /**
     * Create a new AbstractParsingDeployerWithOutput.

Copied: projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/NameIgnoreMechanismFactory.java (from rev 105484, projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/DelegateNameIgnoreMechanism.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/NameIgnoreMechanismFactory.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/NameIgnoreMechanismFactory.java	2010-06-01 15:36:34 UTC (rev 105486)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.spi.deployer.helpers;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import org.jboss.deployers.spi.deployer.matchers.NameIgnoreMechanism;
+import org.jboss.util.builder.AbstractBuilder;
+
+/**
+ * NIM factory.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class NameIgnoreMechanismFactory
+{
+   private static NameIgnoreMechanism defaultMechanism;
+
+   /**
+    * Get default NIM.
+    *
+    * @return the default NIM
+    */
+   public static NameIgnoreMechanism create()
+   {
+      if (defaultMechanism == null)
+      {
+         PrivilegedAction<NameIgnoreMechanism> builder = new AbstractBuilder<NameIgnoreMechanism>(NameIgnoreMechanism.class, DelegateNameIgnoreMechanism.class.getName());
+         SecurityManager sm = System.getSecurityManager();
+         if (sm != null)
+            defaultMechanism = AccessController.doPrivileged(builder);
+         else
+            defaultMechanism = builder.run();
+      }
+      return defaultMechanism;
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list