[Design the new POJO MicroContainer] - Re: OSGi integration
by alesj
"scott.stark(a)jboss.org" wrote : Its not clear that this is the right thing to do as mapping osgi onto spring on top of the mc is not what we want. What we want is a mapping of the osgi concepts onto the mc metdata/wiring of the beans with help from supporting osgi interface implementations.
|
I wouldn't go over Spring to map it to MC.
I ment that we can go in the same impl direction - core + starter (extender) bundle. But definitely with our metadata/wiring.
"scott.stark(a)jboss.org" wrote :
| The starting point should be usecases decribing what we mean by support for osgi.
I would support similar things as the Spring spec (+ joined work of OSGi EG members) supports - as I went over that, I saw no problems that we might have with implementing this on top of MC.
That is a simple introduction of additional OSGi based XML (annotation) definition - OSGi service, reference, ... - but wired with existing MC beans.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997102#3997102
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997102
17 years, 12 months
[Design of AOP on JBoss (Aspects/JBoss)] - Update AOPTestDelegate to better integrate into eclipse
by scott.stark@jboss.org
Currently you cannot run the tests easily from within eclise using the run as junit... capability because the test harness does not locate the jboss-aop.xml based on the classpath. Something like this does this:
| package org.jboss.test.aop;
|
| import java.net.URL;
| import java.util.Properties;
|
| import org.jboss.aop.AspectXmlLoader;
| import org.jboss.test.AbstractTestDelegate;
|
| /**
| *
| * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
| * @version $Revision: 45977 $
| */
| public class AOPTestDelegate extends AbstractTestDelegate
| {
| /** The AOP URL used */
| private URL aopURL;
|
| Properties systemProps;
|
| public AOPTestDelegate(Class clazz)
| {
| // FIXME AOPTestDelegate constructor
| super(clazz);
| systemProps = (Properties)System.getProperties().clone();
| }
|
| public Properties getSystemProperties()
| {
| return systemProps;
| }
|
| /**
| * Look for a test specific aop descriptor based on the ctor
| * class first, and if none is found, the ManagedTest.class.
| */
| public void setUp() throws Exception
| {
| super.setUp();
| deployAOP(clazz);
| }
|
| /**
| * Undeployment any test specific aop descriptor deployed in setUp.
| */
| public void tearDown() throws Exception
| {
| super.tearDown();
| undeployAOP();
| }
|
| /**
| * Look for a test specific resource name by appending "-aop.xml"
| * to the referenceClass name as a resource. For example, a.b.SomeTest
| * would produce a a/b/SomeTest-aop.xml resource that is queried
| * for using clazz.getClassLoader().getResource("a/b/SomeTest-aop.xml");
| *
| * @param referenceClass - the class to use as the aop descriptor base name.
| * @return true if the aop descriptor was found and deployed,
| * false otherwise.
| * @throws Exception on failure to deploy the aop descriptor.
| */
| protected boolean deployAOP(Class referenceClass) throws Exception
| {
| String testName = referenceClass.getName();
| String pkg = referenceClass.getPackage().getName();
| int dot = pkg.lastIndexOf('.');
| if( dot > 0 )
| pkg = pkg.substring(dot+1);
| testName = pkg + "/jboss-aop.xml";
| URL url = clazz.getClassLoader().getResource(testName);
| if (url != null)
| {
| log.debug("Deploying " + url);
| aopURL = url;
| try
| {
| AspectXmlLoader.deployXML(aopURL);
| }
| catch (Throwable t)
| {
| throw new RuntimeException("Error deploying: " + url, t);
| }
| return true;
| }
| else
| {
| log.debug("No test specific deployment " + testName);
| return false;
| }
| }
|
| /**
| * Undeploy the aop descriptor deployed in deployAOP if
| * one was found.
| *
| */
| protected void undeployAOP()
| {
| if (aopURL == null)
| return;
| try
| {
| log.debug("Undeploying " + aopURL);
| AspectXmlLoader.undeployXML(aopURL);
| }
| catch (Exception e)
| {
| log.warn("Ignored error undeploying " + aopURL, e);
| }
| }
|
| }
|
Although this does deploy the aspects, the test I tried this with (org.jboss.test.aop.precedence.PrecedenceTester) is still failing. Can you look into getting this working Kabir?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3997099#3997099
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3997099
17 years, 12 months