[webbeans-commits] Webbeans SVN: r1727 - in ri/trunk: webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Feb 26 16:07:39 EST 2009


Author: pete.muir at jboss.org
Date: 2009-02-26 16:07:39 -0500 (Thu, 26 Feb 2009)
New Revision: 1727

Removed:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedInitialization.java
Modified:
   ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
add shutdown, remove old code

Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedInitialization.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedInitialization.java	2009-02-26 20:24:44 UTC (rev 1726)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/PropertiesBasedInitialization.java	2009-02-26 21:07:39 UTC (rev 1727)
@@ -1,102 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,  
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.webbeans.bootstrap;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-import javax.inject.ExecutionException;
-
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.servlet.ServletInitialization;
-import org.jboss.webbeans.util.DeploymentProperties;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * An abstract extension of Bootstrap which uses deployment properties for 
- * configuring the application
- * 
- * @author Pete Muir
- *
- */
-public abstract class PropertiesBasedInitialization
-{
-
-   // The log provider
-   private static final LogProvider log = Logging.getLogProvider(ServletInitialization.class);
-   
-   /**
-    * Returns any class constructor from the merged list defined by the 
-    * specified property.
-    * No guarantee is made about which item in the list will returned.
-    * 
-    * @param <T> The class type
-    * @param deploymentProperties The deployment properties to be used
-    * @param resourceLoader The resourceLoader to use for class and resource loading
-    * @param propertyName The name of the property to find in the deployment properties
-    * @param expectedType The expected type or super type of the class
-    * @param constructorArguments The arguments of the constructor to select
-    * @return
-    */
-   protected static <T> Constructor<? extends T> getClassConstructor(DeploymentProperties deploymentProperties, ResourceLoader resourceLoader, String propertyName, Class<T> expectedType, Class<?> ... constructorArguments)
-   {
-      for (Class<? extends T> clazz : DeploymentProperties.getClasses(deploymentProperties, resourceLoader, propertyName, expectedType))
-      {
-         Constructor<? extends T> constructor = Reflections.getConstructor((Class<? extends T>) clazz, constructorArguments);
-         if (constructor != null)
-         {
-            return constructor;
-         }
-      }
-      return null;
-   }
-   
-   /**
-    * Creates an instance of the type
-    * 
-    * @param constructor The constructor to use
-    * @param parameters The parameters to pass to the constructor
-    * @return An instance of the type
-    */
-   protected static <T> T newInstance(Constructor<T> constructor, Object... parameters)
-   {
-      try
-      {
-         return constructor.newInstance(parameters);
-      }
-      catch (IllegalArgumentException e)
-      {
-         throw new ExecutionException("Error instantiating " + constructor, e);
-      }
-      catch (InstantiationException e)
-      {
-         throw new ExecutionException("Error instantiating " + constructor, e);
-      }
-      catch (IllegalAccessException e)
-      {
-         throw new ExecutionException("Error instantiating " + constructor, e);
-      }
-      catch (InvocationTargetException e)
-      {
-         throw new ExecutionException("Error instantiating " + constructor, e);
-      }
-   }
-   
-}
\ No newline at end of file

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java	2009-02-26 20:24:44 UTC (rev 1726)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java	2009-02-26 21:07:39 UTC (rev 1727)
@@ -209,5 +209,10 @@
       ApplicationContext.INSTANCE.setActive(false);
       ApplicationContext.INSTANCE.setBeanStore(null);
    }
+   
+   public void shutdown()
+   {
+      endApplication(getApplicationContext());
+   }
 
 }

Modified: ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java
===================================================================
--- ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java	2009-02-26 20:24:44 UTC (rev 1726)
+++ ri/trunk/webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.java	2009-02-26 21:07:39 UTC (rev 1727)
@@ -85,4 +85,10 @@
     */
    public void boot();
    
+   /**
+    * Causes the container to clean up and shutdown
+    * 
+    */
+   public void shutdown();
+   
 }




More information about the weld-commits mailing list