Author: christian.bauer(a)jboss.com
Date: 2009-10-12 13:28:37 -0400 (Mon, 12 Oct 2009)
New Revision: 11573
Modified:
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Webservices.xml
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/ApplicationComponentTestProvider.java
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/PlainTestProvider.java
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
Log:
JBSEAM-4247, removed support for Seam component JAX RS providers
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Webservices.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Webservices.xml 2009-10-12
14:20:59 UTC (rev 11572)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Webservices.xml 2009-10-12
17:28:37 UTC (rev 11573)
@@ -387,7 +387,7 @@
</sect2>
<sect2>
- <title>Resources and providers as Seam components</title>
+ <title>Resources as Seam components</title>
<para>
Any resource and provider instances are managed by RESTEasy by default. That
means a resource class
@@ -397,7 +397,7 @@
</para>
<para>
- You can write resources and providers as Seam components and benefit from the
richer lifecycle management
+ You can write resources as Seam components and benefit from the richer
lifecycle management
of Seam, and interception for bijection, security, and so on. Simply make
your resource class a
Seam component:
</para>
@@ -489,17 +489,21 @@
resources and paths is planned but currently not supported.
</para>
- <para>
- EJB Seam components are supported. Always annotate the local business
interface, not the EJB implementation
- class, with JAX-RS annotations. The EJB has to be
<literal>STATELESS</literal>.
- </para>
-
<para>
- Provider classes can also be Seam components, only
<literal>APPLICATION</literal>-scoped
- provider components are supported. You can annotate the bean interface or
implementation with JAX-RS annotations.
- EJB Seam components as providers are currently
<emphasis>NOT</emphasis> supported, only POJOs!
+ EJB Seam components are supported as REST resources. Always annotate the
local business interface, not
+ the EJB implementation class, with JAX-RS annotations. The EJB has to be
<literal>STATELESS</literal>.
</para>
+ <note>
+ <para>
+ Provider classes can currently not be Seam components. Although you can
configure an
+ <literal>@Provider</literal> annotated class as a Seam
component, it will at runtime be managed
+ by RESTEasy as a singleton with no Seam interception, bijection, etc. The
instance will not be
+ a Seam component instance. We plan to support Seam component lifecycle
for JAX-RS providers in
+ the future.
+ </para>
+ </note>
+
</sect2>
<sect2>
Modified:
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/ApplicationComponentTestProvider.java
===================================================================
---
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/ApplicationComponentTestProvider.java 2009-10-12
14:20:59 UTC (rev 11572)
+++
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/ApplicationComponentTestProvider.java 2009-10-12
17:28:37 UTC (rev 11573)
@@ -27,8 +27,9 @@
public class ApplicationComponentTestProvider implements MessageBodyWriter
{
+ // TODO: Retracted support for Seam component providers, injection shouldn't
happen, see
https://jira.jboss.org/jira/browse/JBSEAM-4247
@In
- TestComponent testComponent;
+ TestComponent testComponent = new TestComponent();
public boolean isWriteable(Class aClass, Type type, Annotation[] annotations,
MediaType mediaType)
{
Modified:
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/PlainTestProvider.java
===================================================================
---
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/PlainTestProvider.java 2009-10-12
14:20:59 UTC (rev 11572)
+++
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/resteasy/provider/PlainTestProvider.java 2009-10-12
17:28:37 UTC (rev 11573)
@@ -34,17 +34,17 @@
MultivaluedMap httpHeaders, OutputStream outputStream) throws
IOException, WebApplicationException
{
List<String[]> lines = (List<String[]>) o;
- StringBuilder cvs = new StringBuilder();
+ StringBuilder csv = new StringBuilder();
for (String[] line : lines)
{
for (String field : line)
{
- cvs.append(field).append(",");
+ csv.append(field).append(",");
}
- cvs.deleteCharAt(cvs.length() - 1);
- cvs.append("\r\n");
+ csv.deleteCharAt(csv.length() - 1);
+ csv.append("\r\n");
}
- outputStream.write(cvs.toString().getBytes());
+ outputStream.write(csv.toString().getBytes());
}
}
Modified:
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java
===================================================================
---
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2009-10-12
14:20:59 UTC (rev 11572)
+++
branches/community/Seam_2_2/examples/restbay/src/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2009-10-12
17:28:37 UTC (rev 11573)
@@ -399,8 +399,9 @@
assert response.getStatus() == 200;
assert response.getContentAsString().equals("abc,1,2,3");
}
+ };
+ // }.run();
+ // TODO: Retracted support for Seam component providers, injection shouldn't
happen, see
https://jira.jboss.org/jira/browse/JBSEAM-4247
- }.run();
-
}
}
Modified:
branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
===================================================================
---
branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java 2009-10-12
14:20:59 UTC (rev 11572)
+++
branches/community/Seam_2_2/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java 2009-10-12
17:28:37 UTC (rev 11573)
@@ -215,6 +215,7 @@
Set<Class> handledProviders = new HashSet(); // Stuff we don't want to
examine twice
+ /* TODO: Retracted due to missing RESTEasy SPI for external provider metadata, see
https://jira.jboss.org/jira/browse/JBSEAM-4247
for (Component seamComponent : seamComponents)
{
// The component can have one (not many) @Provider annotated business interface
@@ -266,6 +267,7 @@
handledProviders.add(seamComponent.getBeanClass());
handledProviders.addAll(seamComponent.getBusinessInterfaces());
}
+ */
for (Class<?> providerClass : providerClasses)
{