[jboss-cvs] JBossAS SVN: r61978 - in projects/microcontainer/trunk: dependency/src/main/org/jboss/dependency/plugins and 15 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Apr 2 06:15:34 EDT 2007
Author: alesj
Date: 2007-04-02 06:15:34 -0400 (Mon, 02 Apr 2007)
New Revision: 61978
Added:
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/AccessControllerContextAction.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/ControllerContextAction.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/SimpleControllerContextAction.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/package.html
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/InstallItem.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/DeploymentResolver.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/ManifestDeployer.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/metadata/
projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/metadata/ManifestMetaData.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/factory/
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/factory/BeanFactory.java
Removed:
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/spi/action/
Modified:
projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractControllerContextActions.java
projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/ErrorControllerContext.java
projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/OtherControllerContext.java
projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/RecursiveControllerContext.java
projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/TestControllerContext.java
projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/test/StateConsistencyUnitTestCase.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextAction.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.java
Log:
Moving the ControllerContextAction (from .spi.), adding some top level abstract ControllerContextAction implementations, new ManifestDeployer, DependencyResolver(Deployer), introduction of BeanFactory interface to GenericBeanFactory.
Initial code for InstallItem and Cardinality enum.
Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -26,6 +26,7 @@
import org.jboss.aop.advice.AspectFactory;
import org.jboss.aop.joinpoint.Joinpoint;
import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
import org.jboss.logging.Logger;
/**
@@ -38,11 +39,11 @@
{
private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class);
- protected GenericBeanFactory factory;
+ protected BeanFactory factory;
protected String name;
- public GenericBeanAspectFactory(String name, GenericBeanFactory factory)
+ public GenericBeanAspectFactory(String name, BeanFactory factory)
{
this.name = name;
this.factory = factory;
Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractControllerContextActions.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractControllerContextActions.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractControllerContextActions.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -23,7 +23,7 @@
import java.util.Map;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerContextActions;
import org.jboss.dependency.spi.ControllerState;
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/AccessControllerContextAction.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/AccessControllerContextAction.java (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/AccessControllerContextAction.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,160 @@
+/*
+* 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.dependency.plugins.action;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+
+import org.jboss.dependency.spi.ControllerContext;
+
+/**
+ * Access controller context.
+ * It runs action in simple mode if there is no security manager present.
+ * While running simple action, you cast the actual context into less specific type.
+ *
+ * @param <S> simple ControllerContext impl
+ * @param <T> full ControllerContext impl
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AccessControllerContextAction<S extends ControllerContext, T extends ControllerContext> implements ControllerContextAction
+{
+ /**
+ * Validate context
+ *
+ * @param context context instance to validate
+ * @return false if not able to use privileged action
+ */
+ protected abstract boolean validateContext(ControllerContext context);
+
+ /**
+ * Cast context instance.
+ * We can throw class cast exception if unable to cast it it S.
+ *
+ * @param context context to cast
+ * @return casted context
+ */
+ protected abstract S simpleContextCast(ControllerContext context);
+
+ /**
+ * Cast context instance.
+ * We can throw class cast exception if unable to cast it it T.
+ *
+ * @param context context to cast
+ * @return casted context
+ */
+ protected abstract T fullContextCast(ControllerContext context);
+
+ public void install(final ControllerContext context) throws Throwable
+ {
+ if (System.getSecurityManager() == null || validateContext(context) == false)
+ simpleInstallAction(simpleContextCast(context));
+ else
+ {
+ PrivilegedExceptionAction<Object> action = new PrivilegedExceptionAction<Object>()
+ {
+ public Object run() throws Exception
+ {
+ try
+ {
+ secureInstallAction(fullContextCast(context));
+ return null;
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw e;
+ }
+ catch (Error e)
+ {
+ throw e;
+ }
+ catch (Throwable t)
+ {
+ throw new RuntimeException(t);
+ }
+ }
+ };
+ try
+ {
+ AccessController.doPrivileged(action);
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw e.getCause();
+ }
+ }
+ }
+
+ /**
+ * Unsecure call to install action.
+ *
+ * @param context the context
+ * @throws Throwable for any error
+ */
+ protected abstract void simpleInstallAction(S context) throws Throwable;
+
+ /**
+ * Secure call to install action.
+ *
+ * @param context the context
+ * @throws Throwable for any error
+ */
+ protected abstract void secureInstallAction(T context) throws Throwable;
+
+ public void uninstall(final ControllerContext context)
+ {
+ if (System.getSecurityManager() == null || validateContext(context) == false)
+ simpleUninstallAction(simpleContextCast(context));
+ else
+ {
+ PrivilegedAction<Object> action = new PrivilegedAction<Object>()
+ {
+ public Object run()
+ {
+ secureUninstallAction(fullContextCast(context));
+ return null;
+ }
+ };
+ AccessController.doPrivileged(action);
+ }
+ }
+
+ /**
+ * Unsecure call to uninstall action.
+ *
+ * @param context the context
+ */
+ protected abstract void simpleUninstallAction(S context);
+
+ /**
+ * Secure call to uninstall action.
+ *
+ * @param context the context
+ */
+ protected abstract void secureUninstallAction(T context);
+
+}
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/ControllerContextAction.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/ControllerContextAction.java (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/ControllerContextAction.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,48 @@
+/*
+* 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.dependency.plugins.action;
+
+import org.jboss.dependency.spi.ControllerContext;
+
+/**
+ * A controller context action.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public interface ControllerContextAction
+{
+ /**
+ * Install a context
+ *
+ * @param context the context
+ * @throws Throwable for any error
+ */
+ void install(ControllerContext context) throws Throwable;
+
+ /**
+ * Uninstall a context
+ *
+ * @param context the context
+ */
+ void uninstall(ControllerContext context);
+}
Property changes on: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/ControllerContextAction.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/SimpleControllerContextAction.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/SimpleControllerContextAction.java (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/SimpleControllerContextAction.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,87 @@
+/*
+* 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.dependency.plugins.action;
+
+import org.jboss.dependency.spi.ControllerContext;
+
+/**
+ * Simple and full context impls are the same.
+ *
+ * @param <T> ControllerContext impl
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class SimpleControllerContextAction<T extends ControllerContext> extends AccessControllerContextAction<T, T>
+{
+ /**
+ * Cast the context to the actual implementation.
+ *
+ * @param context the context
+ * @return exact context type
+ */
+ protected abstract T contextCast(ControllerContext context);
+
+ protected T simpleContextCast(ControllerContext context)
+ {
+ return contextCast(context);
+ }
+
+ protected T fullContextCast(ControllerContext context)
+ {
+ return contextCast(context);
+ }
+
+ /**
+ * The install.
+ *
+ * @param context the context
+ * @throws Throwable for any error
+ */
+ protected abstract void installAction(T context) throws Throwable;
+
+ protected void simpleInstallAction(T context) throws Throwable
+ {
+ installAction(context);
+ }
+
+ protected void secureInstallAction(T context) throws Throwable
+ {
+ installAction(context);
+ }
+
+ /**
+ * The uninstall.
+ *
+ * @param context the context
+ */
+ protected abstract void uninstallAction(T context);
+
+ protected void simpleUninstallAction(T context)
+ {
+ uninstallAction(context);
+ }
+
+ protected void secureUninstallAction(T context)
+ {
+ uninstallAction(context);
+ }
+
+}
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/package.html
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/package.html (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/package.html 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+ <head>
+ <!-- $Id$ -->
+ <!--
+
+ JBoss: The OpenSource J2EE WebOS
+
+ Distributable under LGPL license.
+ See terms of license at gnu.org.
+
+ -->
+ </head>
+
+ <body bgcolor="white">
+ <p>Definition of action plugins.
+
+ <h2>Package Specification</h2>
+ <ul>
+ <li><a href="javascript: alert('not available')">Not Available</a>
+ </ul>
+
+ <h2>Related Documentation</h2>
+ <ul>
+ <li><a href="javascript: alert('not available')">Not Available</a>
+ </ul>
+
+ <h2>Package Status</h2>
+ <ul>
+ <li><font color="red"><b>ALPHA</b></font>
+ </ul>
+
+ <h2>Todo</h2>
+ <ul>
+ <li>???
+ </ul>
+
+ <!-- Put @see and @since tags down here. -->
+
+ </body>
+</html>
Property changes on: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/action/package.html
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/Cardinality.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,129 @@
+/*
+* 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.dependency.spi;
+
+import java.io.Serializable;
+
+/**
+ * Cardinality def.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Cardinality implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ private static final int INFINITY = -1;
+
+ public static Cardinality ZERO_TO_ONE = new Cardinality("0..1", 0, 1);
+ public static Cardinality ZERO_TO_MANY = new Cardinality("0..n", 0, INFINITY);
+ public static Cardinality ONE_TO_ONE = new Cardinality("1..1", 1, 1);
+ public static Cardinality ONE_TO_MANY = new Cardinality("1..n", 1, INFINITY);
+
+ private static Cardinality[] values = new Cardinality[]
+ {
+ ZERO_TO_ONE,
+ ZERO_TO_MANY,
+ ONE_TO_ONE,
+ ONE_TO_MANY
+ };
+
+ private String type;
+ private int left;
+ private int right;
+
+ private Cardinality(String type, int left, int right)
+ {
+ this.type = type;
+ this.left = left;
+ this.right = right;
+ }
+
+ /**
+ * Get the cardinality by type.
+ *
+ * @param type the commont type
+ * @return cardinality by type
+ */
+ public static Cardinality toCardinality(String type)
+ {
+ for (Cardinality c : values)
+ {
+ if (c.getType().equals(type))
+ {
+ return c;
+ }
+ }
+ throw new IllegalArgumentException("Illegal Cardinality value: " + type);
+ }
+
+ /**
+ * Create cardinality which starts at #start and has no limit.
+ *
+ * @param start the left number of cardinality interval
+ * @return cardinality
+ * @see org.jboss.dependency.spi.Cardinality#createCardinality(int,int)
+ */
+ public static Cardinality createUnlimitedCardinality(int start)
+ {
+ return createCardinality(start, INFINITY);
+ }
+
+ /**
+ * Create cardinality which ends at #end and starts at zero.
+ *
+ * @param end the right number of cardinality interval
+ * @return cardinality
+ * @see org.jboss.dependency.spi.Cardinality#createCardinality(int,int)
+ */
+ public static Cardinality createLimitedCardinality(int end)
+ {
+ return createCardinality(0, end);
+ }
+
+ /**
+ * Create cardinality with [#left, #right] interval.
+ *
+ * @param left left point in interval
+ * @param right right point in interval
+ * @return cardinality
+ */
+ public static Cardinality createCardinality(int left, int right)
+ {
+ return new Cardinality(left + ".." + right, left, right);
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public int getLeft()
+ {
+ return left;
+ }
+
+ public int getRight()
+ {
+ return right;
+ }
+}
Added: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/InstallItem.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/InstallItem.java (rev 0)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/InstallItem.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -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.dependency.spi;
+
+/**
+ * Information about a install dependency.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface InstallItem
+{
+ /**
+ * Get the cardinality.
+ *
+ * @return cardinality
+ */
+ Cardinality getCardinality();
+
+ //todo
+}
Modified: projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/ErrorControllerContext.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/ErrorControllerContext.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/ErrorControllerContext.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -25,7 +25,7 @@
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/OtherControllerContext.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/OtherControllerContext.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/OtherControllerContext.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -25,7 +25,7 @@
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/RecursiveControllerContext.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/RecursiveControllerContext.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/RecursiveControllerContext.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -24,7 +24,7 @@
import java.util.HashMap;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
import org.jboss.test.dependency.controller.test.RecursiveControllerActionTestCase;
Modified: projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/TestControllerContext.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/TestControllerContext.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/support/TestControllerContext.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -25,7 +25,7 @@
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
Modified: projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/test/StateConsistencyUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/test/StateConsistencyUnitTestCase.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/dependency/src/tests/org/jboss/test/dependency/controller/test/StateConsistencyUnitTestCase.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -26,7 +26,7 @@
import junit.framework.Test;
import org.jboss.dependency.plugins.AbstractControllerContext;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerMode;
import org.jboss.dependency.spi.ControllerState;
Added: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/DeploymentResolver.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/DeploymentResolver.java (rev 0)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/DeploymentResolver.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,79 @@
+/*
+* 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.deployers.plugins.deployers.helpers;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * Create DeploymentControllerContext and setup
+ * its dependencies regarding meta data.
+ * Reverse on the undeploy.
+ *
+ * @param <T> the expected type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class DeploymentResolver<T> extends AbstractSimpleRealDeployer<T>
+{
+ private KernelController controller;
+
+ protected DeploymentResolver(Class<T> deploymentType, Kernel kernel)
+ {
+ super(deploymentType);
+ if (kernel == null)
+ throw new IllegalArgumentException("Null kernel");
+ controller = kernel.getController();
+ }
+
+ protected abstract void addDependencies(T deployment, DependencyInfo dependencyInfo);
+
+ public void deploy(DeploymentUnit unit, T deployment) throws DeploymentException
+ {
+ ControllerContext context = null; //new DeploymentControllerContext();
+ DependencyInfo dependencyInfo = context.getDependencyInfo();
+ addDependencies(deployment, dependencyInfo);
+ unit.addAttachment(ControllerContext.class, context);
+ try
+ {
+ controller.install(context);
+ }
+ catch (Throwable t)
+ {
+ unit.removeAttachment(ControllerContext.class);
+ DeploymentException.rethrowAsDeploymentException("Unable to resolve DependencyControllerContext.", t);
+ }
+ }
+
+ protected abstract void removeDependencies(T deployment, DependencyInfo dependencyInfo);
+
+ public void undeploy(DeploymentUnit unit, T deployment)
+ {
+ ControllerContext context = unit.getAttachment(ControllerContext.class);
+ DependencyInfo dependencyInfo = context.getDependencyInfo();
+ removeDependencies(deployment, dependencyInfo);
+ controller.uninstall(context.getName());
+ }
+}
Added: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/ManifestDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/ManifestDeployer.java (rev 0)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/ManifestDeployer.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,70 @@
+/*
+* 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.deployers.plugins.deployers.helpers;
+
+import java.io.InputStream;
+import java.util.jar.Manifest;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.metadata.ManifestMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Parse manifest.mf file.
+ * Prepare metadata from manifest's attributes.
+ *
+ * @param <T> the expected manifest type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class ManifestDeployer<T extends ManifestMetaData> extends AbstractParsingDeployer<T>
+{
+ protected ManifestDeployer(Class<T> deploymentType)
+ {
+ super(deploymentType);
+ }
+
+ protected abstract T createMetaData(Manifest manifest) throws Exception;
+
+ protected T parse(DeploymentUnit unit, VirtualFile file, T root) throws Exception
+ {
+ // todo - update once we have new vfs snapshot
+ InputStream is = file.openStream();
+ Manifest manifest;
+ try
+ {
+ manifest = new Manifest(is);
+ }
+ finally
+ {
+ is.close();
+ }
+ return createMetaData(manifest);
+ }
+
+ public void deploy(DeploymentUnit unit) throws DeploymentException
+ {
+ // todo - case sensitivity?
+ createMetaData(unit, "MANIFEST.MF", null);
+ }
+
+}
Added: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java (rev 0)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/metadata/AbstractManifestMetaData.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,50 @@
+/*
+* 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.deployers.plugins.metadata;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.Map;
+
+import org.jboss.deployers.spi.metadata.ManifestMetaData;
+
+/**
+ * Abstract manifest meta data.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractManifestMetaData implements ManifestMetaData, Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ protected Map<String, String> attributes = Collections.emptyMap();
+
+ public String getAttribute(String name)
+ {
+ return attributes.get(name);
+ }
+
+ protected void putAttribute(String name, String value)
+ {
+ attributes.put(name, value);
+ }
+}
Added: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/metadata/ManifestMetaData.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/metadata/ManifestMetaData.java (rev 0)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/spi/metadata/ManifestMetaData.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,38 @@
+/*
+* 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.deployers.spi.metadata;
+
+/**
+ * Manifest meta data model.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface ManifestMetaData
+{
+ /**
+ * Get the manifest attribute value.
+ *
+ * @param name the name
+ * @return attribute value or null if attribute doesn't exist
+ */
+ String getAttribute(String name);
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -21,7 +21,6 @@
*/
package org.jboss.beans.metadata.plugins.factory;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -31,6 +30,7 @@
import org.jboss.beans.metadata.spi.LifecycleMetaData;
import org.jboss.beans.metadata.spi.ParameterMetaData;
import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
import org.jboss.joinpoint.spi.Joinpoint;
import org.jboss.joinpoint.spi.JoinpointException;
import org.jboss.joinpoint.spi.MethodJoinpoint;
@@ -44,7 +44,7 @@
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
-public class GenericBeanFactory
+public class GenericBeanFactory implements BeanFactory
{
/** The configurator */
protected KernelConfigurator configurator;
@@ -91,11 +91,11 @@
Object result = joinpoint.dispatch();
if (properties != null && properties.size() > 0)
{
- for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
+ for (Object o : properties.entrySet())
{
- Map.Entry entry = (Map.Entry) i.next();
- String property = (String) entry.getKey();
- ValueMetaData vmd = (ValueMetaData) entry.getValue();
+ Map.Entry entry = (Map.Entry)o;
+ String property = (String)entry.getKey();
+ ValueMetaData vmd = (ValueMetaData)entry.getValue();
TargettedJoinpoint jp = configurator.getPropertySetterJoinPoint(info, property, cl, vmd);
jp.setTarget(result);
jp.dispatch();
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/factory/BeanFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/factory/BeanFactory.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/factory/BeanFactory.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -0,0 +1,38 @@
+/*
+* 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.beans.metadata.spi.factory;
+
+/**
+ * Bean factory interface.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface BeanFactory
+{
+ /**
+ * Create bean.
+ *
+ * @return bean
+ * @throws Throwable for any error
+ */
+ Object createBean() throws Throwable;
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextAction.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextAction.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextAction.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -21,13 +21,15 @@
*/
package org.jboss.kernel.plugins.dependency;
-import java.security.*;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
import java.util.List;
import org.jboss.beans.metadata.spi.BeanMetaData;
import org.jboss.beans.metadata.spi.LifecycleCallbackMetaData;
import org.jboss.beans.metadata.spi.ParameterMetaData;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.SimpleControllerContextAction;
import org.jboss.dependency.spi.Controller;
import org.jboss.dependency.spi.ControllerContext;
import org.jboss.dependency.spi.ControllerState;
@@ -51,7 +53,7 @@
* @author <a href="adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
-public class KernelControllerContextAction implements ControllerContextAction
+public class KernelControllerContextAction extends SimpleControllerContextAction<KernelControllerContext>
{
/**
* Static log
@@ -133,69 +135,16 @@
}
}
- public void install(final ControllerContext context) throws Throwable
+ protected boolean validateContext(ControllerContext context)
{
- if (System.getSecurityManager() == null || context instanceof AbstractKernelControllerContext == false)
- installAction((KernelControllerContext) context);
- else
- {
- PrivilegedExceptionAction<Object> action = new PrivilegedExceptionAction<Object>()
- {
- public Object run() throws Exception
- {
- try
- {
- installAction((KernelControllerContext) context);
- return null;
- }
- catch (RuntimeException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw e;
- }
- catch (Error e)
- {
- throw e;
- }
- catch (Throwable t)
- {
- throw new RuntimeException(t);
- }
- }
- };
- try
- {
- AccessController.doPrivileged(action);
- }
- catch (PrivilegedActionException e)
- {
- throw e.getCause();
- }
- }
+ return (context instanceof AbstractKernelControllerContext);
}
- public void uninstall(final ControllerContext context)
+ protected KernelControllerContext contextCast(ControllerContext context)
{
- if (System.getSecurityManager() == null || context instanceof AbstractKernelControllerContext == false)
- uninstallAction((KernelControllerContext) context);
- else
- {
- PrivilegedAction<Object> action = new PrivilegedAction<Object>()
- {
- public Object run()
- {
- uninstallAction((KernelControllerContext) context);
- return null;
- }
- };
- AccessController.doPrivileged(action);
- }
+ return KernelControllerContext.class.cast(context);
}
-
public void installAction(KernelControllerContext context) throws Throwable
{
installActionInternal(context);
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -25,7 +25,7 @@
import java.util.Map;
import org.jboss.dependency.plugins.AbstractControllerContextActions;
-import org.jboss.dependency.plugins.spi.action.ControllerContextAction;
+import org.jboss.dependency.plugins.action.ControllerContextAction;
import org.jboss.dependency.spi.ControllerState;
/**
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -22,8 +22,7 @@
package org.jboss.test.kernel.deployment.test;
import junit.framework.Test;
-
-import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
import org.jboss.kernel.spi.deployment.KernelDeployment;
/**
@@ -60,13 +59,13 @@
bean = getBean("NotConfiguredClassLoader");
assertEquals(getClass().getClassLoader(), bean.getClass().getClassLoader());
- GenericBeanFactory factory = (GenericBeanFactory) getBean("FactoryDeploymentConfiguredClassLoader");
+ BeanFactory factory = (BeanFactory) getBean("FactoryDeploymentConfiguredClassLoader");
bean = factory.createBean();
assertEquals(deploymentCL, bean.getClass().getClassLoader());
- factory = (GenericBeanFactory) getBean("FactoryBeanConfiguredClassLoader");
+ factory = (BeanFactory) getBean("FactoryBeanConfiguredClassLoader");
bean = factory.createBean();
assertEquals(beanCL, bean.getClass().getClassLoader());
- factory = (GenericBeanFactory) getBean("FactoryNotConfiguredClassLoader");
+ factory = (BeanFactory) getBean("FactoryNotConfiguredClassLoader");
bean = factory.createBean();
assertEquals(getClass().getClassLoader(), bean.getClass().getClassLoader());
}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.java 2007-04-02 00:06:29 UTC (rev 61977)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.java 2007-04-02 10:15:34 UTC (rev 61978)
@@ -22,8 +22,7 @@
package org.jboss.test.kernel.deployment.test;
import junit.framework.Test;
-
-import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
import org.jboss.test.kernel.deployment.support.SimpleBeanWithLifecycle;
/**
@@ -46,13 +45,13 @@
public void testGenericBeanFactoryLifecycle() throws Throwable
{
- GenericBeanFactory factory = (GenericBeanFactory) getBean("Name1");
+ BeanFactory factory = (BeanFactory) getBean("Name1");
SimpleBeanWithLifecycle bean = (SimpleBeanWithLifecycle) factory.createBean();
assertTrue(bean.createInvoked);
assertTrue(bean.startInvoked);
assertFalse(bean.notCreateInvoked);
assertFalse(bean.notStartInvoked);
- factory = (GenericBeanFactory) getBean("Name2");
+ factory = (BeanFactory) getBean("Name2");
bean = (SimpleBeanWithLifecycle) factory.createBean();
assertFalse(bean.createInvoked);
assertFalse(bean.startInvoked);
More information about the jboss-cvs-commits
mailing list