Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to latest spec, better restrictions on what can be simple web …
…beans git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@445 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
17 changed files
with
634 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.jboss.webbeans.jsf; | ||
|
||
import org.jboss.webbeans.util.ApiAbstraction; | ||
|
||
public class JSF extends ApiAbstraction | ||
{ | ||
|
||
public static final Class<?> UICOMPONENT_CLASS = classForName("javax.faces.component.UIComponent"); | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
webbeans-ri/src/main/java/org/jboss/webbeans/servlet/Servlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.jboss.webbeans.servlet; | ||
|
||
import org.jboss.webbeans.util.ApiAbstraction; | ||
|
||
public class Servlet extends ApiAbstraction | ||
{ | ||
|
||
public static final Class<?> SERVLET_CLASS = classForName("javax.servlet.Servlet"); | ||
public static final Class<?> FILTER_CLASS = classForName("javax.servlet.Filter"); | ||
public static final Class<?> SERVLET_CONTEXT_LISTENER_CLASS = classForName("javax.servlet.ServletContextListener"); | ||
public static final Class<?> HTTP_SESSION_LISTENER_CLASS = classForName("javax.servlet.http.HttpSessionListener"); | ||
public static final Class<?> SERVLET_REQUEST_LISTENER_CLASS = classForName("javax.servlet.ServletRequestListener"); | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
webbeans-ri/src/main/java/org/jboss/webbeans/util/ApiAbstraction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package org.jboss.webbeans.util; | ||
|
||
import java.lang.annotation.Annotation; | ||
|
||
public class ApiAbstraction | ||
{ | ||
|
||
public @interface DummyAnnotation | ||
{ | ||
} | ||
|
||
|
||
public interface Dummy | ||
{ | ||
} | ||
|
||
/** | ||
* Initializes an annotation class | ||
* | ||
* @param name The name of the annotation class | ||
* @return The instance of the annotation. Returns a dummy if the class was | ||
* not found | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
protected static Class<? extends Annotation> annotationTypeForName(String name) | ||
{ | ||
try | ||
{ | ||
return (Class<? extends Annotation>) Reflections.classForName(name); | ||
} | ||
catch (ClassNotFoundException cnfe) | ||
{ | ||
return DummyAnnotation.class; | ||
} | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
protected static Class<?> classForName(String name) | ||
{ | ||
try | ||
{ | ||
return (Class<? extends Annotation>) Reflections.classForName(name); | ||
} | ||
catch (ClassNotFoundException cnfe) | ||
{ | ||
return Dummy.class; | ||
} | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EnterpriseBeanWebBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.jboss.webbeans.test.beans.nonBeans; | ||
|
||
import javax.ejb.EnterpriseBean; | ||
|
||
public class EnterpriseBeanWebBean implements EnterpriseBean | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
webbeans-ri/src/test/java/org/jboss/webbeans/test/beans/nonBeans/EntityBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.jboss.webbeans.test.beans.nonBeans; | ||
|
||
public class EntityBean | ||
{ | ||
|
||
} |
Oops, something went wrong.