[webbeans-commits] Webbeans SVN: r2017 - in ri/trunk/impl/src: main/java/org/jboss/webbeans/bean and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 17:07:30 -0400 (Sun, 15 Mar 2009)
New Revision: 2017
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/ejb/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/ejb/interceptor/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
Log:
WBRI-187
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-15 19:55:43 UTC (rev 2016)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -68,9 +68,9 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.EventManager;
import org.jboss.webbeans.event.ObserverImpl;
+import org.jboss.webbeans.injection.NonContextualInjector;
import org.jboss.webbeans.injection.ResolvableAnnotatedClass;
import org.jboss.webbeans.injection.Resolver;
-import org.jboss.webbeans.injection.NonContextualInjector;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -122,6 +122,9 @@
private transient List<Bean<?>> beans;
// The registered beans, mapped by implementation class
private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
+
+ private transient final Map<String, RIBean<?>> riBeans;
+
// The registered decorators
private transient final Set<Decorator> decorators;
// The registered interceptors
@@ -146,6 +149,7 @@
this.serviceRegistry = serviceRegistry;
this.beans = new CopyOnWriteArrayList<Bean<?>>();
this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
+ this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
this.resolver = new Resolver(this);
this.clientProxyProvider = new ClientProxyProvider();
this.decorators = new HashSet<Decorator>();
@@ -372,6 +376,7 @@
{
newEnterpriseBeanMap.put(bean.getType(), (EnterpriseBean<?>) bean);
}
+ riBeans.put(bean.getId(), bean);
}
resolver.clear();
}
@@ -396,6 +401,11 @@
{
return Collections.unmodifiableList(beans);
}
+
+ public Map<String, RIBean<?>> getRiBeans()
+ {
+ return Collections.unmodifiableMap(riBeans);
+ }
/**
* Registers a context with the manager
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-03-15 19:55:43 UTC (rev 2016)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -23,6 +23,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
import javax.inject.manager.Manager;
/**
@@ -141,6 +142,12 @@
{
return delegate().isSerializable();
}
+
+ @Override
+ public Set<? extends InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
/**
* Gets the hash code of the delegate
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-03-15 19:55:43 UTC (rev 2016)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -16,7 +16,9 @@
*/
package org.jboss.webbeans.bean;
+import java.io.Serializable;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
import javax.context.Dependent;
import javax.inject.manager.Bean;
@@ -29,14 +31,21 @@
*
* @author Pete Muir
*/
-public abstract class RIBean<T> extends Bean<T>
+public abstract class RIBean<T> extends Bean<T> implements Serializable
{
+
+ private static final AtomicInteger idGenerator = new AtomicInteger();
+
private final ManagerImpl manager;
+
+ private final String id;
protected RIBean(ManagerImpl manager)
{
super(manager);
this.manager = manager;
+ // TODO better ID strategy (human readable)
+ this.id = getClass().getName() + "-" + idGenerator.getAndIncrement();
}
@Override
@@ -61,5 +70,10 @@
public abstract Set<AnnotatedInjectionPoint<?, ?>> getInjectionPoints();
public abstract RIBean<?> getSpecializedBean();
+
+ public String getId()
+ {
+ return id;
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2009-03-15 19:55:43 UTC (rev 2016)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/SessionBeanInterceptor.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -17,6 +17,10 @@
package org.jboss.webbeans.ejb;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.interceptor.InvocationContext;
@@ -33,13 +37,13 @@
*
* @author Pete Muir
*/
-public class SessionBeanInterceptor
+public class SessionBeanInterceptor implements Serializable
{
private transient Log log = Logging.getLog(SessionBeanInterceptor.class);
- // TODO make Bean serializable
private transient EnterpriseBean<Object> bean;
+ private String beanId;
private boolean contextual;
/**
@@ -98,6 +102,7 @@
this.bean = (EnterpriseBean<Object>) CurrentManager.rootManager().getNewEnterpriseBeanMap().get(beanClass);
this.contextual = false;
}
+ this.beanId = this.bean.getId();
}
private static <T> EnterpriseBeanInstance getEnterpriseBeanInstance(EnterpriseBean<T> bean)
@@ -112,6 +117,20 @@
throw new IllegalStateException("Contextual instance not an session bean created by the container");
}
}
+
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException
+ {
+ ois.defaultReadObject();
+ if (beanId != null)
+ {
+ bean = (EnterpriseBean<Object>) CurrentManager.rootManager().getRiBeans().get(beanId);
+ }
+ }
+
+ protected EnterpriseBean<Object> getBean()
+ {
+ return bean;
+ }
}
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-03-15 19:55:43 UTC (rev 2016)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -19,4 +19,6 @@
}
+
+
}
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -0,0 +1,10 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import javax.ejb.Stateful;
+
+
+@Stateful
+public class Foo implements FooLocal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import javax.ejb.Local;
+
+@Local
+public interface FooLocal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/FooLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -0,0 +1,48 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.interceptor.InvocationContext;
+
+public class MockInvocationContext implements InvocationContext
+{
+
+ private Foo foo = new Foo();
+
+ public Map<String, Object> getContextData()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Method getMethod()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object[] getParameters()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object getTarget()
+ {
+ return foo;
+ }
+
+ public Object proceed() throws Exception
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public void setParameters(Object[] params)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockInvocationContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.ejb.SessionBeanInterceptor;
+
+public class MockSessionBeanInterceptor extends SessionBeanInterceptor
+{
+
+ @Override
+ public EnterpriseBean<Object> getBean()
+ {
+ return super.getBean();
+ }
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/MockSessionBeanInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java 2009-03-15 21:07:30 UTC (rev 2017)
@@ -0,0 +1,47 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise.sbi;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.inject.manager.Bean;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class SessionBeanInterceptorTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testSerializeSessionBeanInterceptor() throws Exception
+ {
+ Bean<?> foobean = manager.getNewEnterpriseBeanMap().get(Foo.class);
+ assert foobean != null;
+ MockSessionBeanInterceptor interceptor = new MockSessionBeanInterceptor();
+ interceptor.postConstruct(new MockInvocationContext());
+ assert interceptor.getBean() != null;
+ Bean<?> bean = interceptor.getBean();
+ interceptor = (MockSessionBeanInterceptor) deserialize(serialize(interceptor));
+ assert interceptor.getBean() != null;
+ assert bean.equals(interceptor.getBean());
+ }
+
+ protected byte[] serialize(Object instance) throws IOException
+ {
+ ByteArrayOutputStream bytes = new ByteArrayOutputStream();
+ ObjectOutputStream out = new ObjectOutputStream(bytes);
+ out.writeObject(instance);
+ return bytes.toByteArray();
+ }
+
+ protected Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
+ {
+ ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+ return in.readObject();
+ }
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/sbi/SessionBeanInterceptorTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2016 - ri/trunk/impl/src/main/java/org/jboss/webbeans/event.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:55:43 -0400 (Sun, 15 Mar 2009)
New Revision: 2016
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
Log:
remove JTA deps
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-03-15 19:54:16 UTC (rev 2015)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-03-15 19:55:43 UTC (rev 2016)
@@ -20,6 +20,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
* Basic factory class that produces implicit observers for observer methods.
@@ -40,7 +41,7 @@
public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
{
ObserverImpl<T> result = null;
- if (TransactionalObserverImpl.isObserverMethodTransactional(method))
+ if (manager.getServices().contains(TransactionServices.class) && TransactionalObserverImpl.isObserverMethodTransactional(method))
{
result = new TransactionalObserverImpl<T>(method, declaringBean, manager);
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2015 - in extensions/trunk/se: src/main/java/org/jboss/webbeans/environment/se and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:54:16 -0400 (Sun, 15 Mar 2009)
New Revision: 2015
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
Removed:
extensions/trunk/se/src/test/resources/log4j.properties
Modified:
extensions/trunk/se/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java
Log:
minor improvements
Property changes on: extensions/trunk/se
___________________________________________________________________
Name: svn:ignore
- nbactions.xml
target
.classpath
.project
.settings
temp-testng-customsuite.xml
+ nbactions.xml
target
.classpath
.project
.settings
temp-testng-customsuite.xml
test-output
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java 2009-03-15 19:54:16 UTC (rev 2015)
@@ -0,0 +1,52 @@
+package org.jboss.webbeans.environment.se;
+
+import javax.context.ApplicationScoped;
+import javax.event.Observes;
+import javax.inject.manager.Manager;
+
+import org.apache.log4j.Logger;
+import org.jboss.webbeans.bootstrap.api.Bootstrap;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.environment.se.events.Shutdown;
+
+@ApplicationScoped
+public class ShutdownManager
+{
+
+ private static Logger log = Logger.getLogger(ShutdownManager.class);
+
+ private boolean hasShutdownBeenCalled = false;
+
+ private Bootstrap bootstrap;
+
+ /**
+ * The observer of the optional shutdown request which will in turn fire the
+ * Shutdown event.
+ *
+ * @param shutdownRequest
+ */
+ public void shutdown(@Observes @Shutdown Manager shutdownRequest)
+ {
+ synchronized (this)
+ {
+
+ if (!hasShutdownBeenCalled)
+ {
+ hasShutdownBeenCalled = true;
+ bootstrap.shutdown();
+ DependentContext.INSTANCE.setActive(false);
+ }
+ else
+ {
+ log.debug("Skipping spurious call to shutdown");
+ log.trace(Thread.currentThread().getStackTrace());
+ }
+ }
+ }
+
+ public void setBootstrap(Bootstrap bootstrap)
+ {
+ this.bootstrap = bootstrap;
+ }
+
+}
Property changes on: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/ShutdownManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 19:45:58 UTC (rev 2014)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 19:54:16 UTC (rev 2015)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.environment.se;
-import javax.event.Observes;
import javax.inject.manager.Manager;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
@@ -27,11 +26,9 @@
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.environment.se.beans.ParametersFactory;
import org.jboss.webbeans.environment.se.discovery.SEWebBeanDiscovery;
-import org.jboss.webbeans.environment.se.events.Shutdown;
import org.jboss.webbeans.environment.se.resources.NoNamingContext;
import org.jboss.webbeans.environment.se.util.Reflections;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.manager.api.WebBeansManager;
import org.jboss.webbeans.resources.spi.NamingContext;
/**
@@ -51,9 +48,10 @@
private final Bootstrap bootstrap;
private final BeanStore applicationBeanStore;
private String[] args;
- private boolean hasShutdownBeenCalled = false;
- Log log = Logging.getLog(StartMain.class);
+ private WebBeansManager manager;
+
+
public StartMain(String[] commandLineArgs)
{
this.args = commandLineArgs;
@@ -76,8 +74,10 @@
bootstrap.setApplicationContext(applicationBeanStore);
bootstrap.initialize();
bootstrap.boot();
+ this.manager = bootstrap.getManager();
bootstrap.getManager().getInstanceByType(ParametersFactory.class).setArgs(args);
DependentContext.INSTANCE.setActive(true);
+ bootstrap.getManager().getInstanceByType(ShutdownManager.class).setBootstrap(bootstrap);
}
/**
@@ -89,31 +89,13 @@
*/
public static void main(String[] args)
{
- new StartMain(args).go();
+ new StartMain(args).main();
}
- /**
- * The observer of the optional shutdown request which will in turn fire the
- * Shutdown event.
- *
- * @param shutdownRequest
- */
- public void shutdown(@Observes @Shutdown Manager shutdownRequest)
+ public Manager main()
{
- synchronized (this)
- {
-
- if (!hasShutdownBeenCalled)
- {
- hasShutdownBeenCalled = true;
- bootstrap.shutdown();
- }
- else
- {
- log.debug("Skipping spurious call to shutdown");
- log.trace(Thread.currentThread().getStackTrace());
- }
- }
+ go();
+ return manager;
}
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java 2009-03-15 19:45:58 UTC (rev 2014)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java 2009-03-15 19:54:16 UTC (rev 2015)
@@ -18,8 +18,7 @@
import java.net.URL;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
+import org.apache.log4j.Logger;
/**
* Abstract base class for {@link Scanner} providing common functionality
@@ -32,7 +31,7 @@
public abstract class AbstractScanner implements Scanner
{
- private static final LogProvider log = Logging.getLogProvider(Scanner.class);
+ private static final Logger log = Logger.getLogger(Scanner.class);
private final ClassLoader classLoader;
private final SEWebBeanDiscovery webBeanDiscovery;
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java 2009-03-15 19:45:58 UTC (rev 2014)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java 2009-03-15 19:54:16 UTC (rev 2015)
@@ -29,8 +29,7 @@
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
+import org.apache.log4j.Logger;
/**
* Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
@@ -43,7 +42,7 @@
*/
public class URLScanner extends AbstractScanner
{
- private static final LogProvider log = Logging.getLogProvider(URLScanner.class);
+ private static final Logger log = Logger.getLogger(URLScanner.class);
public URLScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
{
Modified: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java 2009-03-15 19:45:58 UTC (rev 2014)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java 2009-03-15 19:54:16 UTC (rev 2015)
@@ -19,7 +19,6 @@
import javax.inject.AnnotationLiteral;
import javax.inject.manager.Manager;
-import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.environment.se.StartMain;
import org.jboss.webbeans.environment.se.events.Shutdown;
import org.jboss.webbeans.environment.se.test.beans.MainTestBean;
@@ -45,9 +44,8 @@
public void testMain()
{
String[] args = ARGS ;
- StartMain.main( args );
+ Manager manager = new StartMain(args).main();
- Manager manager = CurrentManager.rootManager();
MainTestBean mainTestBean = manager.getInstanceByType( MainTestBean.class );
Assert.assertNotNull( mainTestBean );
@@ -61,6 +59,16 @@
Assert.assertEquals( ARGS[2], paramsBean.getParam3() );
manager.fireEvent( manager, new AnnotationLiteral<Shutdown>() {} );
+ boolean contextNotActive = false;
+ try
+ {
+ assert manager.getInstanceByType(MainTestBean.class) == null;
+ }
+ catch (Exception e)
+ {
+ contextNotActive = true;
+ }
+ assert contextNotActive;
}
}
Deleted: extensions/trunk/se/src/test/resources/log4j.properties
===================================================================
--- extensions/trunk/se/src/test/resources/log4j.properties 2009-03-15 19:45:58 UTC (rev 2014)
+++ extensions/trunk/se/src/test/resources/log4j.properties 2009-03-15 19:54:16 UTC (rev 2015)
@@ -1,25 +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.
-#
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=DEBUG, A1
-
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2014 - extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:45:58 -0400 (Sun, 15 Mar 2009)
New Revision: 2014
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
Log:
minor
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 19:29:28 UTC (rev 2013)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 19:45:58 UTC (rev 2014)
@@ -22,11 +22,12 @@
* @author Pete Muir
*
*/
-public class Reflections
+public abstract class Reflections
{
- private Reflections(String name)
+ private Reflections()
{
+ // TODO Auto-generated constructor stub
}
public static <T> T newInstance(String className, Class<T> expectedType) throws InstantiationException, IllegalAccessException, ClassNotFoundException
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2012 - ri/trunk/spi.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:27:00 -0400 (Sun, 15 Mar 2009)
New Revision: 2012
Modified:
ri/trunk/spi/pom.xml
Log:
minor
Modified: ri/trunk/spi/pom.xml
===================================================================
--- ri/trunk/spi/pom.xml 2009-03-15 19:25:33 UTC (rev 2011)
+++ ri/trunk/spi/pom.xml 2009-03-15 19:27:00 UTC (rev 2012)
@@ -38,6 +38,7 @@
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
+ <optional>true</optional>
</dependency>
</dependencies>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2011 - in extensions/trunk/se: src/main/java/org/jboss/webbeans/environment/se and 5 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 15:25:33 -0400 (Sun, 15 Mar 2009)
New Revision: 2011
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
extensions/trunk/se/test-output/
extensions/trunk/se/test-output/emailable-report.html
extensions/trunk/se/test-output/index.html
extensions/trunk/se/test-output/se-module/
extensions/trunk/se/test-output/se-module/classes.html
extensions/trunk/se/test-output/se-module/groups.html
extensions/trunk/se/test-output/se-module/index.html
extensions/trunk/se/test-output/se-module/main.html
extensions/trunk/se/test-output/se-module/methods-alphabetical.html
extensions/trunk/se/test-output/se-module/methods-not-run.html
extensions/trunk/se/test-output/se-module/methods.html
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
extensions/trunk/se/test-output/se-module/reporter-output.html
extensions/trunk/se/test-output/se-module/testng.xml.html
extensions/trunk/se/test-output/se-module/toc.html
extensions/trunk/se/test-output/testng-results.xml
extensions/trunk/se/test-output/testng.css
Removed:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
Modified:
extensions/trunk/se/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
Log:
Simplify class discovery
Property changes on: extensions/trunk/se
___________________________________________________________________
Name: svn:ignore
- nbactions.xml
target
.classpath
.project
.settings
+ nbactions.xml
target
.classpath
.project
.settings
temp-testng-customsuite.xml
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 18:47:48 UTC (rev 2010)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -26,7 +26,7 @@
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.environment.se.beans.ParametersFactory;
-import org.jboss.webbeans.environment.se.discovery.WebBeanDiscoveryImpl;
+import org.jboss.webbeans.environment.se.discovery.SEWebBeanDiscovery;
import org.jboss.webbeans.environment.se.events.Shutdown;
import org.jboss.webbeans.environment.se.resources.NoNamingContext;
import org.jboss.webbeans.environment.se.util.Reflections;
@@ -71,8 +71,8 @@
private void go()
{
bootstrap.setEnvironment(Environments.SE);
- bootstrap.getServices().add(WebBeanDiscovery.class, new WebBeanDiscoveryImpl());
- bootstrap.getServices().add(NamingContext.class, new NoNamingContext());
+ bootstrap.getServices().add(WebBeanDiscovery.class, new SEWebBeanDiscovery() {});
+ bootstrap.getServices().add(NamingContext.class, new NoNamingContext() {});
bootstrap.setApplicationContext(applicationBeanStore);
bootstrap.initialize();
bootstrap.boot();
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/AbstractScanner.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,83 @@
+/**
+ * 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.environment.se.discovery;
+
+import java.net.URL;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Abstract base class for {@link Scanner} providing common functionality
+ *
+ * This class provides file-system orientated scanning
+ *
+ * @author Pete Muir
+ *
+ */
+public abstract class AbstractScanner implements Scanner
+{
+
+ private static final LogProvider log = Logging.getLogProvider(Scanner.class);
+ private final ClassLoader classLoader;
+ private final SEWebBeanDiscovery webBeanDiscovery;
+
+ public AbstractScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ {
+ this.classLoader = classLoader;
+ this.webBeanDiscovery = webBeanDiscovery;
+ }
+
+ protected void handle(String name, URL url)
+ {
+ if (name.endsWith(".class"))
+ {
+ String className = filenameToClassname(name);
+ try
+ {
+ webBeanDiscovery.getWbClasses().add(getClassLoader().loadClass(className));
+ }
+ catch (NoClassDefFoundError e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.error("Error loading " + name, e);
+ }
+ }
+ else if (name.endsWith("beans.xml"))
+ {
+ webBeanDiscovery.getWbUrls().add(url);
+ }
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+
+ /**
+ * Convert a path to a class file to a class name
+ */
+ public static String filenameToClassname(String filename)
+ {
+ return filename.substring( 0, filename.lastIndexOf(".class") )
+ .replace('/', '.').replace('\\', '.');
+ }
+
+}
Copied: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java (from rev 2010, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/SEWebBeanDiscovery.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,74 @@
+/**
+ * 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.environment.se.discovery;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.environment.se.util.Reflections;
+
+/**
+ * The means by which Web Beans are discovered on the classpath. This will only
+ * discover simple web beans - there is no EJB/Servlet/JPA integration.
+ *
+ * @author Peter Royle
+ * @author Pete Muir
+ * @author Ales Justin
+ */
+public abstract class SEWebBeanDiscovery implements WebBeanDiscovery
+{
+
+ private final Set<Class<?>> wbClasses;
+ private final Set<URL> wbUrls;
+
+ public SEWebBeanDiscovery()
+ {
+ this.wbClasses = new HashSet<Class<?>>();
+ this.wbUrls = new HashSet<URL>();
+ scan();
+ }
+
+ public Iterable<Class<?>> discoverWebBeanClasses()
+ {
+ return Collections.unmodifiableSet(wbClasses);
+ }
+
+ public Iterable<URL> discoverWebBeansXml()
+ {
+ return Collections.unmodifiableSet(wbUrls);
+ }
+
+ public Set<Class<?>> getWbClasses()
+ {
+ return wbClasses;
+ }
+
+ public Set<URL> getWbUrls()
+ {
+ return wbUrls;
+ }
+
+ private void scan()
+ {
+ Scanner scanner = new URLScanner(Reflections.getClassLoader(), this);
+ scanner.scanResources(new String[] { "beans.xml" });
+ }
+
+}
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/Scanner.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,47 @@
+/**
+ * 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.environment.se.discovery;
+
+import java.io.File;
+
+/**
+ * The Scanner is used to find resources to be processed by Seam
+ *
+ * The processing is done by {@link DeploymentHandler}s
+ *
+ * @author Pete Muir
+ *
+ */
+public interface Scanner
+{
+ /**
+ * Recursively scan directories.
+ *
+ * @param directories
+ * An array of the roots of the directory trees to scan
+ */
+ public void scanDirectories(File[] directories);
+
+ /**
+ * Scan for structures which contain any of the given resources in their root
+ *
+ * @param resources
+ * The resources to scan for
+ */
+ public void scanResources(String[] resources);
+
+}
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/URLScanner.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,199 @@
+/**
+ * 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.environment.se.discovery;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
+/**
+ * Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
+ *
+ * @author Thomas Heute
+ * @author Gavin King
+ * @author Norman Richards
+ * @author Pete Muir
+ *
+ */
+public class URLScanner extends AbstractScanner
+{
+ private static final LogProvider log = Logging.getLogProvider(URLScanner.class);
+
+ public URLScanner(ClassLoader classLoader, SEWebBeanDiscovery webBeanDiscovery)
+ {
+ super(classLoader, webBeanDiscovery);
+ }
+
+ public void scanDirectories(File[] directories)
+ {
+ for (File directory : directories)
+ {
+ handleDirectory(directory, null);
+ }
+ }
+
+ public void scanResources(String[] resources)
+ {
+ Set<String> paths = new HashSet<String>();
+
+ for (String resourceName : resources)
+ {
+ try
+ {
+ Enumeration<URL> urlEnum = getClassLoader().getResources(resourceName);
+
+ while (urlEnum.hasMoreElements())
+ {
+ String urlPath = urlEnum.nextElement().getFile();
+ urlPath = URLDecoder.decode(urlPath, "UTF-8");
+
+ if (urlPath.startsWith("file:"))
+ {
+ urlPath = urlPath.substring(5);
+ }
+
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+ else
+ {
+ File dirOrArchive = new File(urlPath);
+
+ if ((resourceName != null) && (resourceName.lastIndexOf('/') > 0))
+ {
+ // for META-INF/components.xml
+ dirOrArchive = dirOrArchive.getParentFile();
+ }
+
+ urlPath = dirOrArchive.getParent();
+ }
+
+ paths.add(urlPath);
+ }
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read: " + resourceName, ioe);
+ }
+ }
+
+ handle(paths);
+ }
+
+ protected void handle(Set<String> paths)
+ {
+ for (String urlPath : paths)
+ {
+ try
+ {
+ log.trace("scanning: " + urlPath);
+
+ File file = new File(urlPath);
+
+ if (file.isDirectory())
+ {
+ handleDirectory(file, null);
+ }
+ else
+ {
+ handleArchiveByFile(file);
+ }
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read entries", ioe);
+ }
+ }
+ }
+
+ private void handleArchiveByFile(File file) throws IOException
+ {
+ try
+ {
+ log.trace("archive: " + file);
+
+ ZipFile zip = new ZipFile(file);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ handle(name, getClassLoader().getResource(name));
+ }
+ }
+ catch (ZipException e)
+ {
+ throw new RuntimeException("Error handling file " + file, e);
+ }
+ }
+
+ private void handleDirectory(File file, String path)
+ {
+ handleDirectory(file, path, new File[0]);
+ }
+
+ private void handleDirectory(File file, String path, File[] excludedDirectories)
+ {
+ for (File excludedDirectory : excludedDirectories)
+ {
+ if (file.equals(excludedDirectory))
+ {
+ log.trace("skipping excluded directory: " + file);
+
+ return;
+ }
+ }
+
+ log.trace("handling directory: " + file);
+
+ for (File child : file.listFiles())
+ {
+ String newPath = (path == null) ? child.getName() : (path + '/' + child.getName());
+
+ if (child.isDirectory())
+ {
+ handleDirectory(child, newPath, excludedDirectories);
+ }
+ else
+ {
+ try
+ {
+ handle(newPath, child.toURI().toURL());
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Error loading file " + newPath);
+ }
+ }
+ }
+ }
+
+}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15 18:47:48 UTC (rev 2010)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -1,41 +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.environment.se.discovery;
-
-/**
- * Thrown if there's an error during Web Bean discoery that will stop the
- * manager from starting up.
- *
- * @author Peter Royle
- */
-public class WebBeanDiscoveryException extends RuntimeException
-{
- public WebBeanDiscoveryException(Throwable cause)
- {
- super(cause);
- }
-
- public WebBeanDiscoveryException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public WebBeanDiscoveryException(String message)
- {
- super(message);
- }
-}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15 18:47:48 UTC (rev 2010)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -1,101 +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.environment.se.discovery;
-
-import java.io.File;
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-import org.jboss.webbeans.environment.se.deployment.ClassDescriptor;
-import org.jboss.webbeans.environment.se.deployment.DeploymentHandler;
-import org.jboss.webbeans.environment.se.deployment.FileDescriptor;
-import org.jboss.webbeans.environment.se.deployment.SimpleWebBeansDeploymentHandler;
-import org.jboss.webbeans.environment.se.deployment.URLScanner;
-import org.jboss.webbeans.environment.se.deployment.WebBeansXmlDeploymentHandler;
-
-/**
- * The means by which Web Beans are discovered on the classpath. This will only
- * discover simple web beans - there is no EJB/Servlet/JPA integration.
- *
- * @author Peter Royle. Adapted from
- * org.jboss.webbeans.integration.jbossas.WebBeansDiscoveryImpl (author
- * unknown)
- */
-public class WebBeanDiscoveryImpl implements WebBeanDiscovery
-{
-
- private Set<Class<?>> wbClasses = new HashSet<Class<?>>();
- private Set<URL> wbUrls = new HashSet<URL>();
- // private StandardDeploymentStrategy deploymentStrategy;
- private SimpleWebBeansDeploymentHandler simpleWebBeansDeploymentHandler = new SimpleWebBeansDeploymentHandler();
- private WebBeansXmlDeploymentHandler webBeansXmlDeploymentHandler = new WebBeansXmlDeploymentHandler();
- URLScanner urlScanner;
-
- // The log provider
- private static Logger log = Logger.getLogger(WebBeanDiscoveryImpl.class.getName());
-
- public WebBeanDiscoveryImpl()
- {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- Set<DeploymentHandler> deploymentHandlers = new HashSet<DeploymentHandler>();
- deploymentHandlers.add(simpleWebBeansDeploymentHandler);
- deploymentHandlers.add(webBeansXmlDeploymentHandler);
-
- urlScanner = new URLScanner(deploymentHandlers, contextClassLoader);
- urlScanner.scanResources(new String[] { "beans.xml" });
- urlScanner.scanDirectories(new File[] {});
-
- findWebBeansXmlUrls();
- findWebBeansAnnotatedClasses();
- }
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- return new HashSet<EjbDescriptor<?>>();
- }
-
- public Iterable<Class<?>> discoverWebBeanClasses()
- {
- return wbClasses;
- }
-
- public Iterable<URL> discoverWebBeansXml()
- {
- return wbUrls;
- }
-
- private void findWebBeansAnnotatedClasses() throws WebBeanDiscoveryException
- {
- for (ClassDescriptor classDesc : simpleWebBeansDeploymentHandler.getClasses())
- {
- final Class<?> clazz = classDesc.getClazz();
- wbClasses.add(clazz);
- }
- }
-
- private void findWebBeansXmlUrls()
- {
- for (FileDescriptor fileDesc : webBeansXmlDeploymentHandler.getResources())
- {
- wbUrls.add(fileDesc.getUrl());
- }
- }
-}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15 18:47:48 UTC (rev 2010)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -22,7 +22,7 @@
*
* @author Peter Royle
*/
-public class NoNamingContext implements NamingContext
+public abstract class NoNamingContext implements NamingContext
{
public NoNamingContext()
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 18:47:48 UTC (rev 2010)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 19:25:33 UTC (rev 2011)
@@ -46,4 +46,16 @@
}
}
+ public static ClassLoader getClassLoader()
+ {
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ else
+ {
+ return Reflections.class.getClassLoader();
+ }
+ }
+
}
Added: extensions/trunk/se/test-output/emailable-report.html
===================================================================
--- extensions/trunk/se/test-output/emailable-report.html (rev 0)
+++ extensions/trunk/se/test-output/emailable-report.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>TestNG: Unit Test</title>
+<style type="text/css">
+table caption,table.info_table,table.param,table.passed,table.failed {margin-bottom:10px;border:1px solid #000099;border-collapse:collapse;empty-cells:show;}
+table.info_table td,table.info_table th,table.param td,table.param th,table.passed td,table.passed th,table.failed td,table.failed th {
+border:1px solid #000099;padding:.25em .5em .25em .5em
+}
+table.param th {vertical-align:bottom}
+td.numi,th.numi,td.numi_attn {
+text-align:right
+}
+tr.total td {font-weight:bold}
+table caption {
+text-align:center;font-weight:bold;
+}
+table.passed tr.stripe td,table tr.passedodd td {background-color: #00AA00;}
+table.passed td,table tr.passedeven td {background-color: #33FF33;}
+table.passed tr.stripe td,table tr.skippedodd td {background-color: #cccccc;}
+table.passed td,table tr.skippedodd td {background-color: #dddddd;}
+table.failed tr.stripe td,table tr.failedodd td,table.param td.numi_attn {background-color: #FF3333;}
+table.failed td,table tr.failedeven td,table.param tr.stripe td.numi_attn {background-color: #DD0000;}
+tr.stripe td,tr.stripe th {background-color: #E6EBF9;}
+p.totop {font-size:85%;text-align:center;border-bottom:2px black solid}
+div.shootout {padding:2em;border:3px #4854A8 solid}
+</style>
+</head>
+<body>
+<table cellspacing=0 cellpadding=0 class="param">
+<tr><th>Test</th><th class="numi">Methods<br/>Passed</th><th class="numi">Scenarios<br/>Passed</th><th class="numi"># skipped</th><th class="numi"># failed</th><th class="numi">Total<br/>Time</th><th class="numi">Included<br/>Groups</th><th class="numi">Excluded<br/>Groups</th></tr>
+<tr><td style="text-align:left;padding-right:2em">org.jboss.webbeans.environment.se.test.StartMainTest</td><td class="numi">1</td><td class="numi">1</td><td class="numi">0</td><td class="numi">0</td><td class="numi">6.4 seconds</td><td class="numi"></td><td class="numi"></td></tr>
+</table>
+<a id="summary"></a>
+<table cellspacing=0 cellpadding=0 class="passed">
+<tr><th>Class</th><th>Method</th><th># of<br/>Scenarios</th><th>Time<br/>(Msecs)</th></tr>
+<tr><th colspan="4">org.jboss.webbeans.environment.se.test.StartMainTest — passed</th></tr>
+<tr class="passedodd"><td rowspan="1">org.jboss.webbeans.environment.se.test.StartMainTest<td><a href="#m1">testMain</a></td><td class="numi">1</td><td class="numi">6334</td></tr>
+</table>
+<h1>org.jboss.webbeans.environment.se.test.StartMainTest</h1>
+<a id="m1"></a><h2>org.jboss.webbeans.environment.se.test.StartMainTest:testMain</h2>
+<p class="totop"><a href="#summary">back to summary</a></p>
+</body></html>
Property changes on: extensions/trunk/se/test-output/emailable-report.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/index.html
===================================================================
--- extensions/trunk/se/test-output/index.html (rev 0)
+++ extensions/trunk/se/test-output/index.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,9 @@
+<html>
+<head><title>Test results</title><link href="./testng.css" rel="stylesheet" type="text/css" />
+<link href="./my-testng.css" rel="stylesheet" type="text/css" />
+</head><body>
+<h2><p align='center'>Test results</p></h2>
+<table border='1' width='100%' class='main-page'><tr><th>Suite</th><th>Passed</th><th>Failed</th><th>Skipped</th><th>testng.xml</th></tr>
+<tr align='center' class='invocation-passed'><td><em>Total</em></td><td><em>1</em></td><td><em>0</em></td><td><em>0</em></td><td> </td></tr>
+<tr align='center' class='invocation-passed'><td><a href='se-module/index.html'>se-module</a></td>
+<td>1</td><td>0</td><td>0</td><td><a href='se-module/testng.xml.html'>Link</a></td></tr></table></body></html>
Property changes on: extensions/trunk/se/test-output/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/classes.html
===================================================================
--- extensions/trunk/se/test-output/se-module/classes.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/classes.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,28 @@
+<table border='1'>
+<tr>
+<th>Class name</th>
+<th>Method name</th>
+<th>Groups</th>
+</tr><tr>
+<td>org.jboss.webbeans.environment.se.test.StartMainTest</td>
+<td> </td><td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@Test</td>
+</tr>
+<tr>
+<td> </td>
+<td>testMain</td>
+<td> </td></tr>
+<tr>
+<td align='center' colspan='3'>@BeforeClass</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@BeforeMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterMethod</td>
+</tr>
+<tr>
+<td align='center' colspan='3'>@AfterClass</td>
+</tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/classes.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/groups.html
===================================================================
--- extensions/trunk/se/test-output/se-module/groups.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/groups.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1 @@
+<h2>Groups used for this test run</h2>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/groups.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/index.html
===================================================================
--- extensions/trunk/se/test-output/se-module/index.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/index.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,6 @@
+<html><head><title>Results for se-module</title></head>
+<frameset cols="26%,74%">
+<frame src="toc.html" name="navFrame">
+<frame src="main.html" name="mainFrame">
+</frameset>
+</html>
Property changes on: extensions/trunk/se/test-output/se-module/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/main.html
===================================================================
--- extensions/trunk/se/test-output/se-module/main.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/main.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,2 @@
+<html><head><title>Results for se-module</title></head>
+<body>Select a result on the left-hand pane.</body></html>
Property changes on: extensions/trunk/se/test-output/se-module/main.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods-alphabetical.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods-alphabetical.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/methods-alphabetical.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,6 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means before, << means after</h3><p/><br/><em>se-module</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="c9f997"> <td>09/03/15 19:22:43</td> <td>0</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.environment.se.test.StartMainTest.testMain()">testMain</td>
+ <td>main@560069853</td> <td></td> </tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/methods-alphabetical.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods-not-run.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods-not-run.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/methods-not-run.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,2 @@
+<h2>Methods that were not run</h2><table>
+</table>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/methods-not-run.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/methods.html
===================================================================
--- extensions/trunk/se/test-output/se-module/methods.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/methods.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,6 @@
+<h2>Methods run, sorted chronologically</h2><h3>>> means before, << means after</h3><p/><br/><em>se-module</em><p/><small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table border="1">
+<tr><th>Time</th><th>Delta (ms)</th><th>Suite<br>configuration</th><th>Test<br>configuration</th><th>Class<br>configuration</th><th>Groups<br>configuration</th><th>Method<br>configuration</th><th>Test<br>method</th><th>Thread</th><th>Instances</th></tr>
+<tr bgcolor="c9f997"> <td>09/03/15 19:22:43</td> <td>0</td> <td> </td><td> </td><td> </td><td> </td><td> </td><td title="org.jboss.webbeans.environment.se.test.StartMainTest.testMain()">testMain</td>
+ <td>main@560069853</td> <td></td> </tr>
+</table>
Property changes on: extensions/trunk/se/test-output/se-module/methods.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
===================================================================
--- extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,83 @@
+<html>
+<head>
+<title>TestNG: org.jboss.webbeans.environment.se.test.StartMainTest</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+
+<style type="text/css">
+.log { display: none;}
+.stack-trace { display: none;}
+</style>
+<script type="text/javascript">
+<!--
+function flip(e) {
+ current = e.style.display;
+ if (current == 'block') {
+ e.style.display = 'none';
+ return 0;
+ }
+ else {
+ e.style.display = 'block';
+ return 1;
+ }
+}
+
+function toggleBox(szDivId, elem, msg1, msg2)
+{
+ var res = -1; if (document.getElementById) {
+ res = flip(document.getElementById(szDivId));
+ }
+ else if (document.all) {
+ // this is the way old msie versions work
+ res = flip(document.all[szDivId]);
+ }
+ if(elem) {
+ if(res == 0) elem.innerHTML = msg1; else elem.innerHTML = msg2;
+ }
+
+}
+
+function toggleAllBoxes() {
+ if (document.getElementsByTagName) {
+ d = document.getElementsByTagName('div');
+ for (i = 0; i < d.length; i++) {
+ if (d[i].className == 'log') {
+ flip(d[i]);
+ }
+ }
+ }
+}
+
+// -->
+</script>
+
+</head>
+<body>
+<h2 align='center'>org.jboss.webbeans.environment.se.test.StartMainTest</h2><table border='1' align="center">
+<tr>
+<td>Tests passed/Failed/Skipped:</td><td>1/0/0</td>
+</tr><tr>
+<td>Started on:</td><td>Sun Mar 15 19:22:43 GMT 2009</td>
+</tr>
+<tr><td>Total time:</td><td>6 seconds (6376 ms)</td>
+</tr><tr>
+<td>Included groups:</td><td></td>
+</tr><tr>
+<td>Excluded groups:</td><td></td>
+</tr>
+</table><p/>
+<small><i>(Hover the method name to see the test class name)</i></small><p/>
+<table width='100%' border='1' class='invocation-passed'>
+<tr><td colspan='3' align='center'><b>PASSED TESTS</b></td></tr>
+<tr><td><b>Test method</b></td>
+<td width="10%"><b>Time (seconds)</b></td>
+<td width="30%"><b>Exception</b></td>
+</tr>
+<tr>
+<td title='org.jboss.webbeans.environment.se.test.StartMainTest.testMain()'>testMain</td>
+<td>6</td>
+<td></td>
+</tr>
+</table><p>
+</body>
+</html>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
===================================================================
--- extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties (rev 0)
+++ extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1 @@
+[SuiteResult org.jboss.webbeans.environment.se.test.StartMainTest]
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
===================================================================
--- extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml (rev 0)
+++ extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuite name="org.jboss.webbeans.environment.se.test.StartMainTest" failures="0" tests="1" time="6.376" errors="0">
+ <properties/>
+ <testcase name="testMain" time="6.334" classname="org.jboss.webbeans.environment.se.test.StartMainTest"/>
+</testsuite>
Property changes on: extensions/trunk/se/test-output/se-module/org.jboss.webbeans.environment.se.test.StartMainTest.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/reporter-output.html
===================================================================
--- extensions/trunk/se/test-output/se-module/reporter-output.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/reporter-output.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1 @@
+<h2>Reporter output</h2><table></table>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/reporter-output.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/testng.xml.html
===================================================================
--- extensions/trunk/se/test-output/se-module/testng.xml.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/testng.xml.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1 @@
+<html><head><title>testng.xml for se-module</title></head><body><tt><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"><br/><suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" name="se-module" junit="false" annotations="JDK"><br/> <test verbose="2" name="org.jboss.webbeans.environment.se.test.StartMainTest" junit="false" annotations="JDK"><br/> <classes><br/> <class name="org.jboss.webbeans.environment.se.test.StartMainTest"><br/> <methods><br/> <include name="testMain"/><br/> </methods><br/> </class><br/> </classes><br/> </tes!
t><br/></suite><br/></tt></body></html>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/testng.xml.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/se-module/toc.html
===================================================================
--- extensions/trunk/se/test-output/se-module/toc.html (rev 0)
+++ extensions/trunk/se/test-output/se-module/toc.html 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,30 @@
+<html>
+<head>
+<title>Results for se-module</title>
+<link href="../testng.css" rel="stylesheet" type="text/css" />
+<link href="../my-testng.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<h3><p align="center">Results for<br/><em>se-module</em></p></h3>
+<table border='1' width='100%'>
+<tr valign='top'>
+<td>1 test</td>
+<td><a target='mainFrame' href='classes.html'>1 class</a></td>
+<td>1 method:<br/>
+ <a target='mainFrame' href='methods.html'>chronological</a><br/>
+ <a target='mainFrame' href='methods-alphabetical.html'>alphabetical</a><br/>
+ <a target='mainFrame' href='methods-not-run.html'>not run (0)</a></td>
+</tr>
+<tr>
+<td><a target='mainFrame' href='groups.html'>0 group</a></td>
+<td><a target='mainFrame' href='reporter-output.html'>reporter output</a></td>
+<td><a target='mainFrame' href='testng.xml.html'>testng.xml</a></td>
+</tr></table>
+<table width='100%' class='test-passed'>
+<tr><td>
+<table style='width: 100%'><tr><td valign='top'>org.jboss.webbeans.environment.se.test.StartMainTest (1/0/0)</td><td valign='top' align='right'>
+ <a href='org.jboss.webbeans.environment.se.test.StartMainTest.html' target='mainFrame'>Results</a>
+</td></tr></table>
+</td></tr><p/>
+</table>
+</body></html>
\ No newline at end of file
Property changes on: extensions/trunk/se/test-output/se-module/toc.html
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/testng-results.xml
===================================================================
--- extensions/trunk/se/test-output/testng-results.xml (rev 0)
+++ extensions/trunk/se/test-output/testng-results.xml 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,14 @@
+<testng-results>
+ <reporter-output>
+ </reporter-output>
+ <suite name="se-module">
+ <groups>
+ </groups>
+ <test name="org.jboss.webbeans.environment.se.test.StartMainTest">
+ <class name="org.jboss.webbeans.environment.se.test.StartMainTest">
+ <test-method status="PASS" signature="testMain()" name="testMain" duration-ms="6334" started-at="2009-03-15T19:22:43Z" finished-at="2009-03-15T19:22:49Z">
+ </test-method>
+ </class>
+ </test>
+ </suite>
+</testng-results>
Property changes on: extensions/trunk/se/test-output/testng-results.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: extensions/trunk/se/test-output/testng.css
===================================================================
--- extensions/trunk/se/test-output/testng.css (rev 0)
+++ extensions/trunk/se/test-output/testng.css 2009-03-15 19:25:33 UTC (rev 2011)
@@ -0,0 +1,9 @@
+.invocation-failed, .test-failed { background-color: #DD0000; }
+.invocation-percent, .test-percent { background-color: #006600; }
+.invocation-passed, .test-passed { background-color: #00AA00; }
+.invocation-skipped, .test-skipped { background-color: #CCCC00; }
+
+.main-page {
+ font-size: x-large;
+}
+
Property changes on: extensions/trunk/se/test-output/testng.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2010 - in extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se: beans and 6 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 14:47:48 -0400 (Sun, 15 Mar 2009)
New Revision: 2010
Modified:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractClassDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDescriptor.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/FileDescriptor.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/Scanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/SimpleWebBeansDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/WebBeansXmlDeploymentHandler.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
Log:
whitespace
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -35,81 +35,85 @@
import org.jboss.webbeans.resources.spi.NamingContext;
/**
- * This is the main class that should always be called from the command
- * line for a WebBEans SE app. Something like:
- * <code>
+ * This is the main class that should always be called from the command line for
+ * a WebBEans SE app. Something like: <code>
* java -jar MyApp.jar org.jboss.webbeans.environment.se.StarMain arguments
* </code>
+ *
* @author Peter Royle
* @author Pete Muir
*/
public class StartMain
{
-
- private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
- private final Bootstrap bootstrap;
- private final BeanStore applicationBeanStore;
- private String[] args;
- private boolean hasShutdownBeenCalled = false;
- Log log = Logging.getLog( StartMain.class );
-
- public StartMain( String[] commandLineArgs )
- {
- this.args = commandLineArgs;
- try
- {
- bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
- }
- this.applicationBeanStore = new ConcurrentHashMapBeanStore();
- }
-
- private void go()
- {
- bootstrap.setEnvironment(Environments.SE);
- bootstrap.getServices().add(WebBeanDiscovery.class, new WebBeanDiscoveryImpl());
- bootstrap.getServices().add(NamingContext.class, new NoNamingContext());
- bootstrap.setApplicationContext(applicationBeanStore);
- bootstrap.initialize();
- bootstrap.boot();
- bootstrap.getManager().getInstanceByType(ParametersFactory.class).setArgs(args);
- DependentContext.INSTANCE.setActive(true);
- }
-
- /**
- * The main method called from the command line. This little puppy
- * will get the ball rolling.
- * @param args the command line arguments
- */
- public static void main( String[] args )
- {
- new StartMain( args ).go();
- }
-
- /**
- * The observer of the optional shutdown request which will in turn fire the
- * Shutdown event.
- * @param shutdownRequest
- */
- public void shutdown( @Observes @Shutdown Manager shutdownRequest )
- {
- synchronized (this)
- {
-
- if (!hasShutdownBeenCalled)
- {
- hasShutdownBeenCalled = true;
- bootstrap.shutdown();
- } else
- {
- log.debug( "Skipping spurious call to shutdown");
- log.trace( Thread.currentThread().getStackTrace() );
- }
- }
- }
-
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+
+ private final Bootstrap bootstrap;
+ private final BeanStore applicationBeanStore;
+ private String[] args;
+ private boolean hasShutdownBeenCalled = false;
+ Log log = Logging.getLog(StartMain.class);
+
+ public StartMain(String[] commandLineArgs)
+ {
+ this.args = commandLineArgs;
+ try
+ {
+ bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ }
+ this.applicationBeanStore = new ConcurrentHashMapBeanStore();
+ }
+
+ private void go()
+ {
+ bootstrap.setEnvironment(Environments.SE);
+ bootstrap.getServices().add(WebBeanDiscovery.class, new WebBeanDiscoveryImpl());
+ bootstrap.getServices().add(NamingContext.class, new NoNamingContext());
+ bootstrap.setApplicationContext(applicationBeanStore);
+ bootstrap.initialize();
+ bootstrap.boot();
+ bootstrap.getManager().getInstanceByType(ParametersFactory.class).setArgs(args);
+ DependentContext.INSTANCE.setActive(true);
+ }
+
+ /**
+ * The main method called from the command line. This little puppy will get
+ * the ball rolling.
+ *
+ * @param args
+ * the command line arguments
+ */
+ public static void main(String[] args)
+ {
+ new StartMain(args).go();
+ }
+
+ /**
+ * The observer of the optional shutdown request which will in turn fire the
+ * Shutdown event.
+ *
+ * @param shutdownRequest
+ */
+ public void shutdown(@Observes @Shutdown Manager shutdownRequest)
+ {
+ synchronized (this)
+ {
+
+ if (!hasShutdownBeenCalled)
+ {
+ hasShutdownBeenCalled = true;
+ bootstrap.shutdown();
+ }
+ else
+ {
+ log.debug("Skipping spurious call to shutdown");
+ log.trace(Thread.currentThread().getStackTrace());
+ }
+ }
+ }
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -27,35 +27,38 @@
import org.jboss.webbeans.environment.se.bindings.Parameters;
/**
- * The simple bean that will hold the command line arguments
- * and make them available by injection (using the @Parameters binding).
- * It's initialised by the StartMain class before your main app is
- * initialised.
+ * The simple bean that will hold the command line arguments and make them
+ * available by injection (using the @Parameters binding). It's initialised by
+ * the StartMain class before your main app is initialised.
+ *
* @author Peter Royle
*/
@ApplicationScoped
public class ParametersFactory
{
- private String[] args;
-
- /**
- * Producer method for the injectible command line args.
- * @return The command line arguments.
- */
- @Produces
- @Parameters
- // TODO Give generic type - WBRI-186
- public List getArgs( )
- {
- return Collections.unmodifiableList(new ArrayList<String>( Arrays.asList( this.args ) ));
- }
-
- /**
- * StartMain passes in the command line args here.
- * @param args The command line arguments.
- */
- public void setArgs( String[] args )
- {
- this.args = args;
- }
+ private String[] args;
+
+ /**
+ * Producer method for the injectible command line args.
+ *
+ * @return The command line arguments.
+ */
+ @Produces
+ @Parameters
+ // TODO Give generic type - WBRI-186
+ public List getArgs()
+ {
+ return Collections.unmodifiableList(new ArrayList<String>(Arrays.asList(this.args)));
+ }
+
+ /**
+ * StartMain passes in the command line args here.
+ *
+ * @param args
+ * The command line arguments.
+ */
+ public void setArgs(String[] args)
+ {
+ this.args = args;
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/Parameters.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -24,15 +24,10 @@
import javax.inject.BindingType;
/**
- *
+ *
* @author Peter Royle
*/
@BindingType
-@Retention( RetentionPolicy.RUNTIME )
-@Target( {ElementType.PARAMETER,
- ElementType.METHOD,
- ElementType.FIELD
-} )
-public @interface Parameters
-{
-}
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
+public @interface Parameters {}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractClassDeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractClassDeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractClassDeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -19,24 +19,22 @@
import java.util.HashSet;
import java.util.Set;
-public abstract class AbstractClassDeploymentHandler
- extends AbstractDeploymentHandler
- implements ClassDeploymentHandler
+public abstract class AbstractClassDeploymentHandler extends AbstractDeploymentHandler implements ClassDeploymentHandler
{
- private Set<ClassDescriptor> classes;
-
- public AbstractClassDeploymentHandler( )
- {
- classes = new HashSet<ClassDescriptor>( );
- }
-
- public Set<ClassDescriptor> getClasses( )
- {
- return classes;
- }
-
- public void setClasses( Set<ClassDescriptor> classes )
- {
- this.classes = classes;
- }
+ private Set<ClassDescriptor> classes;
+
+ public AbstractClassDeploymentHandler()
+ {
+ classes = new HashSet<ClassDescriptor>();
+ }
+
+ public Set<ClassDescriptor> getClasses()
+ {
+ return classes;
+ }
+
+ public void setClasses(Set<ClassDescriptor> classes)
+ {
+ this.classes = classes;
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractDeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -20,29 +20,29 @@
import java.util.Set;
/**
- * Abstract base class for {@link DeploymentHandler} providing common functionality
- *
+ * Abstract base class for {@link DeploymentHandler} providing common
+ * functionality
+ *
* @author Pete Muir
- *
+ *
*/
-public abstract class AbstractDeploymentHandler
- implements DeploymentHandler
+public abstract class AbstractDeploymentHandler implements DeploymentHandler
{
- private Set<FileDescriptor> resources;
-
- public AbstractDeploymentHandler( )
- {
- resources = new HashSet<FileDescriptor>( );
- }
-
- public void setResources( Set<FileDescriptor> resources )
- {
- this.resources = resources;
- }
-
- public Set<FileDescriptor> getResources( )
- {
- return resources;
- }
-
+ private Set<FileDescriptor> resources;
+
+ public AbstractDeploymentHandler()
+ {
+ resources = new HashSet<FileDescriptor>();
+ }
+
+ public void setResources(Set<FileDescriptor> resources)
+ {
+ this.resources = resources;
+ }
+
+ public Set<FileDescriptor> getResources()
+ {
+ return resources;
+ }
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractScanner.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/AbstractScanner.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -30,144 +30,140 @@
/**
* Abstract base class for {@link Scanner} providing common functionality
- *
+ *
* This class provides file-system orientated scanning
- *
+ *
* @author Pete Muir
- *
+ *
*/
-public abstract class AbstractScanner
- implements Scanner
+public abstract class AbstractScanner implements Scanner
{
- private static class Handler
- {
- public static final String BEANS_XML = "beans.xml";
- private ClassDescriptor classDescriptor;
- private Set<FileDescriptor> fileDescriptors;
- private Set<DeploymentHandler> deploymentHandlers;
- private ClassLoader classLoader;
- private String name;
-
- public Handler( String name, Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader )
- {
- this.deploymentHandlers = deploymentHandlers;
- this.name = name;
- this.classLoader = classLoader;
- }
-
- /**
- * Return true if the file was handled (false if it was ignored)
- */
- protected boolean handle( DeploymentHandler deploymentHandler )
- {
- boolean handled = false;
-
- if ( deploymentHandler instanceof ClassDeploymentHandler )
+ private static class Handler
+ {
+ public static final String BEANS_XML = "beans.xml";
+ private ClassDescriptor classDescriptor;
+ private Set<FileDescriptor> fileDescriptors;
+ private Set<DeploymentHandler> deploymentHandlers;
+ private ClassLoader classLoader;
+ private String name;
+
+ public Handler(String name, Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader)
+ {
+ this.deploymentHandlers = deploymentHandlers;
+ this.name = name;
+ this.classLoader = classLoader;
+ }
+
+ /**
+ * Return true if the file was handled (false if it was ignored)
+ */
+ protected boolean handle(DeploymentHandler deploymentHandler)
+ {
+ boolean handled = false;
+
+ if (deploymentHandler instanceof ClassDeploymentHandler)
+ {
+ if (name.endsWith(".class"))
{
- if ( name.endsWith( ".class" ) )
- {
- ClassDeploymentHandler classDeploymentHandler = (ClassDeploymentHandler) deploymentHandler;
-
- if ( getClassDescriptor( ).getClazz( ) != null )
- {
- log.trace( "adding class to deployable list " + name + " for deployment handler " +
- deploymentHandler.toString() );
- classDeploymentHandler.getClasses( ).add( getClassDescriptor( ) );
- handled = true;
- } else
- {
- log.info( "skipping class " + name +
- " because it cannot be loaded (may reference a type which is not available on the classpath)" );
- }
- }
- } else
+ ClassDeploymentHandler classDeploymentHandler = (ClassDeploymentHandler) deploymentHandler;
+
+ if (getClassDescriptor().getClazz() != null)
+ {
+ log.trace("adding class to deployable list " + name + " for deployment handler " + deploymentHandler.toString());
+ classDeploymentHandler.getClasses().add(getClassDescriptor());
+ handled = true;
+ }
+ else
+ {
+ log.info("skipping class " + name + " because it cannot be loaded (may reference a type which is not available on the classpath)");
+ }
+ }
+ }
+ else
+ {
+ if (name.equals(BEANS_XML))
{
- if ( name.equals (BEANS_XML) )
- {
- deploymentHandler.getResources( ).addAll( getAllFileDescriptors( ) );
- handled = true;
- }
+ deploymentHandler.getResources().addAll(getAllFileDescriptors());
+ handled = true;
}
-
- return handled;
- }
-
- protected boolean handle( )
- {
- log.trace( "found " + name );
-
- boolean handled = false;
-
- for ( DeploymentHandler entry : deploymentHandlers )
+ }
+
+ return handled;
+ }
+
+ protected boolean handle()
+ {
+ log.trace("found " + name);
+
+ boolean handled = false;
+
+ for (DeploymentHandler entry : deploymentHandlers)
+ {
+ if (handle(entry))
{
- if ( handle( entry ) )
- {
- handled = true;
- }
+ handled = true;
}
-
- return handled;
- }
-
- private ClassDescriptor getClassDescriptor( )
- {
- if ( classDescriptor == null )
+ }
+
+ return handled;
+ }
+
+ private ClassDescriptor getClassDescriptor()
+ {
+ if (classDescriptor == null)
+ {
+ classDescriptor = new ClassDescriptor(name, classLoader);
+ }
+
+ return classDescriptor;
+ }
+
+ private Set<FileDescriptor> getAllFileDescriptors()
+ {
+ if (fileDescriptors == null)
+ {
+ try
{
- classDescriptor = new ClassDescriptor( name, classLoader );
+ Enumeration<URL> allUrls = classLoader.getResources(name);
+ Set<FileDescriptor> fileDescSet = new HashSet<FileDescriptor>();
+
+ while (allUrls.hasMoreElements())
+ {
+ fileDescSet.add(new FileDescriptor(name, allUrls.nextElement()));
+ }
+
+ this.fileDescriptors = fileDescSet;
}
-
- return classDescriptor;
- }
-
- private Set<FileDescriptor> getAllFileDescriptors( )
- {
- if ( fileDescriptors == null )
+ catch (IOException ex)
{
- try
- {
- Enumeration<URL> allUrls = classLoader.getResources( name );
- Set<FileDescriptor> fileDescSet = new HashSet<FileDescriptor>( );
-
- while ( allUrls.hasMoreElements( ) )
- {
- fileDescSet.add( new FileDescriptor(
- name,
- allUrls.nextElement( ) ) );
- }
-
- this.fileDescriptors = fileDescSet;
- } catch ( IOException ex )
- {
- throw new WebBeanDiscoveryException( "Error loading all classpath urls for file " + name, ex );
- }
+ throw new WebBeanDiscoveryException("Error loading all classpath urls for file " + name, ex);
}
-
- return fileDescriptors;
- }
- }
-
- private static final LogProvider log = Logging.getLogProvider( Scanner.class );
- private Set<DeploymentHandler> deploymentHandlers;
- private ClassLoader classLoader;
-
-
- public AbstractScanner( Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader )
- {
- this.deploymentHandlers = deploymentHandlers;
- this.classLoader = classLoader;
- ClassFile.class.getPackage( ); //to force loading of javassist, throwing an exception if it is missing
- }
-
- protected boolean handle( String name )
- {
- return new Handler( name,
- deploymentHandlers,
- classLoader ).handle( );
- }
-
- public ClassLoader getClassLoader()
- {
- return classLoader;
- }
-
+ }
+
+ return fileDescriptors;
+ }
+ }
+
+ private static final LogProvider log = Logging.getLogProvider(Scanner.class);
+ private Set<DeploymentHandler> deploymentHandlers;
+ private ClassLoader classLoader;
+
+ public AbstractScanner(Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader)
+ {
+ this.deploymentHandlers = deploymentHandlers;
+ this.classLoader = classLoader;
+ ClassFile.class.getPackage(); // to force loading of javassist, throwing
+ // an exception if it is missing
+ }
+
+ protected boolean handle(String name)
+ {
+ return new Handler(name, deploymentHandlers, classLoader).handle();
+ }
+
+ public ClassLoader getClassLoader()
+ {
+ return classLoader;
+ }
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -18,10 +18,9 @@
import java.util.Set;
-public interface ClassDeploymentHandler
- extends DeploymentHandler
+public interface ClassDeploymentHandler extends DeploymentHandler
{
- public Set<ClassDescriptor> getClasses( );
-
- public void setClasses( Set<ClassDescriptor> classes );
+ public Set<ClassDescriptor> getClasses();
+
+ public void setClasses(Set<ClassDescriptor> classes);
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDescriptor.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDescriptor.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/ClassDescriptor.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -21,81 +21,85 @@
import java.net.URL;
-public class ClassDescriptor
- extends FileDescriptor
+public class ClassDescriptor extends FileDescriptor
{
- private static LogProvider log = Logging.getLogProvider( ClassDescriptor.class );
- private Class<?> clazz;
-
- public ClassDescriptor( String name, URL url, Class<?> clazz )
- {
- super( name, url );
- this.clazz = clazz;
- }
-
- public ClassDescriptor( String name, ClassLoader classLoader )
- {
- super( name, classLoader );
-
- String classname = filenameToClassname( name );
- log.trace( "Trying to load class " + classname );
-
- try
- {
- clazz = classLoader.loadClass( classname );
- // IBM JVM will throw a TypeNotPresentException if any annotation on the class is not on
- // the classpath, rendering the class virtually unusable (given Seam's heavy use of annotations)
- clazz.getAnnotations( );
- } catch ( ClassNotFoundException cnfe )
- {
- log.info( "could not load class: " + classname, cnfe );
- } catch ( NoClassDefFoundError ncdfe )
- {
- log.debug( "could not load class (missing dependency): " + classname, ncdfe );
- } catch ( TypeNotPresentException tnpe )
- {
- clazz = null;
- log.debug( "could not load class (annotation missing dependency): " + classname, tnpe );
- }
- }
-
- public Class<?> getClazz( )
- {
- return clazz;
- }
-
- @Override
- public String toString( )
- {
- return clazz.getName( );
- }
-
- /**
- * Convert a path to a class file to a class name
- */
- public static String filenameToClassname( String filename )
- {
- return filename.substring( 0,
- filename.lastIndexOf( ".class" ) ).replace( '/', '.' ).replace( '\\', '.' );
- }
-
- @Override
- public boolean equals( Object other )
- {
- if ( other instanceof ClassDescriptor )
- {
- ClassDescriptor that = (ClassDescriptor) other;
-
- return this.getClazz( ).equals( that.getClazz( ) );
- } else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode( )
- {
- return getClazz( ).hashCode( );
- }
+ private static LogProvider log = Logging.getLogProvider(ClassDescriptor.class);
+ private Class<?> clazz;
+
+ public ClassDescriptor(String name, URL url, Class<?> clazz)
+ {
+ super(name, url);
+ this.clazz = clazz;
+ }
+
+ public ClassDescriptor(String name, ClassLoader classLoader)
+ {
+ super(name, classLoader);
+
+ String classname = filenameToClassname(name);
+ log.trace("Trying to load class " + classname);
+
+ try
+ {
+ clazz = classLoader.loadClass(classname);
+ // IBM JVM will throw a TypeNotPresentException if any annotation on
+ // the class is not on
+ // the classpath, rendering the class virtually unusable (given Seam's
+ // heavy use of annotations)
+ clazz.getAnnotations();
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ log.info("could not load class: " + classname, cnfe);
+ }
+ catch (NoClassDefFoundError ncdfe)
+ {
+ log.debug("could not load class (missing dependency): " + classname, ncdfe);
+ }
+ catch (TypeNotPresentException tnpe)
+ {
+ clazz = null;
+ log.debug("could not load class (annotation missing dependency): " + classname, tnpe);
+ }
+ }
+
+ public Class<?> getClazz()
+ {
+ return clazz;
+ }
+
+ @Override
+ public String toString()
+ {
+ return clazz.getName();
+ }
+
+ /**
+ * Convert a path to a class file to a class name
+ */
+ public static String filenameToClassname(String filename)
+ {
+ return filename.substring(0, filename.lastIndexOf(".class")).replace('/', '.').replace('\\', '.');
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof ClassDescriptor)
+ {
+ ClassDescriptor that = (ClassDescriptor) other;
+
+ return this.getClazz().equals(that.getClazz());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getClazz().hashCode();
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/DeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -20,17 +20,17 @@
/**
* A deployment handler is responsible for processing found resources
- *
- * All deployment handlers should specify a unique name under which they
- * will be registered with the {@link DeploymentStrategy}
- *
+ *
+ * All deployment handlers should specify a unique name under which they will be
+ * registered with the {@link DeploymentStrategy}
+ *
* @author Pete Muir
- *
+ *
*/
public interface DeploymentHandler
{
-
- public Set<FileDescriptor> getResources( );
-
- public void setResources( Set<FileDescriptor> resources );
+
+ public Set<FileDescriptor> getResources();
+
+ public void setResources(Set<FileDescriptor> resources);
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/FileDescriptor.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/FileDescriptor.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/FileDescriptor.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -20,66 +20,66 @@
public class FileDescriptor
{
- private String name;
- private URL url;
-
- public FileDescriptor( String name, URL url )
- {
- this.name = name;
- this.url = url;
- }
-
- public FileDescriptor( String name, ClassLoader classLoader )
- {
- this.name = name;
-
- if ( name == null )
- {
- throw new NullPointerException( "Name cannot be null, loading from " + classLoader );
- }
-
- this.url = classLoader.getResource( name );
-
- if ( this.url == null )
- {
- throw new NullPointerException( "Cannot find URL from classLoader for " + name + ", loading from " +
- classLoader );
- }
- }
-
- public String getName( )
- {
- return name;
- }
-
- public URL getUrl( )
- {
- return url;
- }
-
- @Override
- public String toString( )
- {
- return url.getPath( );
- }
-
- @Override
- public boolean equals( Object other )
- {
- if ( other instanceof FileDescriptor )
- {
- FileDescriptor that = (FileDescriptor) other;
-
- return this.getUrl( ).equals( that.getUrl( ) );
- } else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode( )
- {
- return getUrl( ).hashCode( );
- }
+ private String name;
+ private URL url;
+
+ public FileDescriptor(String name, URL url)
+ {
+ this.name = name;
+ this.url = url;
+ }
+
+ public FileDescriptor(String name, ClassLoader classLoader)
+ {
+ this.name = name;
+
+ if (name == null)
+ {
+ throw new NullPointerException("Name cannot be null, loading from " + classLoader);
+ }
+
+ this.url = classLoader.getResource(name);
+
+ if (this.url == null)
+ {
+ throw new NullPointerException("Cannot find URL from classLoader for " + name + ", loading from " + classLoader);
+ }
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public URL getUrl()
+ {
+ return url;
+ }
+
+ @Override
+ public String toString()
+ {
+ return url.getPath();
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof FileDescriptor)
+ {
+ FileDescriptor that = (FileDescriptor) other;
+
+ return this.getUrl().equals(that.getUrl());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getUrl().hashCode();
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/Scanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/Scanner.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/Scanner.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -20,26 +20,28 @@
/**
* The Scanner is used to find resources to be processed by Seam
- *
+ *
* The processing is done by {@link DeploymentHandler}s
- *
+ *
* @author Pete Muir
- *
+ *
*/
public interface Scanner
{
- /**
- * Recursively scan directories.
- *
- * @param directories An array of the roots of the directory trees to scan
- */
- public void scanDirectories( File[] directories );
-
- /**
- * Scan for structures which contain any of the given resources in their root
- *
- * @param resources The resources to scan for
- */
- public void scanResources( String[] resources );
-
+ /**
+ * Recursively scan directories.
+ *
+ * @param directories
+ * An array of the roots of the directory trees to scan
+ */
+ public void scanDirectories(File[] directories);
+
+ /**
+ * Scan for structures which contain any of the given resources in their root
+ *
+ * @param resources
+ * The resources to scan for
+ */
+ public void scanResources(String[] resources);
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/SimpleWebBeansDeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/SimpleWebBeansDeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/SimpleWebBeansDeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -19,12 +19,11 @@
/**
* The {@link SimpleWebBeansDeploymentHandler} processes all classes found in a
* Web Beans archive/folder.
- *
+ *
* @author Pete Muir
* @author Peter Royle
- *
+ *
*/
-public class SimpleWebBeansDeploymentHandler
- extends AbstractClassDeploymentHandler
+public class SimpleWebBeansDeploymentHandler extends AbstractClassDeploymentHandler
{
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -33,160 +33,159 @@
/**
* Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
- *
+ *
* @author Thomas Heute
* @author Gavin King
* @author Norman Richards
* @author Pete Muir
- *
+ *
*/
-public class URLScanner
- extends AbstractScanner
+public class URLScanner extends AbstractScanner
{
- private static final LogProvider log = Logging.getLogProvider( URLScanner.class );
-
- public URLScanner( Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader )
- {
- super( deploymentHandlers, classLoader );
- }
-
- public void scanDirectories( File[] directories )
- {
- for ( File directory : directories )
- {
- handleDirectory( directory, null );
- }
- }
-
- public void scanResources( String[] resources )
- {
- Set<String> paths = new HashSet<String>( );
-
- for ( String resourceName : resources )
- {
- try
+ private static final LogProvider log = Logging.getLogProvider(URLScanner.class);
+
+ public URLScanner(Set<DeploymentHandler> deploymentHandlers, ClassLoader classLoader)
+ {
+ super(deploymentHandlers, classLoader);
+ }
+
+ public void scanDirectories(File[] directories)
+ {
+ for (File directory : directories)
+ {
+ handleDirectory(directory, null);
+ }
+ }
+
+ public void scanResources(String[] resources)
+ {
+ Set<String> paths = new HashSet<String>();
+
+ for (String resourceName : resources)
+ {
+ try
+ {
+ Enumeration<URL> urlEnum = getClassLoader().getResources(resourceName);
+
+ while (urlEnum.hasMoreElements())
{
- Enumeration<URL> urlEnum = getClassLoader( ).getResources( resourceName );
-
- while ( urlEnum.hasMoreElements( ) )
- {
- String urlPath = urlEnum.nextElement( ).getFile( );
- urlPath = URLDecoder.decode( urlPath, "UTF-8" );
-
- if ( urlPath.startsWith( "file:" ) )
- {
- urlPath = urlPath.substring( 5 );
- }
-
- if ( urlPath.indexOf( '!' ) > 0 )
- {
- urlPath =
- urlPath.substring( 0,
- urlPath.indexOf( '!' ) );
- } else
- {
- File dirOrArchive = new File( urlPath );
-
- if ( ( resourceName != null ) && ( resourceName.lastIndexOf( '/' ) > 0 ) )
- {
- //for META-INF/components.xml
- dirOrArchive = dirOrArchive.getParentFile( );
- }
-
- urlPath = dirOrArchive.getParent( );
- }
-
- paths.add( urlPath );
- }
- } catch ( IOException ioe )
- {
- log.warn( "could not read: " + resourceName, ioe );
+ String urlPath = urlEnum.nextElement().getFile();
+ urlPath = URLDecoder.decode(urlPath, "UTF-8");
+
+ if (urlPath.startsWith("file:"))
+ {
+ urlPath = urlPath.substring(5);
+ }
+
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+ else
+ {
+ File dirOrArchive = new File(urlPath);
+
+ if ((resourceName != null) && (resourceName.lastIndexOf('/') > 0))
+ {
+ // for META-INF/components.xml
+ dirOrArchive = dirOrArchive.getParentFile();
+ }
+
+ urlPath = dirOrArchive.getParent();
+ }
+
+ paths.add(urlPath);
}
- }
-
- handle( paths );
- }
-
- protected void handle( Set<String> paths )
- {
- for ( String urlPath : paths )
- {
- try
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read: " + resourceName, ioe);
+ }
+ }
+
+ handle(paths);
+ }
+
+ protected void handle(Set<String> paths)
+ {
+ for (String urlPath : paths)
+ {
+ try
+ {
+ log.trace("scanning: " + urlPath);
+
+ File file = new File(urlPath);
+
+ if (file.isDirectory())
{
- log.trace( "scanning: " + urlPath );
-
- File file = new File( urlPath );
-
- if ( file.isDirectory( ) )
- {
- handleDirectory( file, null );
- } else
- {
- handleArchiveByFile( file );
- }
- } catch ( IOException ioe )
- {
- log.warn( "could not read entries", ioe );
+ handleDirectory(file, null);
}
- }
- }
-
- private void handleArchiveByFile( File file )
- throws IOException
- {
- try
- {
- log.trace( "archive: " + file );
-
- ZipFile zip = new ZipFile( file );
- Enumeration<?extends ZipEntry> entries = zip.entries( );
-
- while ( entries.hasMoreElements( ) )
+ else
{
- ZipEntry entry = entries.nextElement( );
- String name = entry.getName( );
- handle( name );
+ handleArchiveByFile(file);
}
- } catch ( ZipException e )
- {
- throw new RuntimeException( "Error handling file " + file, e );
- }
- }
-
- private void handleDirectory( File file, String path )
- {
- handleDirectory( file,
- path,
- new File[0] );
- }
-
- private void handleDirectory( File file, String path, File[] excludedDirectories )
- {
- for ( File excludedDirectory : excludedDirectories )
- {
- if ( file.equals( excludedDirectory ) )
- {
- log.trace( "skipping excluded directory: " + file );
-
- return;
- }
- }
-
- log.trace( "handling directory: " + file );
-
- for ( File child : file.listFiles( ) )
- {
- String newPath = ( path == null ) ? child.getName( ) : ( path + '/' + child.getName( ) );
-
- if ( child.isDirectory( ) )
- {
- handleDirectory( child, newPath, excludedDirectories );
- } else
- {
- handle( newPath );
- }
- }
- }
-
-
+ }
+ catch (IOException ioe)
+ {
+ log.warn("could not read entries", ioe);
+ }
+ }
+ }
+
+ private void handleArchiveByFile(File file) throws IOException
+ {
+ try
+ {
+ log.trace("archive: " + file);
+
+ ZipFile zip = new ZipFile(file);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ handle(name);
+ }
+ }
+ catch (ZipException e)
+ {
+ throw new RuntimeException("Error handling file " + file, e);
+ }
+ }
+
+ private void handleDirectory(File file, String path)
+ {
+ handleDirectory(file, path, new File[0]);
+ }
+
+ private void handleDirectory(File file, String path, File[] excludedDirectories)
+ {
+ for (File excludedDirectory : excludedDirectories)
+ {
+ if (file.equals(excludedDirectory))
+ {
+ log.trace("skipping excluded directory: " + file);
+
+ return;
+ }
+ }
+
+ log.trace("handling directory: " + file);
+
+ for (File child : file.listFiles())
+ {
+ String newPath = (path == null) ? child.getName() : (path + '/' + child.getName());
+
+ if (child.isDirectory())
+ {
+ handleDirectory(child, newPath, excludedDirectories);
+ }
+ else
+ {
+ handle(newPath);
+ }
+ }
+ }
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/WebBeansXmlDeploymentHandler.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/WebBeansXmlDeploymentHandler.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/WebBeansXmlDeploymentHandler.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -16,15 +16,13 @@
*/
package org.jboss.webbeans.environment.se.deployment;
-
/**
* The {@link WebBeansXmlDeploymentHandler} beans.xml files
- *
+ *
* @author Pete Muir
- *
+ *
*/
-public class WebBeansXmlDeploymentHandler
- extends AbstractDeploymentHandler
+public class WebBeansXmlDeploymentHandler extends AbstractDeploymentHandler
{
-
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryException.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -16,27 +16,26 @@
*/
package org.jboss.webbeans.environment.se.discovery;
-
/**
* Thrown if there's an error during Web Bean discoery that will stop the
* manager from starting up.
+ *
* @author Peter Royle
*/
-public class WebBeanDiscoveryException
- extends RuntimeException
+public class WebBeanDiscoveryException extends RuntimeException
{
- public WebBeanDiscoveryException( Throwable cause )
- {
- super( cause );
- }
-
- public WebBeanDiscoveryException( String message, Throwable cause )
- {
- super( message, cause );
- }
-
- public WebBeanDiscoveryException( String message )
- {
- super( message );
- }
+ public WebBeanDiscoveryException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public WebBeanDiscoveryException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public WebBeanDiscoveryException(String message)
+ {
+ super(message);
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/discovery/WebBeanDiscoveryImpl.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -17,17 +17,16 @@
package org.jboss.webbeans.environment.se.discovery;
import java.io.File;
-import org.apache.log4j.Logger;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+import org.apache.log4j.Logger;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.environment.se.deployment.ClassDescriptor;
-import org.jboss.webbeans.environment.se.deployment.FileDescriptor;
-
-import java.net.URL;
-import java.util.HashSet;
-import java.util.Set;
import org.jboss.webbeans.environment.se.deployment.DeploymentHandler;
+import org.jboss.webbeans.environment.se.deployment.FileDescriptor;
import org.jboss.webbeans.environment.se.deployment.SimpleWebBeansDeploymentHandler;
import org.jboss.webbeans.environment.se.deployment.URLScanner;
import org.jboss.webbeans.environment.se.deployment.WebBeansXmlDeploymentHandler;
@@ -35,68 +34,68 @@
/**
* The means by which Web Beans are discovered on the classpath. This will only
* discover simple web beans - there is no EJB/Servlet/JPA integration.
- * @author Peter Royle.
- * Adapted from org.jboss.webbeans.integration.jbossas.WebBeansDiscoveryImpl (author unknown)
+ *
+ * @author Peter Royle. Adapted from
+ * org.jboss.webbeans.integration.jbossas.WebBeansDiscoveryImpl (author
+ * unknown)
*/
-public class WebBeanDiscoveryImpl
- implements WebBeanDiscovery
+public class WebBeanDiscoveryImpl implements WebBeanDiscovery
{
- private Set<Class<?>> wbClasses = new HashSet<Class<?>>( );
- private Set<URL> wbUrls = new HashSet<URL>( );
-// private StandardDeploymentStrategy deploymentStrategy;
- private SimpleWebBeansDeploymentHandler simpleWebBeansDeploymentHandler = new SimpleWebBeansDeploymentHandler();
- private WebBeansXmlDeploymentHandler webBeansXmlDeploymentHandler = new WebBeansXmlDeploymentHandler();
- URLScanner urlScanner;
-
-
- // The log provider
- private static Logger log = Logger.getLogger( WebBeanDiscoveryImpl.class.getName( ) );
-
- public WebBeanDiscoveryImpl( )
- {
- final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- Set<DeploymentHandler> deploymentHandlers = new HashSet<DeploymentHandler>();
- deploymentHandlers.add( simpleWebBeansDeploymentHandler );
- deploymentHandlers.add( webBeansXmlDeploymentHandler );
-
- urlScanner = new URLScanner( deploymentHandlers, contextClassLoader );
- urlScanner.scanResources( new String[] { "beans.xml"} );
- urlScanner.scanDirectories( new File[]{} );
-
- findWebBeansXmlUrls( );
- findWebBeansAnnotatedClasses( );
- }
-
- public Iterable<EjbDescriptor<?>> discoverEjbs( )
- {
- return new HashSet<EjbDescriptor<?>>( );
- }
-
- public Iterable<Class<?>> discoverWebBeanClasses( )
- {
- return wbClasses;
- }
-
- public Iterable<URL> discoverWebBeansXml( )
- {
- return wbUrls;
- }
-
- private void findWebBeansAnnotatedClasses( )
- throws WebBeanDiscoveryException
- {
- for ( ClassDescriptor classDesc : simpleWebBeansDeploymentHandler.getClasses() )
- {
- final Class<?> clazz = classDesc.getClazz( );
- wbClasses.add( clazz );
- }
- }
-
- private void findWebBeansXmlUrls( )
- {
- for ( FileDescriptor fileDesc : webBeansXmlDeploymentHandler.getResources() )
- {
- wbUrls.add( fileDesc.getUrl( ) );
- }
- }
+
+ private Set<Class<?>> wbClasses = new HashSet<Class<?>>();
+ private Set<URL> wbUrls = new HashSet<URL>();
+ // private StandardDeploymentStrategy deploymentStrategy;
+ private SimpleWebBeansDeploymentHandler simpleWebBeansDeploymentHandler = new SimpleWebBeansDeploymentHandler();
+ private WebBeansXmlDeploymentHandler webBeansXmlDeploymentHandler = new WebBeansXmlDeploymentHandler();
+ URLScanner urlScanner;
+
+ // The log provider
+ private static Logger log = Logger.getLogger(WebBeanDiscoveryImpl.class.getName());
+
+ public WebBeanDiscoveryImpl()
+ {
+ final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ Set<DeploymentHandler> deploymentHandlers = new HashSet<DeploymentHandler>();
+ deploymentHandlers.add(simpleWebBeansDeploymentHandler);
+ deploymentHandlers.add(webBeansXmlDeploymentHandler);
+
+ urlScanner = new URLScanner(deploymentHandlers, contextClassLoader);
+ urlScanner.scanResources(new String[] { "beans.xml" });
+ urlScanner.scanDirectories(new File[] {});
+
+ findWebBeansXmlUrls();
+ findWebBeansAnnotatedClasses();
+ }
+
+ public Iterable<EjbDescriptor<?>> discoverEjbs()
+ {
+ return new HashSet<EjbDescriptor<?>>();
+ }
+
+ public Iterable<Class<?>> discoverWebBeanClasses()
+ {
+ return wbClasses;
+ }
+
+ public Iterable<URL> discoverWebBeansXml()
+ {
+ return wbUrls;
+ }
+
+ private void findWebBeansAnnotatedClasses() throws WebBeanDiscoveryException
+ {
+ for (ClassDescriptor classDesc : simpleWebBeansDeploymentHandler.getClasses())
+ {
+ final Class<?> clazz = classDesc.getClazz();
+ wbClasses.add(clazz);
+ }
+ }
+
+ private void findWebBeansXmlUrls()
+ {
+ for (FileDescriptor fileDesc : webBeansXmlDeploymentHandler.getResources())
+ {
+ wbUrls.add(fileDesc.getUrl());
+ }
+ }
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -26,15 +26,10 @@
/**
* Fired by webbeans SE before shutting down. Applications and modules should
* release resources cleanly in response to this event.
+ *
* @author Peter Royle
*/
@BindingType
-@Retention( RetentionPolicy.RUNTIME )
-@Target( {ElementType.PARAMETER,
- ElementType.METHOD,
- ElementType.FIELD
-} )
-public @interface Shutdown
-{
-
-}
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target( { ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
+public @interface Shutdown{}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -19,23 +19,24 @@
import org.jboss.webbeans.resources.spi.NamingContext;
/**
- *
+ *
* @author Peter Royle
*/
-public class NoNamingContext
- implements NamingContext
+public class NoNamingContext implements NamingContext
{
-
- public NoNamingContext() {}
- public void bind( String name, Object value )
- {
- // No-op
- }
-
- public <T> T lookup( String name, Class<? extends T> expectedType )
- {
- return null;
- }
-
+ public NoNamingContext()
+ {
+ }
+
+ public void bind(String name, Object value)
+ {
+ // No-op
+ }
+
+ public <T> T lookup(String name, Class<? extends T> expectedType)
+ {
+ return null;
+ }
+
}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 18:44:17 UTC (rev 2009)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 18:47:48 UTC (rev 2010)
@@ -20,12 +20,14 @@
* Reflection utilities
*
* @author Pete Muir
- *
+ *
*/
public class Reflections
{
- private Reflections(String name) {}
+ private Reflections(String name)
+ {
+ }
public static <T> T newInstance(String className, Class<T> expectedType) throws InstantiationException, IllegalAccessException, ClassNotFoundException
{
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2009 - extensions/trunk/se/src/main/java/org/jboss/webbeans and 12 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 14:44:17 -0400 (Sun, 15 Mar 2009)
New Revision: 2009
Added:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
extensions/trunk/se/src/main/resources/log4j.xml
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/
Removed:
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/ParametersBinding.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bootstrap/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/ShutdownRequest.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/exception/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/lifecycle/
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/DefaultResourceLoader.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/EnumerationEnumeration.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/lifecycle/
extensions/trunk/se/src/main/resources/log4j.properties
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/StartMainTest.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/beans/
Modified:
extensions/trunk/se/
extensions/trunk/se/pom.xml
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java
extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java
extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/ParametersTestBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
Start to fix up SE for new bootstrap
Property changes on: extensions/trunk/se
___________________________________________________________________
Name: svn:ignore
- nbactions.xml
target
+ nbactions.xml
target
.classpath
.project
.settings
Modified: extensions/trunk/se/pom.xml
===================================================================
--- extensions/trunk/se/pom.xml 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/pom.xml 2009-03-15 18:44:17 UTC (rev 2009)
@@ -22,79 +22,21 @@
<target>1.5</target>
</configuration>
</plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jalopy-maven-plugin</artifactId>
- <version>1.0-alpha-1</version>
- <!-- This wipes out UNDO in IDEs. Run manually instead.
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>format</goal>
- </goals>
- </execution>
- </executions>
- -->
- </plugin>
- <plugin>
- <groupId>com.google.code.maven-license-plugin</groupId>
- <artifactId>maven-license-plugin</artifactId>
- <version>1.4.0</version>
- <configuration>
- <basedir>${basedir}</basedir>
- <header>${basedir}/src/etc/header.txt</header>
- <quiet>false</quiet>
- <failIfMissing>true</failIfMissing>
- <aggregate>false</aggregate>
- <encoding>UTF-8</encoding>
- </configuration>
- <executions>
- <execution>
- <phase>compile</phase>
- <goals>
- <goal>format</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
-
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <url>http://repository.jboss.org/maven2</url>
- <releases>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository</name>
- <url>http://snapshots.jboss.org/maven2</url>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <updatePolicy>always</updatePolicy>
- </snapshots>
- </repository>
- <repository>
- <id>repository.codehaus.org</id>
- <name>Codehaus Repository</name>
- <url>http://repository.codehaus.org</url>
- </repository>
- </repositories>
+
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
<scope>test</scope>
+ <classifier>jdk15</classifier>
+ <exclusions>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
@@ -120,16 +62,7 @@
</exclusion>
</exclusions>
</dependency>
- <!-- TODO: these have to go or be replaced with mocks -->
- <dependency>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
+
</dependencies>
</project>
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/StartMain.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -17,11 +17,22 @@
package org.jboss.webbeans.environment.se;
import javax.event.Observes;
-import org.jboss.webbeans.environment.se.boot.WebBeansBootstrap;
+import javax.inject.manager.Manager;
+
+import org.jboss.webbeans.bootstrap.api.Bootstrap;
+import org.jboss.webbeans.bootstrap.api.Environments;
+import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.context.DependentContext;
+import org.jboss.webbeans.context.api.BeanStore;
+import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
+import org.jboss.webbeans.environment.se.beans.ParametersFactory;
+import org.jboss.webbeans.environment.se.discovery.WebBeanDiscoveryImpl;
import org.jboss.webbeans.environment.se.events.Shutdown;
-import org.jboss.webbeans.environment.se.events.ShutdownRequest;
+import org.jboss.webbeans.environment.se.resources.NoNamingContext;
+import org.jboss.webbeans.environment.se.util.Reflections;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.resources.spi.NamingContext;
/**
* This is the main class that should always be called from the command
@@ -30,11 +41,15 @@
* java -jar MyApp.jar org.jboss.webbeans.environment.se.StarMain arguments
* </code>
* @author Peter Royle
+ * @author Pete Muir
*/
public class StartMain
{
- private WebBeansBootstrap webBeansBootstrap;
+ private static final String BOOTSTRAP_IMPL_CLASS_NAME = "org.jboss.webbeans.bootstrap.WebBeansBootstrap";
+
+ private final Bootstrap bootstrap;
+ private final BeanStore applicationBeanStore;
private String[] args;
private boolean hasShutdownBeenCalled = false;
Log log = Logging.getLog( StartMain.class );
@@ -42,16 +57,27 @@
public StartMain( String[] commandLineArgs )
{
this.args = commandLineArgs;
+ try
+ {
+ bootstrap = Reflections.newInstance(BOOTSTRAP_IMPL_CLASS_NAME, Bootstrap.class);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error loading Web Beans bootstrap, check that Web Beans is on the classpath", e);
+ }
+ this.applicationBeanStore = new ConcurrentHashMapBeanStore();
}
private void go()
- {
- webBeansBootstrap = new WebBeansBootstrap( args );
-
- webBeansBootstrap.initialize();
-
- webBeansBootstrap.boot();
-
+ {
+ bootstrap.setEnvironment(Environments.SE);
+ bootstrap.getServices().add(WebBeanDiscovery.class, new WebBeanDiscoveryImpl());
+ bootstrap.getServices().add(NamingContext.class, new NoNamingContext());
+ bootstrap.setApplicationContext(applicationBeanStore);
+ bootstrap.initialize();
+ bootstrap.boot();
+ bootstrap.getManager().getInstanceByType(ParametersFactory.class).setArgs(args);
+ DependentContext.INSTANCE.setActive(true);
}
/**
@@ -69,7 +95,7 @@
* Shutdown event.
* @param shutdownRequest
*/
- public void shutdown( @Observes ShutdownRequest shutdownRequest )
+ public void shutdown( @Observes @Shutdown Manager shutdownRequest )
{
synchronized (this)
{
@@ -77,7 +103,7 @@
if (!hasShutdownBeenCalled)
{
hasShutdownBeenCalled = true;
- webBeansBootstrap.shutdown();
+ bootstrap.shutdown();
} else
{
log.debug( "Skipping spurious call to shutdown");
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/beans/ParametersFactory.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -16,14 +16,16 @@
*/
package org.jboss.webbeans.environment.se.beans;
-import org.jboss.webbeans.environment.se.bindings.Parameters;
-
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
import javax.context.ApplicationScoped;
import javax.inject.Produces;
+import org.jboss.webbeans.environment.se.bindings.Parameters;
+
/**
* The simple bean that will hold the command line arguments
* and make them available by injection (using the @Parameters binding).
@@ -42,10 +44,10 @@
*/
@Produces
@Parameters
- public ArrayList<String> getArgs( )
+ // TODO Give generic type - WBRI-186
+ public List getArgs( )
{
- // TODO (PR): is there an unmodifiable, serializable List?
- return new ArrayList( Arrays.asList( this.args ) );
+ return Collections.unmodifiableList(new ArrayList<String>( Arrays.asList( this.args ) ));
}
/**
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/ParametersBinding.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/ParametersBinding.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/bindings/ParametersBinding.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,29 +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.environment.se.bindings;
-
-import javax.inject.AnnotationLiteral;
-
-/**
- *
- * @author Peter Royle
- */
-public class ParametersBinding
- extends AnnotationLiteral<Parameters>
- implements Parameters
-{
-}
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/deployment/URLScanner.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -16,9 +16,6 @@
*/
package org.jboss.webbeans.environment.se.deployment;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-
import java.io.File;
import java.io.IOException;
import java.net.URL;
@@ -31,6 +28,9 @@
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+
/**
* Implementation of {@link Scanner} which can scan a {@link URLClassLoader}
*
@@ -50,7 +50,6 @@
super( deploymentHandlers, classLoader );
}
- @Override
public void scanDirectories( File[] directories )
{
for ( File directory : directories )
Modified: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/Shutdown.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,4 +1,4 @@
-/**
+/*
* 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
@@ -16,15 +16,25 @@
*/
package org.jboss.webbeans.environment.se.events;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
/**
* Fired by webbeans SE before shutting down. Applications and modules should
* release resources cleanly in response to this event.
* @author Peter Royle
*/
-public class Shutdown
+@BindingType
+@Retention( RetentionPolicy.RUNTIME )
+@Target( {ElementType.PARAMETER,
+ ElementType.METHOD,
+ ElementType.FIELD
+} )
+public @interface Shutdown
{
- public Shutdown()
- {
- }
}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/ShutdownRequest.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/ShutdownRequest.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/events/ShutdownRequest.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,30 +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.environment.se.events;
-
-/**
-* Should be fired by application to trigger shutting down of the WebBEans SE
- * manager. This will in turn fire the Shutdown
- * @author Peter Royle
- */
-public class ShutdownRequest
-{
-
- public ShutdownRequest()
- {
- }
-}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/DefaultResourceLoader.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/DefaultResourceLoader.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/DefaultResourceLoader.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,93 +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.environment.se.resources;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.jboss.webbeans.resources.spi.ResourceLoader;
-import org.jboss.webbeans.resources.spi.ResourceLoadingException;
-import org.jboss.webbeans.util.EnumerationIterable;
-
-/**
- * A simple resource loader.
- *
- * Uses {@link DefaultResourceLoader}'s classloader if the Thread Context
- * Classloader isn't available
- *
- * @author Pete Muir
- *
- */
-public class DefaultResourceLoader implements ResourceLoader
-{
-
- public Class<?> classForName(String name)
- {
-
- try
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return Thread.currentThread().getContextClassLoader().loadClass(name);
- }
- else
- {
- return Class.forName(name);
- }
- }
- catch (ClassNotFoundException e)
- {
- throw new ResourceLoadingException(e);
- }
- catch (NoClassDefFoundError e)
- {
- throw new ResourceLoadingException(e);
- }
- }
-
- public URL getResource(String name)
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return Thread.currentThread().getContextClassLoader().getResource(name);
- }
- else
- {
- return getClass().getResource(name);
- }
- }
-
- public Iterable<URL> getResources(String name)
- {
- try
- {
- if (Thread.currentThread().getContextClassLoader() != null)
- {
- return new EnumerationIterable<URL>(Thread.currentThread().getContextClassLoader().getResources(name));
- }
- else
- {
- return new EnumerationIterable<URL>(getClass().getClassLoader().getResources(name));
- }
- }
- catch (IOException e)
- {
- throw new ResourceLoadingException(e);
- }
- }
-
-}
Copied: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java (from rev 2007, extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/boot/UnsupportedNaming.java)
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/resources/NoNamingContext.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -0,0 +1,41 @@
+/**
+ * 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.environment.se.resources;
+
+import org.jboss.webbeans.resources.spi.NamingContext;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class NoNamingContext
+ implements NamingContext
+{
+
+ public NoNamingContext() {}
+
+ public void bind( String name, Object value )
+ {
+ // No-op
+ }
+
+ public <T> T lookup( String name, Class<? extends T> expectedType )
+ {
+ return null;
+ }
+
+}
Deleted: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/EnumerationEnumeration.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/EnumerationEnumeration.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/EnumerationEnumeration.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,85 +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.environment.se.util;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-public class EnumerationEnumeration<T>
- implements Enumeration<T>
-{
- private Enumeration<T>[] enumerations;
- private int loc = 0;
-
- public EnumerationEnumeration( Enumeration<T>[] enumerations )
- {
- this.enumerations = enumerations;
- }
-
- public boolean hasMoreElements( )
- {
- for ( int i = loc; i < enumerations.length; i++ )
- {
- if ( enumerations[i].hasMoreElements( ) )
- {
- return true;
- }
- }
-
- return false;
- }
-
- public T nextElement( )
- {
- while ( isCurrentEnumerationAvailable( ) )
- {
- if ( currentHasMoreElements( ) )
- {
- return currentNextElement( );
- } else
- {
- nextEnumeration( );
- }
- }
-
- throw new NoSuchElementException( );
- }
-
- private void nextEnumeration( )
- {
- loc++;
- }
-
- /*private boolean isNextEnumerationAvailable()
- {
- return loc < enumerations.length-1;
- }*/
- private boolean isCurrentEnumerationAvailable( )
- {
- return loc < enumerations.length;
- }
-
- private T currentNextElement( )
- {
- return enumerations[loc].nextElement( );
- }
-
- private boolean currentHasMoreElements( )
- {
- return enumerations[loc].hasMoreElements( );
- }
-}
Added: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
===================================================================
--- extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java (rev 0)
+++ extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -0,0 +1,47 @@
+/**
+ * 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.environment.se.util;
+
+/**
+ * Reflection utilities
+ *
+ * @author Pete Muir
+ *
+ */
+public class Reflections
+{
+
+ private Reflections(String name) {}
+
+ public static <T> T newInstance(String className, Class<T> expectedType) throws InstantiationException, IllegalAccessException, ClassNotFoundException
+ {
+ return loadClass(className, expectedType).newInstance();
+ }
+
+ public static <T> Class<? extends T> loadClass(String className, Class<T> expectedType) throws ClassNotFoundException
+ {
+ if (Thread.currentThread().getContextClassLoader() != null)
+ {
+ return Thread.currentThread().getContextClassLoader().loadClass(className).asSubclass(expectedType);
+ }
+ else
+ {
+ return Class.forName(className).asSubclass(expectedType);
+ }
+ }
+
+}
Property changes on: extensions/trunk/se/src/main/java/org/jboss/webbeans/environment/se/util/Reflections.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: extensions/trunk/se/src/main/resources/log4j.properties
===================================================================
--- extensions/trunk/se/src/main/resources/log4j.properties 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/main/resources/log4j.properties 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,25 +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.
-#
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=DEBUG, A1
-
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Added: extensions/trunk/se/src/main/resources/log4j.xml
===================================================================
--- extensions/trunk/se/src/main/resources/log4j.xml (rev 0)
+++ extensions/trunk/se/src/main/resources/log4j.xml 2009-03-15 18:44:17 UTC (rev 2009)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/>
+ </layout>
+ <filter class="org.apache.log4j.varia.StringMatchFilter">
+ <param name="AcceptOnMatch" value="false" />
+ <param name="StringToMatch" value="Failure while notifying an observer of event [a]" />
+ </filter>
+ </appender>
+
+ <!-- ############### Web Beans logging ################### -->
+
+ <category name="org.jboss.webbeans">
+ <priority value="INFO"/>
+ </category>
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: extensions/trunk/se/src/main/resources/log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/StartMainTest.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/StartMainTest.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/StartMainTest.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -1,75 +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.environment.se;
-
-import javax.inject.manager.Manager;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.environment.se.beans.MainTestBean;
-import org.jboss.webbeans.environment.se.beans.ParametersTestBean;
-import org.jboss.webbeans.environment.se.events.ShutdownRequest;
-
-/**
- *
- * @author Peter Royle
- */
-public class StartMainTest extends TestCase {
-
- public static String[] ARGS = new String[] { "arg1", "arg2", "arg 3"};
-
- public StartMainTest(String testName) {
- super(testName);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- /**
- * Test of main method, of class StartMain. Checks that the beans
- * found in the org.jboss.webbeans.environment.se.beans package are
- * initialised as expected.
- */
- public void testMain()
- {
- String[] args = ARGS ;
- StartMain.main( args );
-
- Manager manager = CurrentManager.rootManager();
- MainTestBean mainTestBean = manager.getInstanceByType( MainTestBean.class );
- Assert.assertNotNull( mainTestBean );
-
- ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
- Assert.assertNotNull( paramsBean );
- Assert.assertNotNull( paramsBean.getParam1() );
- Assert.assertEquals( ARGS[0], paramsBean.getParam1() );
- Assert.assertNotNull( paramsBean.getParam2() );
- Assert.assertEquals( ARGS[1], paramsBean.getParam2() );
- Assert.assertNotNull( paramsBean.getParam3() );
- Assert.assertEquals( ARGS[2], paramsBean.getParam3() );
-
- manager.fireEvent( new ShutdownRequest() );
- }
-
-}
Copied: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java (from rev 2007, extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/StartMainTest.java)
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java (rev 0)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/StartMainTest.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -0,0 +1,66 @@
+/**
+ * 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.environment.se.test;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Manager;
+
+import org.jboss.webbeans.CurrentManager;
+import org.jboss.webbeans.environment.se.StartMain;
+import org.jboss.webbeans.environment.se.events.Shutdown;
+import org.jboss.webbeans.environment.se.test.beans.MainTestBean;
+import org.jboss.webbeans.environment.se.test.beans.ParametersTestBean;
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * @author Peter Royle
+ */
+public class StartMainTest {
+
+ public static String[] ARGS = new String[] { "arg1", "arg2", "arg 3"};
+
+
+ /**
+ * Test of main method, of class StartMain. Checks that the beans
+ * found in the org.jboss.webbeans.environment.se.beans package are
+ * initialised as expected.
+ */
+ @Test
+ public void testMain()
+ {
+ String[] args = ARGS ;
+ StartMain.main( args );
+
+ Manager manager = CurrentManager.rootManager();
+ MainTestBean mainTestBean = manager.getInstanceByType( MainTestBean.class );
+ Assert.assertNotNull( mainTestBean );
+
+ ParametersTestBean paramsBean = mainTestBean.getParametersTestBean();
+ Assert.assertNotNull( paramsBean );
+ Assert.assertNotNull( paramsBean.getParam1() );
+ Assert.assertEquals( ARGS[0], paramsBean.getParam1() );
+ Assert.assertNotNull( paramsBean.getParam2() );
+ Assert.assertEquals( ARGS[1], paramsBean.getParam2() );
+ Assert.assertNotNull( paramsBean.getParam3() );
+ Assert.assertEquals( ARGS[2], paramsBean.getParam3() );
+
+ manager.fireEvent( manager, new AnnotationLiteral<Shutdown>() {} );
+ }
+
+}
Copied: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans (from rev 2007, extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/beans)
Modified: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/beans/MainTestBean.java 2009-03-15 17:44:31 UTC (rev 2007)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/MainTestBean.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.webbeans.environment.se.beans;
+package org.jboss.webbeans.environment.se.test.beans;
import javax.inject.Current;
import javax.inject.Initializer;
Modified: extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/ParametersTestBean.java
===================================================================
--- extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/beans/ParametersTestBean.java 2009-03-15 17:44:31 UTC (rev 2007)
+++ extensions/trunk/se/src/test/java/org/jboss/webbeans/environment/se/test/beans/ParametersTestBean.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -16,13 +16,15 @@
*/
-package org.jboss.webbeans.environment.se.beans;
+package org.jboss.webbeans.environment.se.test.beans;
import java.util.List;
+
import javax.inject.Initializer;
-import junit.framework.Assert;
-import org.jboss.webbeans.environment.se.StartMainTest;
+
import org.jboss.webbeans.environment.se.bindings.Parameters;
+import org.jboss.webbeans.environment.se.test.StartMainTest;
+import org.testng.Assert;
/**
*
@@ -37,7 +39,7 @@
@Initializer
public void init(@Parameters List<String> params) {
Assert.assertNotNull( params );
- Assert.assertEquals( "Unexpected number of arguments", StartMainTest.ARGS.length, params.size() );
+ Assert.assertEquals( StartMainTest.ARGS.length, params.size(), "Unexpected number of arguments");
param1 = params.get( 0 );
param2 = params.get( 1 );
param3 = params.get( 2 );
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-15 18:17:47 UTC (rev 2008)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-15 18:44:17 UTC (rev 2009)
@@ -26,6 +26,7 @@
import org.jboss.webbeans.bean.standard.InjectionPointBean;
import org.jboss.webbeans.bean.standard.ManagerBean;
import org.jboss.webbeans.bootstrap.api.Bootstrap;
+import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.context.ApplicationContext;
@@ -106,11 +107,14 @@
beanDeployer.addClasses(classes);
beanDeployer.addBean(ManagerBean.of(manager));
beanDeployer.addBean(InjectionPointBean.of(manager));
- beanDeployer.addClass(ConversationImpl.class);
- beanDeployer.addClass(ServletConversationManager.class);
- beanDeployer.addClass(JavaSEConversationTerminator.class);
- beanDeployer.addClass(NumericConversationIdGenerator.class);
- beanDeployer.addClass(HttpSessionManager.class);
+ if (!getEnvironment().equals(Environments.SE))
+ {
+ beanDeployer.addClass(ConversationImpl.class);
+ beanDeployer.addClass(ServletConversationManager.class);
+ beanDeployer.addClass(JavaSEConversationTerminator.class);
+ beanDeployer.addClass(NumericConversationIdGenerator.class);
+ beanDeployer.addClass(HttpSessionManager.class);
+ }
beanDeployer.deploy();
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r2008 - ri/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-15 14:17:47 -0400 (Sun, 15 Mar 2009)
New Revision: 2008
Modified:
ri/trunk/pom.xml
Log:
oops
Modified: ri/trunk/pom.xml
===================================================================
--- ri/trunk/pom.xml 2009-03-15 17:44:31 UTC (rev 2007)
+++ ri/trunk/pom.xml 2009-03-15 18:17:47 UTC (rev 2008)
@@ -67,7 +67,6 @@
<module>api</module>
<module>spi</module>
<module>impl</module>
- <module>xsd</module>
<module>porting-package</module>
<module>jboss-tck-runner</module>
</modules>
15 years, 10 months