[webbeans-commits] Webbeans SVN: r645 - ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-21 00:16:08 -0500 (Sun, 21 Dec 2008)
New Revision: 645
Modified:
doc/trunk/reference/en/modules/example.xml
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
Log:
oops, sillyme
Modified: doc/trunk/reference/en/modules/example.xml
===================================================================
--- doc/trunk/reference/en/modules/example.xml 2008-12-21 05:09:27 UTC (rev 644)
+++ doc/trunk/reference/en/modules/example.xml 2008-12-21 05:16:08 UTC (rev 645)
@@ -69,7 +69,7 @@
return user!=null;
}
- @Produces @LoggedIn @Dependent User getCurrentUser() {
+ @Produces @LoggedIn User getCurrentUser() {
return user;
}
Modified: ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
===================================================================
--- ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java 2008-12-21 05:09:27 UTC (rev 644)
+++ ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java 2008-12-21 05:16:08 UTC (rev 645)
@@ -6,7 +6,6 @@
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.webbeans.Current;
-import javax.webbeans.Dependent;
import javax.webbeans.Named;
import javax.webbeans.Produces;
import javax.webbeans.SessionScoped;
@@ -47,8 +46,7 @@
return user!=null;
}
- @Produces @LoggedIn @Dependent
- User getCurrentUser() {
+ @Produces @LoggedIn User getCurrentUser() {
return user;
}
16 years
[webbeans-commits] Webbeans SVN: r644 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: ejb and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-21 00:09:27 -0500 (Sun, 21 Dec 2008)
New Revision: 644
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
Log:
minor
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-21 02:47:01 UTC (rev 643)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2008-12-21 05:09:27 UTC (rev 644)
@@ -177,7 +177,6 @@
protected void initDeploymentType()
{
Set<Annotation> deploymentTypes = getAnnotatedItem().getMetaAnnotations(DeploymentType.class);
-
if (deploymentTypes.size() > 1)
{
throw new DefinitionException("At most one deployment type may be specified (" + deploymentTypes + " are specified) on " + getAnnotatedItem().toString());
@@ -189,9 +188,10 @@
return;
}
- if (getMergedStereotypes().getPossibleDeploymentTypes().size() > 0)
+ AnnotationMap possibleDeploymentTypes = getMergedStereotypes().getPossibleDeploymentTypes();
+ if (possibleDeploymentTypes.size() > 0)
{
- this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), getMergedStereotypes().getPossibleDeploymentTypes());
+ this.deploymentType = getDeploymentType(manager.getEnabledDeploymentTypes(), possibleDeploymentTypes);
log.trace("Deployment type " + deploymentType + " specified by stereotype");
return;
}
@@ -269,25 +269,26 @@
*/
protected void initScopeType()
{
- if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() > 1)
+ Set<Annotation> scopeAnnotations = getAnnotatedItem().getMetaAnnotations(ScopeType.class);
+ if (scopeAnnotations.size() > 1)
{
throw new DefinitionException("At most one scope may be specified");
}
-
- if (getAnnotatedItem().getMetaAnnotations(ScopeType.class).size() == 1)
+ if (scopeAnnotations.size() == 1)
{
- this.scopeType = getAnnotatedItem().getMetaAnnotations(ScopeType.class).iterator().next().annotationType();
+ this.scopeType = scopeAnnotations.iterator().next().annotationType();
log.trace("Scope " + scopeType + " specified by annotation");
return;
}
- if (getMergedStereotypes().getPossibleScopeTypes().size() == 1)
+ Set<Annotation> possibleScopeTypes = getMergedStereotypes().getPossibleScopeTypes();
+ if (possibleScopeTypes.size() == 1)
{
- this.scopeType = getMergedStereotypes().getPossibleScopeTypes().iterator().next().annotationType();
+ this.scopeType = possibleScopeTypes.iterator().next().annotationType();
log.trace("Scope " + scopeType + " specified by stereotype");
return;
}
- else if (getMergedStereotypes().getPossibleScopeTypes().size() > 1)
+ else if (possibleScopeTypes.size() > 1)
{
throw new DefinitionException("All stereotypes must specify the same scope OR a scope must be specified on the bean");
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-21 02:47:01 UTC (rev 643)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2008-12-21 05:09:27 UTC (rev 644)
@@ -77,7 +77,6 @@
/**
* Initializes the bean and its metadata
*/
- @SuppressWarnings("unchecked")
@Override
protected void init()
{
@@ -260,7 +259,6 @@
*
* @return The instance
*/
- @SuppressWarnings("unchecked")
@Override
public T create()
{
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-21 02:47:01 UTC (rev 643)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/ejb/DefaultEnterpriseBeanLookup.java 2008-12-21 05:09:27 UTC (rev 644)
@@ -68,7 +68,7 @@
* @return The EJB reference
*/
@SuppressWarnings("unchecked")
- public static <T> T lookup(EjbDescriptor<T> ejbDescriptor)
+ public <T> T lookup(EjbDescriptor<T> ejbDescriptor)
{
try
{
16 years
[webbeans-commits] Webbeans SVN: r643 - doc/trunk/reference/it-IT/modules.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2008-12-20 21:47:01 -0500 (Sat, 20 Dec 2008)
New Revision: 643
Modified:
doc/trunk/reference/it-IT/modules/events.po
doc/trunk/reference/it-IT/modules/ri-spi.po
Log:
WBRI-69: Italian translation for Web Beans
Modified: doc/trunk/reference/it-IT/modules/events.po
===================================================================
--- doc/trunk/reference/it-IT/modules/events.po 2008-12-21 02:36:03 UTC (rev 642)
+++ doc/trunk/reference/it-IT/modules/events.po 2008-12-21 02:47:01 UTC (rev 643)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-20 15:39+0100\n"
+"PO-Revision-Date: 2008-12-21 03:42+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -53,7 +53,7 @@
#: events.xml:30
#, no-c-format
msgid "An <emphasis>observer method</emphasis> is a method of a Web Bean with a parameter annotated <literal>@Observes</literal>."
-msgstr ""
+msgstr "Un <emphasis>metodo osservatore</emphasis> è un metodo di un Web Bean con un parametro annotato <literal>@Observes</literal>."
#. Tag: programlisting
#: events.xml:33
@@ -65,7 +65,7 @@
#: events.xml:35
#, no-c-format
msgid "The annotated parameter is called the <emphasis>event parameter</emphasis>. The type of the event parameter is the observed <emphasis>event type</emphasis>. Observer methods may also specify \"selectors\", which are just instances of Web Beans binding types. When a binding type is used as an event selector, it is called an <emphasis>event binding type</emphasis>."
-msgstr ""
+msgstr "Il parametro annotato viene chiamato <emphasis>parametro evento</emphasis>. Il tipo di parametro evento è il <emphasis>tipo evento</emphasis> osservato. I metodi osservatori possono anche specificare dei \"selettori\", che sono solo istanze di tipi di binding di Web Beans. Quando un tipo di binding viene usato come selettore di eventi viene chiamato <emphasis>tipo binding di evento</emphasis>. "
#. Tag: programlisting
#: events.xml:41
@@ -85,7 +85,7 @@
#: events.xml:43
#, no-c-format
msgid "We specify the event bindings of the observer method by annotating the event parameter:"
-msgstr ""
+msgstr "Specifichiamo i binding di evento del metodo osservatore annotando il parametro evento:"
#. Tag: programlisting
#: events.xml:46
@@ -98,13 +98,13 @@
#: events.xml:48
#, no-c-format
msgid "An observer method need not specify any event bindings—in this case it is interested in <emphasis>all</emphasis> events of a particular type. If it does specify event bindings, it is only interested in events which also have those event bindings."
-msgstr ""
+msgstr "Un metodo osservatore non ha bisogno di specificare alcun binding di evento—in questo caso è interessato a <emphasis>tutti</emphasis> gli eventi di un particolare tipo. Se specifica dei binding di evento, è solamente interessato agli eventi che hanno anche gli stessi binding di evento."
#. Tag: para
#: events.xml:53
#, no-c-format
msgid "The observer method may have additional parameters, which are injected according to the usual Web Beans method parameter injection semantics:"
-msgstr ""
+msgstr "Il metodo osservatore può avere parametri addizionali che vengono iniettati secondo la solita semantica di iniezione del parametro del metodo Web Beans."
#. Tag: programlisting
#: events.xml:56
@@ -452,7 +452,7 @@
#: events.xml:233
#, no-c-format
msgid "Imagine that we have cached a JPA query result set in the application scope:"
-msgstr ""
+msgstr "Si immagini di avere cachato un risultato di query JPA nello scope di applicazione:"
#. Tag: programlisting
#: events.xml:235
@@ -498,7 +498,7 @@
#: events.xml:237
#, no-c-format
msgid "From time to time, a <literal>Product</literal> is created or deleted. When this occurs, we need to refresh the <literal>Product</literal> catalog. But we should wait until <emphasis>after</emphasis> the transaction completes successfully before performing this refresh!"
-msgstr ""
+msgstr "Di tanto in tanto un <literal>Product</literal> viene creato o cancellato. Quando questo avviene occorre aggiornare il catalogo del <literal>Product</literal>. Ma si dovrebbe aspettare che la transazione <emphasis>abbia completato</emphasis> con successo prima di eseguire l'aggiornamento!"
#. Tag: para
#: events.xml:242
Modified: doc/trunk/reference/it-IT/modules/ri-spi.po
===================================================================
--- doc/trunk/reference/it-IT/modules/ri-spi.po 2008-12-21 02:36:03 UTC (rev 642)
+++ doc/trunk/reference/it-IT/modules/ri-spi.po 2008-12-21 02:47:01 UTC (rev 643)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-20 22:07+0000\n"
-"PO-Revision-Date: 2008-12-20 22:07+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2008-12-21 03:45+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -22,22 +22,13 @@
#. Tag: para
#: ri-spi.xml:6
#, no-c-format
-msgid ""
-"Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into "
-"other EE environments (for example another application server like "
-"Glassfish), into a servlet container (like Tomcat), or with an Embedded "
-"EJB3.1 implementation is fairly easy. In this Appendix we will briefly "
-"discuss the steps needed."
+msgid "Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into other EE environments (for example another application server like Glassfish), into a servlet container (like Tomcat), or with an Embedded EJB3.1 implementation is fairly easy. In this Appendix we will briefly discuss the steps needed."
msgstr ""
#. Tag: para
#: ri-spi.xml:15
#, no-c-format
-msgid ""
-"It should be possible to run Web Beans in an SE environment, but you'll to "
-"do more work, adding your own contexts and lifecycle. The Web Beans RI "
-"currently doesn't expose lifecycle extension points, so you would have to "
-"code directly against Web Beans RI classes."
+msgid "It should be possible to run Web Beans in an SE environment, but you'll to do more work, adding your own contexts and lifecycle. The Web Beans RI currently doesn't expose lifecycle extension points, so you would have to code directly against Web Beans RI classes."
msgstr ""
#. Tag: title
@@ -49,9 +40,7 @@
#. Tag: para
#: ri-spi.xml:26
#, no-c-format
-msgid ""
-"The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, "
-"and packaged as <literal>webbeans-ri-spi.jar</literal>."
+msgid "The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, and packaged as <literal>webbeans-ri-spi.jar</literal>."
msgstr ""
#. Tag: para
@@ -66,8 +55,7 @@
msgid ""
"<![CDATA[public interface WebBeanDiscovery {\n"
" /**\n"
-" * Gets list of all classes in classpath archives with web-beans.xml "
-"files\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
" * \n"
" * @return An iterable over the classes \n"
" */\n"
@@ -89,24 +77,40 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface WebBeanDiscovery {\n"
+" /**\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
+" * \n"
+" * @return An iterable over the classes \n"
+" */\n"
+" public Iterable<Class<?>> discoverWebBeanClasses();\n"
+" \n"
+" /**\n"
+" * Gets a list of all web-beans.xml files in the app classpath\n"
+" * \n"
+" * @return An iterable over the web-beans.xml files \n"
+" */\n"
+" public Iterable<URL> discoverWebBeansXml();\n"
+" \n"
+" /**\n"
+" * Gets a descriptor for each EJB in the application\n"
+" * \n"
+" * @return The bean class to descriptor map \n"
+" */\n"
+" public Iterable<EjbDescriptor<?>> discoverEjbs();\n"
+" \n"
+"}]]>"
#. Tag: para
#: ri-spi.xml:37
#, no-c-format
-msgid ""
-"The discovery of Web Bean classes and <literal>web-bean.xml</literal> files "
-"is self-explanatory (the algorithm is described in Section 11.1 of the JSR-"
-"299 specification, and isn't repeated here)."
+msgid "The discovery of Web Bean classes and <literal>web-bean.xml</literal> files is self-explanatory (the algorithm is described in Section 11.1 of the JSR-299 specification, and isn't repeated here)."
msgstr ""
#. Tag: para
#: ri-spi.xml:43
#, no-c-format
-msgid ""
-"The Web Beans RI also delegates EJB3 bean discovery to the container so that "
-"it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</"
-"literal>. For each EJB in the application an EJBDescriptor should be "
-"discovered:"
+msgid "The Web Beans RI also delegates EJB3 bean discovery to the container so that it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</literal>. For each EJB in the application an EJBDescriptor should be discovered:"
msgstr ""
#. Tag: programlisting
@@ -127,16 +131,14 @@
" * \n"
" * @return An iterator over the local business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces"
-"();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
" \n"
" /**\n"
" * Gets the remote business interfaces of the EJB\n"
" * \n"
" * @return An iterator over the remote business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> "
-"getRemoteBusinessInterfaces();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
" \n"
" /**\n"
" * Get the remove methods of the EJB\n"
@@ -189,44 +191,102 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface EjbDescriptor<T> {\n"
+" \n"
+" /**\n"
+" * Gets the EJB type\n"
+" * \n"
+" * @return The EJB Bean class\n"
+" */\n"
+" public Class<T> getType();\n"
+"\n"
+" /**\n"
+" * Gets the local business interfaces of the EJB\n"
+" * \n"
+" * @return An iterator over the local business interfaces\n"
+" */\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
+" \n"
+" /**\n"
+" * Gets the remote business interfaces of the EJB\n"
+" * \n"
+" * @return An iterator over the remote business interfaces\n"
+" */\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
+" \n"
+" /**\n"
+" * Get the remove methods of the EJB\n"
+" * \n"
+" * @return An iterator over the remove methods\n"
+" */\n"
+" public Iterable<MethodDescriptor> getRemoveMethods();\n"
+"\n"
+" /**\n"
+" * Indicates if the bean is stateless\n"
+" * \n"
+" * @return True if stateless, false otherwise\n"
+" */\n"
+" public boolean isStateless();\n"
+"\n"
+" /**\n"
+" * Indicates if the bean is a EJB 3.1 Singleton\n"
+" * \n"
+" * @return True if the bean is a singleton, false otherwise\n"
+" */\n"
+" public boolean isSingleton();\n"
+"\n"
+" /**\n"
+" * Indicates if the EJB is stateful\n"
+" * \n"
+" * @return True if the bean is stateful, false otherwise\n"
+" */\n"
+" public boolean isStateful();\n"
+"\n"
+" /**\n"
+" * Indicates if the EJB is and MDB\n"
+" * \n"
+" * @return True if the bean is an MDB, false otherwise\n"
+" */\n"
+" public boolean isMessageDriven();\n"
+"\n"
+" /**\n"
+" * Gets the EJB name\n"
+" * \n"
+" * @return The name\n"
+" */\n"
+" public String getEjbName();\n"
+" \n"
+" /**\n"
+" * @return The JNDI string which can be used to lookup a proxy which \n"
+" * implements all local business interfaces \n"
+" * \n"
+" */\n"
+" public String getLocalJndiName();\n"
+" \n"
+"}]]>"
#. Tag: para
#: ri-spi.xml:52
#, no-c-format
-msgid ""
-"The contract described the JavaDoc is enough to implement an EJBDescriptor. "
-"In addition to these two interfaces, there is "
-"<literal>BusinessInterfaceDescriptor</literal> which represents a local "
-"business interface (encapsulating the interface class and jndi name), and "
-"<literal>MethodDescriptor</literal> which encapsulates the method name and "
-"parameter types (allowing it to be invoked on any instance of the EJB, proxy "
-"or otherwise)."
+msgid "The contract described the JavaDoc is enough to implement an EJBDescriptor. In addition to these two interfaces, there is <literal>BusinessInterfaceDescriptor</literal> which represents a local business interface (encapsulating the interface class and jndi name), and <literal>MethodDescriptor</literal> which encapsulates the method name and parameter types (allowing it to be invoked on any instance of the EJB, proxy or otherwise)."
msgstr ""
#. Tag: para
#: ri-spi.xml:62
#, no-c-format
-msgid ""
-"The Web Beans RI can be told to load your implementation of "
-"<literal>WebBeanDiscovery</literal> using the property <literal>org.jboss."
-"webbeans.bootstrap.webBeanDiscovery</literal> with the fully qualified class "
-"name as the value. For example:"
+msgid "The Web Beans RI can be told to load your implementation of <literal>WebBeanDiscovery</literal> using the property <literal>org.jboss.webbeans.bootstrap.webBeanDiscovery</literal> with the fully qualified class name as the value. For example:"
msgstr ""
#. Tag: programlisting
#: ri-spi.xml:69
#, no-c-format
-msgid ""
-"org.jboss.webbeans.bootstrap.webBeanDiscovery=org.jboss.webbeans.integration."
-"jbossas.WebBeanDiscoveryImpl"
-msgstr ""
+msgid "org.jboss.webbeans.bootstrap.webBeanDiscovery=org.jboss.webbeans.integration.jbossas.WebBeanDiscoveryImpl"
+msgstr "org.jboss.webbeans.bootstrap.webBeanDiscovery=org.jboss.webbeans.integration.jbossas.WebBeanDiscoveryImpl"
#. Tag: para
#: ri-spi.xml:71
#, no-c-format
-msgid ""
-"The property can either be specified as a system property, or in a "
-"properties file <literal>META-INF/web-beans-ri.properties</literal>."
+msgid "The property can either be specified as a system property, or in a properties file <literal>META-INF/web-beans-ri.properties</literal>."
msgstr ""
#. Tag: title
@@ -238,9 +298,7 @@
#. Tag: para
#: ri-spi.xml:81
#, no-c-format
-msgid ""
-"There are a number of requirements that the Web Beans RI places on the "
-"container for correct functioning that fall outside implementation of APIs"
+msgid "There are a number of requirements that the Web Beans RI places on the container for correct functioning that fall outside implementation of APIs"
msgstr ""
#. Tag: term
@@ -252,10 +310,7 @@
#. Tag: para
#: ri-spi.xml:93
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an environment that supports "
-"deployment of applications, you must enable, automatically, or through user "
-"configuation, classloader isolation for each Web Beans application"
+msgid "If you are integrating the Web Beans into an environment that supports deployment of applications, you must enable, automatically, or through user configuation, classloader isolation for each Web Beans application"
msgstr ""
#. Tag: term
@@ -267,9 +322,6 @@
#. Tag: para
#: ri-spi.xml:106
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an environment that supports "
-"deployment of applications, you must insert the <literal>webbeans-ri.jar</"
-"literal> into the applications isolated classloader. It cannot be loaded "
-"from a shared classloader."
+msgid "If you are integrating the Web Beans into an environment that supports deployment of applications, you must insert the <literal>webbeans-ri.jar</literal> into the applications isolated classloader. It cannot be loaded from a shared classloader."
msgstr ""
+
16 years
[webbeans-commits] Webbeans SVN: r642 - in ri/trunk/examples/login: WebContent and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-20 21:36:03 -0500 (Sat, 20 Dec 2008)
New Revision: 642
Added:
ri/trunk/examples/login/WebContent/
ri/trunk/examples/login/WebContent/WEB-INF/
ri/trunk/examples/login/WebContent/WEB-INF/faces-config.xml
ri/trunk/examples/login/WebContent/WEB-INF/web-beans.xml
ri/trunk/examples/login/WebContent/WEB-INF/web.xml
ri/trunk/examples/login/WebContent/home.xhtml
ri/trunk/examples/login/WebContent/index.html
ri/trunk/examples/login/WebContent/style/
ri/trunk/examples/login/WebContent/template.xhtml
ri/trunk/examples/login/build.xml
ri/trunk/examples/login/pom.xml
ri/trunk/examples/login/src/
ri/trunk/examples/login/src/main/
ri/trunk/examples/login/src/main/java/
ri/trunk/examples/login/src/main/java/org/
ri/trunk/examples/login/src/main/java/org/jboss/
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/User.java
ri/trunk/examples/login/src/main/resources/
ri/trunk/examples/login/src/main/resources/META-INF/
Log:
login example
Added: ri/trunk/examples/login/WebContent/WEB-INF/faces-config.xml
===================================================================
--- ri/trunk/examples/login/WebContent/WEB-INF/faces-config.xml (rev 0)
+++ ri/trunk/examples/login/WebContent/WEB-INF/faces-config.xml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: ri/trunk/examples/login/WebContent/WEB-INF/web-beans.xml
===================================================================
Added: ri/trunk/examples/login/WebContent/WEB-INF/web.xml
===================================================================
--- ri/trunk/examples/login/WebContent/WEB-INF/web.xml (rev 0)
+++ ri/trunk/examples/login/WebContent/WEB-INF/web.xml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Web Beans Login example</display-name>
+
+ <!-- JSF -->
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+ <listener>
+ <listener-class>org.jboss.webbeans.servlet.WebBeansListener</listener-class>
+ </listener>
+
+</web-app>
Added: ri/trunk/examples/login/WebContent/home.xhtml
===================================================================
--- ri/trunk/examples/login/WebContent/home.xhtml (rev 0)
+++ ri/trunk/examples/login/WebContent/home.xhtml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+
+ <ui:composition template="template.xhtml">
+ <ui:define name="content">
+ <h:messages/>
+ <h:form>
+ <h:panelGrid columns="2" rendered="#{!login.loggedIn}">
+ <h:outputLabel for="username">Username:</h:outputLabel>
+ <h:inputText id="username" value="#{credentials.username}"/>
+ <h:outputLabel for="password">Password:</h:outputLabel>
+ <h:inputText id="password" value="#{credentials.password}"/>
+ </h:panelGrid>
+ <h:commandButton value="Login" action="#{login.login}" rendered="#{!login.loggedIn}"/>
+ <h:commandButton value="Logout" action="#{login.logout}" rendered="#{login.loggedIn}"/>
+ </h:form>
+ </ui:define>
+ </ui:composition>
+</html>
Added: ri/trunk/examples/login/WebContent/index.html
===================================================================
--- ri/trunk/examples/login/WebContent/index.html (rev 0)
+++ ri/trunk/examples/login/WebContent/index.html 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=home.jsf">
+</head>
+</html>
\ No newline at end of file
Added: ri/trunk/examples/login/WebContent/template.xhtml
===================================================================
--- ri/trunk/examples/login/WebContent/template.xhtml (rev 0)
+++ ri/trunk/examples/login/WebContent/template.xhtml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,35 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:s="http://jboss.com/products/seam/taglib"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>Login</title>
+ <link href="style/main.css" rel="stylesheet" type="text/css"/>
+ <ui:insert name="head"/>
+</head>
+
+<body>
+
+ <div id="container">
+ <div id="header">
+
+ </div>
+
+ <div id="sidebar">
+
+ </div>
+
+ <div id="content">
+ <ui:insert name="content"/>
+ </div>
+
+ <br style="clear:both"/>
+ </div>
+
+</body>
+</html>
+
Added: ri/trunk/examples/login/build.xml
===================================================================
--- ri/trunk/examples/login/build.xml (rev 0)
+++ ri/trunk/examples/login/build.xml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,7 @@
+<project basedir="." name="Login Example Build" default="restart">
+
+ <property name="example.name" value="webbeans-login" />
+
+ <import file="../build.xml" />
+
+</project>
\ No newline at end of file
Added: ri/trunk/examples/login/pom.xml
===================================================================
--- ri/trunk/examples/login/pom.xml (rev 0)
+++ ri/trunk/examples/login/pom.xml 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.jboss.webbeans.examples</groupId>
+ <artifactId>webbeans-login</artifactId>
+ <packaging>war</packaging>
+ <name>Web Beans Examples: Login</name>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus snapshot repository</id>
+ <url>http://snapshots.repository.codehaus.org/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.webbeans</groupId>
+ <artifactId>webbeans-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </dependency>
+
+ <!-- <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>-->
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>webbeans-login</finalName>
+ </build>
+
+</project>
+
Added: ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java
===================================================================
--- ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java (rev 0)
+++ ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Credentials.java 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.examples.login;
+
+import javax.webbeans.Named;
+import javax.webbeans.RequestScoped;
+
+@RequestScoped @Named
+public class Credentials {
+
+ private String username;
+ private String password;
+
+ public String getUsername() { return username; }
+ public void setUsername(String username) { this.username = username; }
+
+ public String getPassword() { return password; }
+ public void setPassword(String password) { this.password = password; }
+
+}
\ No newline at end of file
Added: ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java
===================================================================
--- ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java (rev 0)
+++ ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/LoggedIn.java 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.examples.login;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({TYPE, METHOD, FIELD})
+@BindingType
+public @interface LoggedIn {}
Added: ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java
===================================================================
--- ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java (rev 0)
+++ ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/Login.java 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,55 @@
+package org.jboss.webbeans.examples.login;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.webbeans.Current;
+import javax.webbeans.Dependent;
+import javax.webbeans.Named;
+import javax.webbeans.Produces;
+import javax.webbeans.SessionScoped;
+
+@SessionScoped @Named
+public class Login {
+
+ @Current Credentials credentials;
+ //@PersistenceContext EntityManager userDatabase;
+
+ private User user;
+
+ public void login() {
+
+ List<User> results = /*userDatabase.createQuery(
+ "select u from User u where u.username=:username and u.password=:password")
+ .setParameter("username", credentials.getUsername())
+ .setParameter("password", credentials.getPassword())
+ .getResultList();*/
+
+ Arrays.asList( new User(credentials.getUsername(), "Your Name", credentials.getPassword()) );
+
+ if ( !results.isEmpty() ) {
+ user = results.get(0);
+ FacesContext.getCurrentInstance()
+ .addMessage(null, new FacesMessage("Welcome, " + user.getName()));
+ }
+
+ }
+
+ public void logout() {
+ FacesContext.getCurrentInstance()
+ .addMessage(null, new FacesMessage("Goodbye, " + user.getName()));
+ user = null;
+ }
+
+ public boolean isLoggedIn() {
+ return user!=null;
+ }
+
+ @Produces @LoggedIn @Dependent
+ User getCurrentUser() {
+ return user;
+ }
+
+}
\ No newline at end of file
Added: ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/User.java
===================================================================
--- ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/User.java (rev 0)
+++ ri/trunk/examples/login/src/main/java/org/jboss/webbeans/examples/login/User.java 2008-12-21 02:36:03 UTC (rev 642)
@@ -0,0 +1,27 @@
+package org.jboss.webbeans.examples.login;
+
+public class User {
+ private String username;
+ private String name;
+ private String password;
+
+ public User(String username, String name, String password) {
+ super();
+ this.username = username;
+ this.name = name;
+ this.password = password;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+}
16 years
[webbeans-commits] Webbeans SVN: r640 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-20 20:50:49 -0500 (Sat, 20 Dec 2008)
New Revision: 640
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
Log:
test for correct constructor before creating the SimpleBean!
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-21 01:49:50 UTC (rev 639)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2008-12-21 01:50:49 UTC (rev 640)
@@ -33,6 +33,7 @@
import static org.jboss.webbeans.servlet.Servlet.SERVLET_REQUEST_LISTENER_CLASS;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Arrays;
@@ -40,6 +41,7 @@
import java.util.Set;
import javax.webbeans.DefinitionException;
+import javax.webbeans.Initializer;
import javax.webbeans.Observable;
import javax.webbeans.Observer;
import javax.webbeans.Observes;
@@ -348,7 +350,32 @@
*/
protected static boolean isTypeSimpleWebBean(Class<?> type)
{
- return !type.isAnnotation() && !Reflections.isAbstract(type) && !SERVLET_CLASS.isAssignableFrom(type) && !FILTER_CLASS.isAssignableFrom(type) && !SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(type) && !HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(type) && !SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(type) && !ENTERPRISE_BEAN_CLASS.isAssignableFrom(type) && !UICOMPONENT_CLASS.isAssignableFrom(type);
+ //TODO: check 3.2.1 for more rules!!!!!!
+ return !type.isAnnotation() &&
+ !Reflections.isAbstract(type) &&
+ !SERVLET_CLASS.isAssignableFrom(type) &&
+ !FILTER_CLASS.isAssignableFrom(type) &&
+ !SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(type) &&
+ !HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(type) &&
+ !SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(type) &&
+ !ENTERPRISE_BEAN_CLASS.isAssignableFrom(type) &&
+ !UICOMPONENT_CLASS.isAssignableFrom(type) &&
+ hasSimpleWebBeanConstructor(type);
}
+ private static boolean hasSimpleWebBeanConstructor(Class<?> type) {
+ try {
+ type.getDeclaredConstructor();
+ return true;
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ for (Constructor<?> c: type.getDeclaredConstructors())
+ {
+ if (c.isAnnotationPresent(Initializer.class)) return true;
+ }
+ return false;
+ }
+ }
+
}
16 years
[webbeans-commits] Webbeans SVN: r639 - doc/trunk/reference/en/modules.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-20 20:49:50 -0500 (Sat, 20 Dec 2008)
New Revision: 639
Modified:
doc/trunk/reference/en/modules/example.xml
Log:
fix example scope bug
Modified: doc/trunk/reference/en/modules/example.xml
===================================================================
--- doc/trunk/reference/en/modules/example.xml 2008-12-21 01:22:48 UTC (rev 638)
+++ doc/trunk/reference/en/modules/example.xml 2008-12-21 01:49:50 UTC (rev 639)
@@ -8,7 +8,7 @@
we'll define a Web Bean to hold the username and password entered during
login:</para>
-<programlisting role="JAVA"><![CDATA[@Named
+<programlisting role="JAVA"><![CDATA[@Named @RequestScoped
public class Credentials {
private String username;
@@ -69,7 +69,7 @@
return user!=null;
}
- @Produces @LoggedIn User getCurrentUser() {
+ @Produces @LoggedIn @Dependent User getCurrentUser() {
return user;
}
16 years
[webbeans-commits] Webbeans SVN: r638 - doc/trunk/reference/en/modules.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-20 20:22:48 -0500 (Sat, 20 Dec 2008)
New Revision: 638
Modified:
doc/trunk/reference/en/modules/example.xml
Log:
h:form
Modified: doc/trunk/reference/en/modules/example.xml
===================================================================
--- doc/trunk/reference/en/modules/example.xml 2008-12-21 01:09:41 UTC (rev 637)
+++ doc/trunk/reference/en/modules/example.xml 2008-12-21 01:22:48 UTC (rev 638)
@@ -24,7 +24,7 @@
<para>This Web Bean is bound to the login prompt in the following JSF form:</para>
-<programlisting role="JAVA"><![CDATA[<f:form>
+<programlisting role="JAVA"><![CDATA[<h:form>
<h:panelGrid columns="2" rendered="#{!login.loggedIn}">
<h:outputLabel for="username">Username:</h:outputLabel>
<h:inputText id="username" value="#{credentials.username}"/>
@@ -33,7 +33,7 @@
</h:panelGrid>
<h:commandButton value="Login" action="#{login.login}" rendered="#{!login.loggedIn}"/>
<h:commandButton value="Logout" acion="#{login.logout}" rendered="#{login.loggedIn}"/>
-</f:form>]]></programlisting>
+</h:form>]]></programlisting>
<para>The actual work is done by a session scoped Web Bean that maintains
information about the currently logged-in user and exposes the <literal>User</literal>
16 years
[webbeans-commits] Webbeans SVN: r636 - doc/trunk/reference/en/modules.
by webbeans-commits@lists.jboss.org
Author: gavin.king(a)jboss.com
Date: 2008-12-20 19:39:17 -0500 (Sat, 20 Dec 2008)
New Revision: 636
Modified:
doc/trunk/reference/en/modules/example.xml
Log:
minor
Modified: doc/trunk/reference/en/modules/example.xml
===================================================================
--- doc/trunk/reference/en/modules/example.xml 2008-12-21 00:09:06 UTC (rev 635)
+++ doc/trunk/reference/en/modules/example.xml 2008-12-21 00:39:17 UTC (rev 636)
@@ -33,7 +33,7 @@
</h:panelGrid>
<h:commandButton value="Login" action="#{login.login}" rendered="#{!login.loggedIn}"/>
<h:commandButton value="Logout" acion="#{login.logout}" rendered="#{login.loggedIn}"/>
-</f:form]]></programlisting>
+</f:form>]]></programlisting>
<para>The actual work is done by a session scoped Web Bean that maintains
information about the currently logged-in user and exposes the <literal>User</literal>
16 years