[jboss-cvs] JBossAS SVN: r88723 - in projects/microcontainer/trunk/kernel/src/main/java/org/jboss: kernel/plugins/dependency and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue May 12 10:35:54 EDT 2009
Author: alesj
Date: 2009-05-12 10:35:54 -0400 (Tue, 12 May 2009)
New Revision: 88723
Removed:
projects/microcontainer/trunk/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/DependencyBuilderFactory.java
Modified:
projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeAction.java
Log:
Revert to old DependencyBuilder behavior.
Deleted: projects/microcontainer/trunk/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/DependencyBuilderFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/DependencyBuilderFactory.java 2009-05-12 14:05:46 UTC (rev 88722)
+++ projects/microcontainer/trunk/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/DependencyBuilderFactory.java 2009-05-12 14:35:54 UTC (rev 88723)
@@ -1,56 +0,0 @@
-/*
- * 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.beans.metadata.api.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.jboss.kernel.spi.dependency.DependencyBuilder;
-import org.jboss.kernel.spi.dependency.helpers.AbstractDependencyBuilder;
-
-/**
- * Define dependency builder instance.
- *
- * @author <a href="mailto:kabir.khan at jboss.org">Kabir Khan</a>
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
- at Target(ElementType.TYPE)
- at Retention(RetentionPolicy.RUNTIME)
-public @interface DependencyBuilderFactory
-{
- /**
- * The dependency builder class to use.
- *
- * @return the dependency builder class
- */
- Class<? extends DependencyBuilder> value() default AbstractDependencyBuilder.class;
-
- /**
- * Should we check metadata for dependency builder instance.
- * This allows us for more configurable instance.
- *
- * @return true if we should check metadata for dependency builder, false otherwise
- */
- boolean checkMetaDataForBuilderInstance() default false;
-}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeAction.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeAction.java 2009-05-12 14:05:46 UTC (rev 88722)
+++ projects/microcontainer/trunk/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeAction.java 2009-05-12 14:35:54 UTC (rev 88723)
@@ -24,7 +24,6 @@
import java.util.List;
import org.jboss.beans.info.spi.BeanInfo;
-import org.jboss.beans.metadata.api.annotations.DependencyBuilderFactory;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.kernel.Kernel;
import org.jboss.kernel.spi.config.KernelConfig;
@@ -32,7 +31,6 @@
import org.jboss.kernel.spi.dependency.DependencyBuilderListItem;
import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
-import org.jboss.kernel.spi.dependency.helpers.AbstractDependencyBuilder;
import org.jboss.kernel.spi.metadata.KernelMetaDataRepository;
import org.jboss.metadata.spi.MetaData;
@@ -45,61 +43,6 @@
*/
public class DescribeAction extends AnnotationsAction
{
- /** Basic dependency builder, no AOP */
- private DependencyBuilder basicDependencyBuilder = createBasicDependencyBuilder();
-
- /**
- * Create basic dependency builder.
- *
- * @return the basic dependency builder
- */
- protected DependencyBuilder createBasicDependencyBuilder()
- {
- return new AbstractDependencyBuilder();
- }
-
- /**
- * Get dependency builder.
- *
- * @param md the metadata
- * @param kernel the kernel
- * @return dependency builder
- * @throws Throwable for any error
- */
- protected DependencyBuilder getDependencyBuilder(MetaData md, Kernel kernel) throws Throwable
- {
- DependencyBuilder dependencyBuilder = null;
- DependencyBuilderFactory factory = md.getAnnotation(DependencyBuilderFactory.class);
- if (factory != null)
- {
- if (factory.checkMetaDataForBuilderInstance())
- {
- // still allow for more configurable DependencyBuilder
- dependencyBuilder = md.getMetaData(DependencyBuilder.class);
- }
- else
- {
- Class<? extends DependencyBuilder> value = factory.value();
- if (basicDependencyBuilder.getClass().equals(value))
- {
- dependencyBuilder = basicDependencyBuilder;
- }
- else
- {
- dependencyBuilder = value.newInstance();
- }
- }
- }
-
- if (dependencyBuilder == null)
- {
- KernelConfig config = kernel.getConfig();
- dependencyBuilder = config.getDependencyBuilder();
- }
-
- return dependencyBuilder;
- }
-
@SuppressWarnings("unchecked")
protected void installActionInternal(KernelControllerContext context) throws Throwable
{
@@ -110,7 +53,8 @@
Kernel kernel = controller.getKernel();
KernelMetaDataRepository repository = kernel.getMetaDataRepository();
MetaData md = repository.getMetaData(context);
- DependencyBuilder dependencyBuilder = getDependencyBuilder(md, kernel);
+ KernelConfig config = kernel.getConfig();
+ DependencyBuilder dependencyBuilder = config.getDependencyBuilder();
// add custom dependencies (e.g. AOP layer).
List<DependencyBuilderListItem> dependencies = dependencyBuilder.getDependencies(info, md);
if (log.isTraceEnabled())
@@ -143,7 +87,8 @@
DependencyBuilder dependencyBuilder;
try
{
- dependencyBuilder = getDependencyBuilder(md, kernel);
+ KernelConfig config = kernel.getConfig();
+ dependencyBuilder = config.getDependencyBuilder();
}
catch (Throwable e)
{
More information about the jboss-cvs-commits
mailing list