Seam SVN: r8460 - trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-14 10:53:03 -0400 (Mon, 14 Jul 2008)
New Revision: 8460
Modified:
trunk/build.xml
Log:
Clean up embedded jboss tmp dirs as part of clean
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-07-14 13:26:45 UTC (rev 8459)
+++ trunk/build.xml 2008-07-14 14:53:03 UTC (rev 8460)
@@ -150,6 +150,8 @@
<delete dir="${test.dir}" quiet="${quietclean}" />
<delete dir="${report.dir}" quiet="${quietclean}" />
<delete dir="${coverage.dir}" quiet="${quietclean}" />
+ <delete dir="${bootstrap.dir}/tmp" quiet="${quietclean}" />
+ <delete dir="${bootstrap.dir}/data" quiet="${quietclean}" />
<delete dir="${ui.dir}/target" quiet="${quietclean}"/>
<cleanexample name="integration" path="${seam.dir}/src/test/integration" message="" />
</target>
15 years, 11 months
Seam SVN: r8459 - trunk/examples/mail/src/org/jboss/seam/example/mail/test.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-14 09:26:45 -0400 (Mon, 14 Jul 2008)
New Revision: 8459
Modified:
trunk/examples/mail/src/org/jboss/seam/example/mail/test/MailTest.java
trunk/examples/mail/src/org/jboss/seam/example/mail/test/sanitization.xhtml
Log:
Fix mail tests
Modified: trunk/examples/mail/src/org/jboss/seam/example/mail/test/MailTest.java
===================================================================
--- trunk/examples/mail/src/org/jboss/seam/example/mail/test/MailTest.java 2008-07-14 12:42:05 UTC (rev 8458)
+++ trunk/examples/mail/src/org/jboss/seam/example/mail/test/MailTest.java 2008-07-14 13:26:45 UTC (rev 8459)
@@ -554,7 +554,7 @@
{
Contexts.getEventContext().set("name", "Pete\nMuir");
MimeMessage renderedMessage = getRenderedMailMessage("/org/jboss/seam/example/mail/test/sanitization.xhtml");
- assert "Try out".equals(renderedMessage.getSubject());
+ assert "Try out Seam!".equals(renderedMessage.getSubject());
InternetAddress to = (InternetAddress) renderedMessage.getAllRecipients()[0];
assert to.getAddress().equals("peter(a)email.tld");
assert to.getPersonal().equals("Pete");
@@ -565,7 +565,7 @@
assert from.getPersonal().equals("Pete");
assert renderedMessage.getHeader("Pete") != null;
assert renderedMessage.getHeader("Pete").length == 1;
- assert "roll".equals(renderedMessage.getHeader("Pete")[0]);
+ assert "roll over".equals(renderedMessage.getHeader("Pete")[0]);
}
}.run();
}
Modified: trunk/examples/mail/src/org/jboss/seam/example/mail/test/sanitization.xhtml
===================================================================
--- trunk/examples/mail/src/org/jboss/seam/example/mail/test/sanitization.xhtml 2008-07-14 12:42:05 UTC (rev 8458)
+++ trunk/examples/mail/src/org/jboss/seam/example/mail/test/sanitization.xhtml 2008-07-14 13:26:45 UTC (rev 8459)
@@ -3,9 +3,9 @@
xmlns:h="http://java.sun.com/jsf/html">
<m:from name="#{name}">peter(a)example.com
- foo</m:from>
+foo</m:from>
<m:to name="#{name}">peter(a)email.tld
- bar</m:to>
+bar</m:to>
<m:subject>Try out
Seam!</m:subject>
<m:header name="#{name}">roll
15 years, 11 months
Seam SVN: r8458 - in trunk: src/resteasy/org/jboss/seam/resteasy and 1 other directory.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-07-14 08:42:05 -0400 (Mon, 14 Jul 2008)
New Revision: 8458
Added:
trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java
trunk/src/resteasy/org/jboss/seam/resteasy/package-info.java
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Webservices.xml
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd
Log:
Implemented RESTEasy integration XSD, cleanup
Modified: trunk/doc/Seam_Reference_Guide/en-US/Webservices.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Webservices.xml 2008-07-14 11:30:32 UTC (rev 8457)
+++ trunk/doc/Seam_Reference_Guide/en-US/Webservices.xml 2008-07-14 12:42:05 UTC (rev 8458)
@@ -118,18 +118,18 @@
<sect1>
<title>An example web service</title>
-
+
<para>
Let's walk through an example web service. The code in this section all comes from the seamBay example
application in Seam's <literal>/examples</literal> directory, and follows the recommended strategy as
- described in the previous section. Let's first take a look at the web service class and one of its web
+ described in the previous section. Let's first take a look at the web service class and one of its web
service methods:
</para>
-
+
<programlisting role="JAVA"><![CDATA[@Stateless
@WebService(name = "AuctionService", serviceName = "AuctionService")
public class AuctionService implements AuctionServiceRemote
-{
+{
@WebMethod
public boolean login(String username, String password)
{
@@ -138,7 +138,7 @@
Identity.instance().login();
return Identity.instance().isLoggedIn();
}
-
+
// snip
}]]></programlisting>
@@ -198,5 +198,70 @@
</sect1>
+ <sect1>
+ <title>RESTful HTTP webservices with RESTEasy</title>
+ <para>
+ Seam integrates the RESTEasy implementation of the JAX-RS specification (JSR 311). You can decided how
+ "deep" the integration into your Seam application is going to be: From simple integration of configuration
+ and bootstrap, serving the requests with the built-in Seam resource servlet, writing resources as
+ Seam components, and integration with conversations and the Seam CRUD Application Framework.
+ </para>
+
+ <sect2>
+ <title>RESTEasy bootstrap and request handling</title>
+
+ <para>
+ First, get the RESTEasy libraries and the <literal>jaxrs-api.jar</literal>, deploy it with the
+ other libraries of your application. Also deploy the integration library, <tt>jboss-seam-resteasy.jar</tt>
+ </para>
+
+ <para>
+ On startup, all classes annotated <literal>@javax.ws.rs.Path</literal> will be discovered automatically
+ and registered as HTTP resources. Seam will serve any HTTP request automatically under the URL basepath
+ you mapped the <literal>SeamResourceServlet</literal> at in <tt>web.xml</tt>. Most of the time and if you
+ follow this documentation, this would be <literal>/seam/resource</literal>.
+ The hardcoded full path of your RESTful resources is therefore <literal>/seam/resource/rest</literal>.
+ </para>
+
+ <para>
+ The following resource would serve a representation under
+ <literal>http://your.hostname/seam/resource/reset/item/123</literal>:
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[@Path("/item")
+public class ItemResource {
+
+ @GET
+ @Path("/item/{itemId}")
+ @ProduceMime("text/plain")
+ public String getItem(@PathParam("itemId") int itemId) {
+ return ...;
+ }
+}]]></programlisting>
+
+ <para>
+ TODO: This is not true, today you need @Path("/seam/resource/rest/item") on the resource class, we need
+ to implement some base-path mapping there.
+ </para>
+
+ <para>
+ You can configure the <literal>/seam/resource</literal> part by specifying a new mapping in web.xml
+ for the <tt>SeamResourceServlet</tt>. Note that this also changes the URI path for all other resources
+ you want to serve with this servlet! You can not change the <literal>/rest</literal> segement of the path,
+ unless you subclass and override the <literal>ResteasyResourceAdapter.getResourcePath()</literal> method.
+ </para>
+
+ <para>
+ TODO: TBC...
+ </para>
+
+ </sect2>
+
+<!--
+ <programlisting role="JAVA"><![CDATA[
+]]></programlisting>
+-->
+ </sect1>
+
</chapter>
Copied: trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java (from rev 8455, trunk/src/resteasy/org/jboss/seam/resteasy/RestApplicationConfig.java)
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ApplicationConfig.java 2008-07-14 12:42:05 UTC (rev 8458)
@@ -0,0 +1,159 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Install;
+
+import javax.ws.rs.core.MediaType;
+import java.util.*;
+
+/**
+ * Resteasy and JAX-RS configuration, override in components.xml to
+ * customize Resteasy settings.
+ *
+ * @author Christian Bauer
+ */
+@Name("org.jboss.seam.resteasy.applicationConfig")
+(a)Scope(ScopeType.APPLICATION)
+@Install(precedence = Install.BUILT_IN)
+@AutoCreate
+public class ApplicationConfig extends javax.ws.rs.core.ApplicationConfig
+{
+
+ private Map<Class<?>, Component> providerClasses = new HashMap<Class<?>, Component>();
+ private Map<Class<?>, Component> resourceClasses = new HashMap<Class<?>, Component>();
+
+ private List<String> providerClassNames = new ArrayList<String>();
+ private List<String> resourceClassNames = new ArrayList<String>();
+
+ private Map<String, String> mediaTypeMappings = new HashMap<String, String>();
+ private Map<String, String> languageMappings = new HashMap<String, String>();
+
+ private boolean scanProviders = true;
+ private boolean scanResources = true;
+ private boolean useBuiltinProviders = true;
+
+ public ApplicationConfig()
+ {
+ super();
+ }
+
+ public Set<Class<?>> getProviderClasses()
+ {
+ return providerClasses.keySet();
+ }
+
+ public Set<Class<?>> getResourceClasses()
+ {
+ return resourceClasses.keySet();
+ }
+
+ public void addProviderClass(Class<?> clazz, Component component)
+ {
+ providerClasses.put(clazz, component);
+ }
+
+ public void removeProviderClass(Class<?> clazz)
+ {
+ providerClasses.remove(clazz);
+ }
+
+ public void addResourceClass(Class<?> clazz, Component component)
+ {
+ resourceClasses.put(clazz, component);
+ }
+
+ public void removeResourceClass(Class<?> clazz)
+ {
+ resourceClasses.remove(clazz);
+ }
+
+ public Component getProviderClassComponent(Class clazz)
+ {
+ return providerClasses.get(clazz) != null ? providerClasses.get(clazz) : null;
+ }
+
+ public Component getResourceClassComponent(Class clazz)
+ {
+ return resourceClasses.get(clazz) != null ? resourceClasses.get(clazz) : null;
+ }
+
+ public Map<String, MediaType> getMediaTypeMappings()
+ {
+ Map<String, MediaType> extMap = new HashMap<String, MediaType>();
+ for (String ext : mediaTypeMappings.keySet())
+ {
+ String value = mediaTypeMappings.get(ext);
+ extMap.put(ext, MediaType.valueOf(value));
+ }
+ return extMap;
+ }
+
+ public void setMediaTypeMappings(Map<String, String> mediaTypeMappings)
+ {
+ this.mediaTypeMappings = mediaTypeMappings;
+ }
+
+ public Map<String, String> getLanguageMappings()
+ {
+ return languageMappings;
+ }
+
+ public void setLanguageMappings(Map<String, String> languageMappings)
+ {
+ this.languageMappings = languageMappings;
+ }
+
+ public List<String> getProviderClassNames()
+ {
+ return providerClassNames;
+ }
+
+ public void setProviderClassNames(List<String> providerClassNames)
+ {
+ this.providerClassNames = providerClassNames;
+ }
+
+ public List<String> getResourceClassNames()
+ {
+ return resourceClassNames;
+ }
+
+ public void setResourceClassNames(List<String> resourceClassNames)
+ {
+ this.resourceClassNames = resourceClassNames;
+ }
+
+ public boolean isScanProviders()
+ {
+ return scanProviders;
+ }
+
+ public void setScanProviders(boolean scanProviders)
+ {
+ this.scanProviders = scanProviders;
+ }
+
+ public boolean isScanResources()
+ {
+ return scanResources;
+ }
+
+ public void setScanResources(boolean scanResources)
+ {
+ this.scanResources = scanResources;
+ }
+
+ public boolean isUseBuiltinProviders()
+ {
+ return useBuiltinProviders;
+ }
+
+ public void setUseBuiltinProviders(boolean useBuiltinProviders)
+ {
+ this.useBuiltinProviders = useBuiltinProviders;
+ }
+}
Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java 2008-07-14 11:30:32 UTC (rev 8457)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java 2008-07-14 12:42:05 UTC (rev 8458)
@@ -14,8 +14,9 @@
import java.util.Map;
import java.util.HashMap;
-
/**
+ * Scans annoated JAX-RS resources and providers, optionally registers them as Seam components.
+ *
* @author Christian Bauer
*/
@Name("org.jboss.seam.resteasy.bootstrap")
@@ -23,26 +24,29 @@
@Startup
@AutoCreate
@Install(classDependencies = "org.resteasy.Dispatcher")
-public class ResteasyBootstrap {
+public class ResteasyBootstrap
+{
@Logger
Log log;
@In
- protected RestApplicationConfig restApplicationConfig;
+ protected ApplicationConfig applicationConfig;
@Create
- public void onStartup() {
+ public void onStartup()
+ {
log.info("deploying Resteasy providers and resources");
Collection<Class<java.lang.Object>> annotatedProviderClasses = null;
Collection<Class<java.lang.Object>> annotatedResourceClasses = null;
- if (restApplicationConfig.isScanForProviderClasses() || restApplicationConfig.isScanForResourceClasses()) {
+ if (applicationConfig.isScanProviders() || applicationConfig.isScanResources())
+ {
log.debug("scanning all classes for JAX-RS annotations");
DeploymentStrategy deployment = (DeploymentStrategy) Component.getInstance("deploymentStrategy");
AnnotationDeploymentHandler handler =
- (AnnotationDeploymentHandler)deployment.getDeploymentHandlers().get(AnnotationDeploymentHandler.NAME);
+ (AnnotationDeploymentHandler) deployment.getDeploymentHandlers().get(AnnotationDeploymentHandler.NAME);
annotatedProviderClasses = handler.getClasses().get(javax.ws.rs.ext.Provider.class.getName());
annotatedResourceClasses = handler.getClasses().get(javax.ws.rs.Path.class.getName());
@@ -51,10 +55,12 @@
log.debug("finding all Seam component classes");
Map<Class, Component> seamComponents = new HashMap<Class, Component>();
String[] applicationContextNames = Contexts.getApplicationContext().getNames();
- for (String applicationContextName : applicationContextNames) {
- if (applicationContextName.endsWith(".component")) {
+ for (String applicationContextName : applicationContextNames)
+ {
+ if (applicationContextName.endsWith(".component"))
+ {
Component seamComponent =
- (Component)Component.getInstance(applicationContextName, ScopeType.APPLICATION);
+ (Component) Component.getInstance(applicationContextName, ScopeType.APPLICATION);
// TODO: This should consider EJB components/annotations on interfaces somehow?
seamComponents.put(seamComponent.getBeanClass(), seamComponent);
}
@@ -65,73 +71,92 @@
}
// Load all provider classes, either scanned or through explicit configuration
- protected void registerProviders(Map<Class, Component> seamComponents, Collection annotatedProviderClasses) {
+ protected void registerProviders(Map<Class, Component> seamComponents, Collection annotatedProviderClasses)
+ {
Collection<Class> providerClasses = new HashSet<Class>();
- try {
- if (restApplicationConfig.isScanForProviderClasses() && annotatedProviderClasses != null)
+ try
+ {
+ if (applicationConfig.isScanProviders() && annotatedProviderClasses != null)
providerClasses.addAll(annotatedProviderClasses);
- for (String s : new HashSet<String>(restApplicationConfig.getProviderClassNames()))
+ for (String s : new HashSet<String>(applicationConfig.getProviderClassNames()))
providerClasses.add(Reflections.classForName(s));
- } catch (ClassNotFoundException ex) {
+ }
+ catch (ClassNotFoundException ex)
+ {
log.error("error loading JAX-RS provider class: " + ex.getMessage());
}
- for (Class providerClass : providerClasses) {
+ for (Class providerClass : providerClasses)
+ {
// Ignore built-in providers, we register them manually later
if (providerClass.getName().startsWith("org.resteasy.plugins.providers")) continue;
Component seamComponent = null;
// Check if this is also a Seam component bean class
- if (seamComponents.containsKey(providerClass)) {
+ if (seamComponents.containsKey(providerClass))
+ {
seamComponent = seamComponents.get(providerClass);
// Needs to be APPLICATION or STATELESS
if (!seamComponent.getScope().equals(ScopeType.APPLICATION) &&
- !seamComponent.getScope().equals(ScopeType.STATELESS)) {
+ !seamComponent.getScope().equals(ScopeType.STATELESS))
+ {
log.warn("not registering as provider Seam component, must be APPLICATION or STATELESS scoped: "
- + seamComponent.getName());
+ + seamComponent.getName());
seamComponent = null;
}
}
- if (seamComponent != null) {
+ if (seamComponent != null)
+ {
log.debug("registering provider Seam component: " + seamComponent.getName());
- } else {
+ }
+ else
+ {
log.debug("registering provider class: " + providerClass.getName());
}
- restApplicationConfig.addProviderClass(providerClass, seamComponent);
+ applicationConfig.addProviderClass(providerClass, seamComponent);
}
- if (restApplicationConfig.getProviderClasses().size() == 0 &&
- !restApplicationConfig.isUseBuiltinProviders()) {
+ if (applicationConfig.getProviderClasses().size() == 0 &&
+ !applicationConfig.isUseBuiltinProviders())
+ {
log.info("no RESTEasy provider classes registered");
}
}
// Load all resource classes, either scanned or through explicit configuration
- protected void registerResources(Map<Class, Component> seamComponents, Collection annotatedResourceClasses) {
+ protected void registerResources(Map<Class, Component> seamComponents, Collection annotatedResourceClasses)
+ {
Collection<Class> resourceClasses = new HashSet<Class>();
- try {
- if (restApplicationConfig.isScanForResourceClasses() && annotatedResourceClasses != null)
+ try
+ {
+ if (applicationConfig.isScanResources() && annotatedResourceClasses != null)
resourceClasses.addAll(annotatedResourceClasses);
- for (String s : new HashSet<String>(restApplicationConfig.getResourceClassNames()))
+ for (String s : new HashSet<String>(applicationConfig.getResourceClassNames()))
resourceClasses.add(Reflections.classForName(s));
- } catch (ClassNotFoundException ex) {
+ }
+ catch (ClassNotFoundException ex)
+ {
log.error("error loading JAX-RS resource class: " + ex.getMessage());
}
- for (Class<Object> resourceClass : resourceClasses) {
+ for (Class<Object> resourceClass : resourceClasses)
+ {
Component seamComponent = null;
// Check if this is also a Seam component bean class
- if (seamComponents.containsKey(resourceClass)) {
+ if (seamComponents.containsKey(resourceClass))
+ {
seamComponent = seamComponents.get(resourceClass);
log.debug("registering resource Seam component: " + seamComponent.getName());
- } else {
+ }
+ else
+ {
log.debug("registering resource class with JAX-RS default lifecycle: " + resourceClass.getName());
}
- restApplicationConfig.addResourceClass(resourceClass, seamComponent);
+ applicationConfig.addResourceClass(resourceClass, seamComponent);
}
- if (restApplicationConfig.getResourceClasses().size() == 0)
+ if (applicationConfig.getResourceClasses().size() == 0)
log.info("no JAX-RS resource classes registered");
}
Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java 2008-07-14 11:30:32 UTC (rev 8457)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java 2008-07-14 12:42:05 UTC (rev 8458)
@@ -11,6 +11,10 @@
import org.resteasy.spi.*;
/**
+ * An extended version of the RESTEasy dispatcher, configured on Seam application
+ * startup with a custom ApplicationConfig instance. Registers custom resource
+ * and provider lifecycle handlers.
+ *
* @author Christian Bauer
*/
@Name("org.jboss.seam.resteasy.dispatcher")
@@ -18,77 +22,100 @@
@Startup(depends = "resteasyBootstrap")
@AutoCreate
@Install(classDependencies = "org.resteasy.Dispatcher")
-public class ResteasyDispatcher extends HttpServletDispatcher {
+public class ResteasyDispatcher extends HttpServletDispatcher
+{
@In
- RestApplicationConfig restApplicationConfig;
+ ApplicationConfig applicationConfig;
@Logger
Log log;
@Create
- public void onStartup() {
- log.info("registering RESTEasy resources and providers");
+ public void onStartup()
+ {
+ log.debug("assigning registered RESTEasy resources and providers");
ResteasyProviderFactory providerFactory = new ResteasyProviderFactory();
ResteasyProviderFactory.setInstance(providerFactory); // This is really necessary
setDispatcher(new Dispatcher(providerFactory));
- getDispatcher().setLanguageMappings(restApplicationConfig.getLanguageMappings());
- getDispatcher().setMediaTypeMappings(restApplicationConfig.getMediaTypeMappings());
+ getDispatcher().setLanguageMappings(applicationConfig.getLanguageMappings());
+ getDispatcher().setMediaTypeMappings(applicationConfig.getMediaTypeMappings());
// Resource registration
Registry registry = getDispatcher().getRegistry();
- for (final Class resourceClass : restApplicationConfig.getResourceClasses()) {
- final Component seamComponent = restApplicationConfig.getResourceClassComponent(resourceClass);
- if (seamComponent != null) {
+ for (final Class resourceClass : applicationConfig.getResourceClasses())
+ {
+ final Component seamComponent = applicationConfig.getResourceClassComponent(resourceClass);
+ if (seamComponent != null)
+ {
// Seam component lookup when call is dispatched to resource
registry.addResourceFactory(
- new ResourceFactory() {
+ new ResourceFactory()
+ {
- private PropertyInjector propertyInjector;
+ private PropertyInjector propertyInjector;
- public Class<?> getScannableClass() {
- return resourceClass;
- }
+ public Class<?> getScannableClass()
+ {
+ return resourceClass;
+ }
- public void registered(InjectorFactory factory) {
- this.propertyInjector = factory.createPropertyInjector(getScannableClass());
- }
+ public void registered(InjectorFactory factory)
+ {
+ this.propertyInjector = factory.createPropertyInjector(getScannableClass());
+ }
- public Object createResource(HttpRequest request, HttpResponse response, InjectorFactory factory) {
- Object target = Component.getInstance(seamComponent.getName());
- propertyInjector.inject(request, response, target);
- return target;
+ public Object createResource(HttpRequest request, HttpResponse response, InjectorFactory factory)
+ {
+ Object target = Component.getInstance(seamComponent.getName());
+ propertyInjector.inject(request, response, target);
+ return target;
+ }
+
+ public void requestFinished(HttpRequest request, HttpResponse response, Object resource)
+ {
+ }
+
+ public void unregistered()
+ {
+ }
}
-
- public void requestFinished(HttpRequest request, HttpResponse response, Object resource) {}
- public void unregistered() {}
- }
);
- } else {
+ }
+ else
+ {
// JAX-RS default lifecycle
registry.addResourceFactory(new POJOResourceFactory(resourceClass));
}
}
// Provider registration
- if (restApplicationConfig.isUseBuiltinProviders()) {
+ if (applicationConfig.isUseBuiltinProviders())
+ {
log.info("registering built-in RESTEasy providers");
RegisterBuiltin.register(providerFactory);
}
- for (Class providerClass : restApplicationConfig.getProviderClasses()) {
- Component seamComponent = restApplicationConfig.getProviderClassComponent(providerClass);
- if (seamComponent != null) {
- if (ScopeType.STATELESS.equals(seamComponent.getScope())) {
+ for (Class providerClass : applicationConfig.getProviderClasses())
+ {
+ Component seamComponent = applicationConfig.getProviderClassComponent(providerClass);
+ if (seamComponent != null)
+ {
+ if (ScopeType.STATELESS.equals(seamComponent.getScope()))
+ {
throw new RuntimeException(
- "Registration of STATELESS Seam components as RESTEasy providers not implemented!"
+ "Registration of STATELESS Seam components as RESTEasy providers not implemented!"
);
- } else if (ScopeType.APPLICATION.equals(seamComponent.getScope())) {
+ }
+ else if (ScopeType.APPLICATION.equals(seamComponent.getScope()))
+ {
Object providerInstance = Component.getInstance(seamComponent.getName());
providerFactory.registerProviderInstance(providerInstance);
}
- } else {
+ }
+ else
+ {
// Just plain RESTEasy, no Seam component lookup or lifecycle
providerFactory.registerProvider(providerClass);
}
Modified: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2008-07-14 11:30:32 UTC (rev 8457)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2008-07-14 12:42:05 UTC (rev 8458)
@@ -27,37 +27,45 @@
@Scope(ScopeType.APPLICATION)
@Name("org.jboss.seam.resteasy.resourceAdapter")
@BypassInterceptors
-public class ResteasyResourceAdapter extends AbstractResource {
+public class ResteasyResourceAdapter extends AbstractResource
+{
public static final String RESTEASY_RESOURCE_BASEPATH = "/rest";
@Override
- public String getResourcePath() {
+ public String getResourcePath()
+ {
return RESTEASY_RESOURCE_BASEPATH;
}
@Override
public void getResource(final HttpServletRequest request, final HttpServletResponse response)
- throws ServletException, IOException {
+ throws ServletException, IOException
+ {
// Wrap this in Seam contexts
- new ContextualHttpServletRequest(request) {
+ new ContextualHttpServletRequest(request)
+ {
@Override
- public void process() throws ServletException, IOException {
+ public void process() throws ServletException, IOException
+ {
ResteasyDispatcher dispatcher =
- (ResteasyDispatcher)Component.getInstance(ResteasyDispatcher.class);
- if (dispatcher == null) {
+ (ResteasyDispatcher) Component.getInstance(ResteasyDispatcher.class);
+ if (dispatcher == null)
+ {
throw new IllegalStateException("RESTEasy is not installed, check your classpath");
}
dispatcher.invoke(
- new HttpServletRequestWrapper(request) {
- // TODO: Strip out the /seam/resource/rest stuff
- public String getPathInfo() {
- return super.getPathInfo();
- }
- },
- response
+ new HttpServletRequestWrapper(request)
+ {
+ // TODO: Strip out the /seam/resource/rest stuff
+ public String getPathInfo()
+ {
+ return super.getPathInfo();
+ }
+ },
+ response
);
}
}.run();
Added: trunk/src/resteasy/org/jboss/seam/resteasy/package-info.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/package-info.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/package-info.java 2008-07-14 12:42:05 UTC (rev 8458)
@@ -0,0 +1,4 @@
+@Namespace("http://jboss.com/products/seam/resteasy")
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.annotations.Namespace;
\ No newline at end of file
Modified: trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd 2008-07-14 11:30:32 UTC (rev 8457)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd 2008-07-14 12:42:05 UTC (rev 8458)
@@ -1,12 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- targetNamespace="http://jboss.com/products/seam/resteasy"
- xmlns:pdf="http://jboss.com/products/seam/resteasy"
- xmlns:components="http://jboss.com/products/seam/components"
- attributeFormDefault="unqualified">
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/resteasy" xmlns:resteasy="http://jboss.com/products/seam/resteasy"
+ xmlns:components="http://jboss.com/products/seam/components" attributeFormDefault="unqualified">
+
<xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.1.xsd"/>
- <!-- TODO -->
+ <xs:element name="application-config">
+ <xs:annotation>
+ <xs:documentation>
+ An implementation of JAX-RS ApplicationConfig with additional properties for RESTEasy.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="1"
+ name="provider-class-names" type="components:multiValuedProperty">
+ <xs:annotation>
+ <xs:documentation>
+ List of provider classes.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" maxOccurs="1"
+ name="resource-class-names" type="components:multiValuedProperty">
+ <xs:annotation>
+ <xs:documentation>
+ List of resource classes.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attributeGroup ref="components:attlist.component"/>
+ <xs:attributeGroup ref="pdf:attlist.application-config"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:attributeGroup name="attlist.application-config">
+ <xs:attribute name="scan-providers" type="components:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Enable automatic discovery of classes annoated with JAX-RS @Provider, defaults to 'true'.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="scan-resources" type="components:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Enable automatic discovery of classes annoated with JAX-RS @Path, defaults to 'true'.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="use-builtin-providers" type="components:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Enable RESTEasy built-in providers, defaults to 'true'.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:attributeGroup>
+
</xs:schema>
15 years, 11 months
Seam SVN: r8457 - branches/Seam_2_0_FP/bootstrap/deploy/messaging.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-07-14 07:30:32 -0400 (Mon, 14 Jul 2008)
New Revision: 8457
Modified:
branches/Seam_2_0_FP/bootstrap/deploy/messaging/remoting-service.xml
Log:
SEAMFP-12 backport r8448
Modified: branches/Seam_2_0_FP/bootstrap/deploy/messaging/remoting-service.xml
===================================================================
--- branches/Seam_2_0_FP/bootstrap/deploy/messaging/remoting-service.xml 2008-07-14 11:28:31 UTC (rev 8456)
+++ branches/Seam_2_0_FP/bootstrap/deploy/messaging/remoting-service.xml 2008-07-14 11:30:32 UTC (rev 8457)
@@ -26,7 +26,7 @@
<attribute name="socket.check_connection" isParam="true">false</attribute>
<attribute name="timeout" isParam="true">0</attribute>
<attribute name="serverBindAddress">${jboss.bind.address}</attribute>
- <attribute name="serverBindPort">4457</attribute>
+ <attribute name="serverBindPort">4458</attribute>
<attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
<attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
<attribute name="numberOfCallRetries" isParam="true">1</attribute>
15 years, 11 months
Seam SVN: r8456 - trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-14 07:28:31 -0400 (Mon, 14 Jul 2008)
New Revision: 8456
Modified:
trunk/build.xml
Log:
oops
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-07-14 11:06:23 UTC (rev 8455)
+++ trunk/build.xml 2008-07-14 11:28:31 UTC (rev 8456)
@@ -994,7 +994,7 @@
<propertyref name="debug.pom" />
<propertyref name="wicket.pom" />
<propertyref name="jbas5.pom" />
- <propertyref name="resteasy.pokm" />
+ <propertyref name="resteasy.pom" />
<propertyref name="testng.jvmargs"/>
</propertyset>
</ant>
15 years, 11 months
Seam SVN: r8455 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-14 07:06:23 -0400 (Mon, 14 Jul 2008)
New Revision: 8455
Modified:
trunk/build/resteasy.pom.xml
trunk/build/root.pom.xml
Log:
resteasy dependencies
Modified: trunk/build/resteasy.pom.xml
===================================================================
--- trunk/build/resteasy.pom.xml 2008-07-14 11:05:32 UTC (rev 8454)
+++ trunk/build/resteasy.pom.xml 2008-07-14 11:06:23 UTC (rev 8455)
@@ -21,6 +21,17 @@
<type>ejb</type>
</dependency>
+ <dependency>
+ <groupId>org.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
</dependencies>
</project>
\ No newline at end of file
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-07-14 11:05:32 UTC (rev 8454)
+++ trunk/build/root.pom.xml 2008-07-14 11:06:23 UTC (rev 8455)
@@ -246,6 +246,18 @@
<artifactId>jgroups</artifactId>
<version>2.4.1</version>
</dependency>
+
+ <dependency>
+ <groupId>org.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ <version>1.0-beta-5</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
15 years, 11 months
Seam SVN: r8454 - trunk/build.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-14 07:05:32 -0400 (Mon, 14 Jul 2008)
New Revision: 8454
Modified:
trunk/build/remoting.pom.xml
Log:
WS
Modified: trunk/build/remoting.pom.xml
===================================================================
--- trunk/build/remoting.pom.xml 2008-07-14 10:39:57 UTC (rev 8453)
+++ trunk/build/remoting.pom.xml 2008-07-14 11:05:32 UTC (rev 8454)
@@ -41,7 +41,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
- <scope>provided</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
15 years, 11 months
Seam SVN: r8453 - in trunk/src/resteasy: META-INF and 4 other directories.
by seam-commits@lists.jboss.org
Author: christian.bauer(a)jboss.com
Date: 2008-07-14 06:39:57 -0400 (Mon, 14 Jul 2008)
New Revision: 8453
Added:
trunk/src/resteasy/META-INF/
trunk/src/resteasy/META-INF/seam-deployment.properties
trunk/src/resteasy/org/
trunk/src/resteasy/org/jboss/
trunk/src/resteasy/org/jboss/seam/
trunk/src/resteasy/org/jboss/seam/resteasy/
trunk/src/resteasy/org/jboss/seam/resteasy/RestApplicationConfig.java
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd
trunk/src/resteasy/seam.properties
Log:
First round of RESTEasy integration
Added: trunk/src/resteasy/META-INF/seam-deployment.properties
===================================================================
--- trunk/src/resteasy/META-INF/seam-deployment.properties (rev 0)
+++ trunk/src/resteasy/META-INF/seam-deployment.properties 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1 @@
+org.jboss.seam.deployment.annotationTypes=javax.ws.rs.ext.Provider:javax.ws.rs.Path
Added: trunk/src/resteasy/org/jboss/seam/resteasy/RestApplicationConfig.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/RestApplicationConfig.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/RestApplicationConfig.java 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1,134 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Install;
+
+import javax.ws.rs.core.MediaType;
+import java.util.*;
+
+/**
+ * Resteasy and JAX-RS configuration, override in components.xml to
+ * customize Resteasy settings.
+ *
+ * @author Christian Bauer
+ */
+@Name("org.jboss.seam.resteasy.restApplicationConfig")
+(a)Scope(ScopeType.APPLICATION)
+@Install(precedence= Install.BUILT_IN)
+@AutoCreate
+public class RestApplicationConfig extends javax.ws.rs.core.ApplicationConfig {
+
+ private Map<Class<?>, Component> providerClasses = new HashMap<Class<?>, Component>();
+ private Map<Class<?>, Component> resourceClasses = new HashMap<Class<?>, Component>();
+
+ private List<String> providerClassNames = new ArrayList<String>();
+ private List<String> resourceClassNames = new ArrayList<String>();
+
+ private Map<String,String> mediaTypeMappings = new HashMap<String,String>();
+ private Map<String,String> languageMappings = new HashMap<String,String>();
+
+ private boolean scanForProviderClasses = true;
+ private boolean scanForResourceClasses = true;
+ private boolean useBuiltinProviders = true;
+
+ public RestApplicationConfig() {
+ super();
+ }
+
+ public Set<Class<?>> getProviderClasses() {
+ return providerClasses.keySet();
+ }
+
+ public Set<Class<?>> getResourceClasses() {
+ return resourceClasses.keySet();
+ }
+
+ public void addProviderClass(Class<?> clazz, Component component) {
+ providerClasses.put(clazz, component);
+ }
+
+ public void removeProviderClass(Class<?> clazz) {
+ providerClasses.remove(clazz);
+ }
+
+ public void addResourceClass(Class<?> clazz, Component component) {
+ resourceClasses.put(clazz, component);
+ }
+
+ public void removeResourceClass(Class<?> clazz) {
+ resourceClasses.remove(clazz);
+ }
+
+ public Component getProviderClassComponent(Class clazz) {
+ return providerClasses.get(clazz) != null ? providerClasses.get(clazz) : null;
+ }
+
+ public Component getResourceClassComponent(Class clazz) {
+ return resourceClasses.get(clazz) != null ? resourceClasses.get(clazz) : null;
+ }
+
+ public Map<String, MediaType> getMediaTypeMappings() {
+ Map<String, MediaType> extMap = new HashMap<String, MediaType>();
+ for (String ext : mediaTypeMappings.keySet()) {
+ String value = mediaTypeMappings.get(ext);
+ extMap.put(ext, MediaType.valueOf(value));
+ }
+ return extMap;
+ }
+
+ public void setMediaTypeMappings(Map<String, String> mediaTypeMappings) {
+ this.mediaTypeMappings = mediaTypeMappings;
+ }
+
+ public Map<String, String> getLanguageMappings() {
+ return languageMappings;
+ }
+
+ public void setLanguageMappings(Map<String, String> languageMappings) {
+ this.languageMappings = languageMappings;
+ }
+
+ public List<String> getProviderClassNames() {
+ return providerClassNames;
+ }
+
+ public void setProviderClassNames(List<String> providerClassNames) {
+ this.providerClassNames = providerClassNames;
+ }
+
+ public List<String> getResourceClassNames() {
+ return resourceClassNames;
+ }
+
+ public void setResourceClassNames(List<String> resourceClassNames) {
+ this.resourceClassNames = resourceClassNames;
+ }
+
+ public boolean isScanForProviderClasses() {
+ return scanForProviderClasses;
+ }
+
+ public void setScanForProviderClasses(boolean scanForProviderClasses) {
+ this.scanForProviderClasses = scanForProviderClasses;
+ }
+
+ public boolean isScanForResourceClasses() {
+ return scanForResourceClasses;
+ }
+
+ public void setScanForResourceClasses(boolean scanForResourceClasses) {
+ this.scanForResourceClasses = scanForResourceClasses;
+ }
+
+ public boolean isUseBuiltinProviders() {
+ return useBuiltinProviders;
+ }
+
+ public void setUseBuiltinProviders(boolean useBuiltinProviders) {
+ this.useBuiltinProviders = useBuiltinProviders;
+ }
+}
Added: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyBootstrap.java 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1,138 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.deployment.AnnotationDeploymentHandler;
+import org.jboss.seam.deployment.DeploymentStrategy;
+import org.jboss.seam.annotations.*;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.util.Reflections;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
+
+
+/**
+ * @author Christian Bauer
+ */
+@Name("org.jboss.seam.resteasy.bootstrap")
+(a)Scope(ScopeType.APPLICATION)
+@Startup
+@AutoCreate
+@Install(classDependencies = "org.resteasy.Dispatcher")
+public class ResteasyBootstrap {
+
+ @Logger
+ Log log;
+
+ @In
+ protected RestApplicationConfig restApplicationConfig;
+
+ @Create
+ public void onStartup() {
+ log.info("deploying Resteasy providers and resources");
+
+ Collection<Class<java.lang.Object>> annotatedProviderClasses = null;
+ Collection<Class<java.lang.Object>> annotatedResourceClasses = null;
+ if (restApplicationConfig.isScanForProviderClasses() || restApplicationConfig.isScanForResourceClasses()) {
+ log.debug("scanning all classes for JAX-RS annotations");
+
+ DeploymentStrategy deployment = (DeploymentStrategy) Component.getInstance("deploymentStrategy");
+ AnnotationDeploymentHandler handler =
+ (AnnotationDeploymentHandler)deployment.getDeploymentHandlers().get(AnnotationDeploymentHandler.NAME);
+
+ annotatedProviderClasses = handler.getClasses().get(javax.ws.rs.ext.Provider.class.getName());
+ annotatedResourceClasses = handler.getClasses().get(javax.ws.rs.Path.class.getName());
+ }
+
+ log.debug("finding all Seam component classes");
+ Map<Class, Component> seamComponents = new HashMap<Class, Component>();
+ String[] applicationContextNames = Contexts.getApplicationContext().getNames();
+ for (String applicationContextName : applicationContextNames) {
+ if (applicationContextName.endsWith(".component")) {
+ Component seamComponent =
+ (Component)Component.getInstance(applicationContextName, ScopeType.APPLICATION);
+ // TODO: This should consider EJB components/annotations on interfaces somehow?
+ seamComponents.put(seamComponent.getBeanClass(), seamComponent);
+ }
+ }
+
+ registerProviders(seamComponents, annotatedProviderClasses);
+ registerResources(seamComponents, annotatedResourceClasses);
+ }
+
+ // Load all provider classes, either scanned or through explicit configuration
+ protected void registerProviders(Map<Class, Component> seamComponents, Collection annotatedProviderClasses) {
+ Collection<Class> providerClasses = new HashSet<Class>();
+ try {
+ if (restApplicationConfig.isScanForProviderClasses() && annotatedProviderClasses != null)
+ providerClasses.addAll(annotatedProviderClasses);
+
+ for (String s : new HashSet<String>(restApplicationConfig.getProviderClassNames()))
+ providerClasses.add(Reflections.classForName(s));
+
+ } catch (ClassNotFoundException ex) {
+ log.error("error loading JAX-RS provider class: " + ex.getMessage());
+ }
+ for (Class providerClass : providerClasses) {
+ // Ignore built-in providers, we register them manually later
+ if (providerClass.getName().startsWith("org.resteasy.plugins.providers")) continue;
+
+ Component seamComponent = null;
+ // Check if this is also a Seam component bean class
+ if (seamComponents.containsKey(providerClass)) {
+ seamComponent = seamComponents.get(providerClass);
+ // Needs to be APPLICATION or STATELESS
+ if (!seamComponent.getScope().equals(ScopeType.APPLICATION) &&
+ !seamComponent.getScope().equals(ScopeType.STATELESS)) {
+ log.warn("not registering as provider Seam component, must be APPLICATION or STATELESS scoped: "
+ + seamComponent.getName());
+ seamComponent = null;
+ }
+ }
+ if (seamComponent != null) {
+ log.debug("registering provider Seam component: " + seamComponent.getName());
+ } else {
+ log.debug("registering provider class: " + providerClass.getName());
+ }
+ restApplicationConfig.addProviderClass(providerClass, seamComponent);
+ }
+ if (restApplicationConfig.getProviderClasses().size() == 0 &&
+ !restApplicationConfig.isUseBuiltinProviders()) {
+ log.info("no RESTEasy provider classes registered");
+ }
+ }
+
+ // Load all resource classes, either scanned or through explicit configuration
+ protected void registerResources(Map<Class, Component> seamComponents, Collection annotatedResourceClasses) {
+ Collection<Class> resourceClasses = new HashSet<Class>();
+ try {
+ if (restApplicationConfig.isScanForResourceClasses() && annotatedResourceClasses != null)
+ resourceClasses.addAll(annotatedResourceClasses);
+
+ for (String s : new HashSet<String>(restApplicationConfig.getResourceClassNames()))
+ resourceClasses.add(Reflections.classForName(s));
+
+ } catch (ClassNotFoundException ex) {
+ log.error("error loading JAX-RS resource class: " + ex.getMessage());
+ }
+ for (Class<Object> resourceClass : resourceClasses) {
+
+ Component seamComponent = null;
+ // Check if this is also a Seam component bean class
+ if (seamComponents.containsKey(resourceClass)) {
+ seamComponent = seamComponents.get(resourceClass);
+ log.debug("registering resource Seam component: " + seamComponent.getName());
+ } else {
+ log.debug("registering resource class with JAX-RS default lifecycle: " + resourceClass.getName());
+ }
+ restApplicationConfig.addResourceClass(resourceClass, seamComponent);
+ }
+ if (restApplicationConfig.getResourceClasses().size() == 0)
+ log.info("no JAX-RS resource classes registered");
+ }
+
+}
Added: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyDispatcher.java 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1,98 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.*;
+import org.jboss.seam.log.Log;
+import org.resteasy.Dispatcher;
+import org.resteasy.plugins.providers.RegisterBuiltin;
+import org.resteasy.plugins.server.servlet.HttpServletDispatcher;
+import org.resteasy.plugins.server.resourcefactory.POJOResourceFactory;
+import org.resteasy.spi.*;
+
+/**
+ * @author Christian Bauer
+ */
+@Name("org.jboss.seam.resteasy.dispatcher")
+(a)Scope(ScopeType.APPLICATION)
+@Startup(depends = "resteasyBootstrap")
+@AutoCreate
+@Install(classDependencies = "org.resteasy.Dispatcher")
+public class ResteasyDispatcher extends HttpServletDispatcher {
+
+ @In
+ RestApplicationConfig restApplicationConfig;
+
+ @Logger
+ Log log;
+
+ @Create
+ public void onStartup() {
+ log.info("registering RESTEasy resources and providers");
+
+ ResteasyProviderFactory providerFactory = new ResteasyProviderFactory();
+ ResteasyProviderFactory.setInstance(providerFactory); // This is really necessary
+ setDispatcher(new Dispatcher(providerFactory));
+
+ getDispatcher().setLanguageMappings(restApplicationConfig.getLanguageMappings());
+ getDispatcher().setMediaTypeMappings(restApplicationConfig.getMediaTypeMappings());
+
+ // Resource registration
+ Registry registry = getDispatcher().getRegistry();
+ for (final Class resourceClass : restApplicationConfig.getResourceClasses()) {
+ final Component seamComponent = restApplicationConfig.getResourceClassComponent(resourceClass);
+ if (seamComponent != null) {
+ // Seam component lookup when call is dispatched to resource
+ registry.addResourceFactory(
+ new ResourceFactory() {
+
+ private PropertyInjector propertyInjector;
+
+ public Class<?> getScannableClass() {
+ return resourceClass;
+ }
+
+ public void registered(InjectorFactory factory) {
+ this.propertyInjector = factory.createPropertyInjector(getScannableClass());
+ }
+
+ public Object createResource(HttpRequest request, HttpResponse response, InjectorFactory factory) {
+ Object target = Component.getInstance(seamComponent.getName());
+ propertyInjector.inject(request, response, target);
+ return target;
+ }
+
+ public void requestFinished(HttpRequest request, HttpResponse response, Object resource) {}
+ public void unregistered() {}
+ }
+ );
+ } else {
+ // JAX-RS default lifecycle
+ registry.addResourceFactory(new POJOResourceFactory(resourceClass));
+ }
+ }
+
+ // Provider registration
+ if (restApplicationConfig.isUseBuiltinProviders()) {
+ log.info("registering built-in RESTEasy providers");
+ RegisterBuiltin.register(providerFactory);
+ }
+ for (Class providerClass : restApplicationConfig.getProviderClasses()) {
+ Component seamComponent = restApplicationConfig.getProviderClassComponent(providerClass);
+ if (seamComponent != null) {
+ if (ScopeType.STATELESS.equals(seamComponent.getScope())) {
+ throw new RuntimeException(
+ "Registration of STATELESS Seam components as RESTEasy providers not implemented!"
+ );
+ } else if (ScopeType.APPLICATION.equals(seamComponent.getScope())) {
+ Object providerInstance = Component.getInstance(seamComponent.getName());
+ providerFactory.registerProviderInstance(providerInstance);
+ }
+ } else {
+ // Just plain RESTEasy, no Seam component lookup or lifecycle
+ providerFactory.registerProvider(providerClass);
+ }
+ }
+
+ }
+}
Added: trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/ResteasyResourceAdapter.java 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1,65 @@
+package org.jboss.seam.resteasy;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.servlet.ContextualHttpServletRequest;
+import org.jboss.seam.web.AbstractResource;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * Accepts incoming HTTP request under the Seam resource-servlet URL mapping and
+ * dispatches the call to RESTEasy. Wraps the call in Seam contexts.
+ * <p>
+ * Hardcoded URL path is <tt>/rest</tt>. Subclass and override the
+ * <tt>getResourcePath()</tt> method to customize this.
+ * </p>
+ *
+ * @author Christian Bauer
+ */
+(a)Scope(ScopeType.APPLICATION)
+@Name("org.jboss.seam.resteasy.resourceAdapter")
+@BypassInterceptors
+public class ResteasyResourceAdapter extends AbstractResource {
+
+ public static final String RESTEASY_RESOURCE_BASEPATH = "/rest";
+
+ @Override
+ public String getResourcePath() {
+ return RESTEASY_RESOURCE_BASEPATH;
+ }
+
+ @Override
+ public void getResource(final HttpServletRequest request, final HttpServletResponse response)
+ throws ServletException, IOException {
+
+ // Wrap this in Seam contexts
+ new ContextualHttpServletRequest(request) {
+ @Override
+ public void process() throws ServletException, IOException {
+
+ ResteasyDispatcher dispatcher =
+ (ResteasyDispatcher)Component.getInstance(ResteasyDispatcher.class);
+ if (dispatcher == null) {
+ throw new IllegalStateException("RESTEasy is not installed, check your classpath");
+ }
+ dispatcher.invoke(
+ new HttpServletRequestWrapper(request) {
+ // TODO: Strip out the /seam/resource/rest stuff
+ public String getPathInfo() {
+ return super.getPathInfo();
+ }
+ },
+ response
+ );
+ }
+ }.run();
+ }
+}
Added: trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd
===================================================================
--- trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd (rev 0)
+++ trunk/src/resteasy/org/jboss/seam/resteasy/reasteasy-2.1.xsd 2008-07-14 10:39:57 UTC (rev 8453)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/seam/resteasy"
+ xmlns:pdf="http://jboss.com/products/seam/resteasy"
+ xmlns:components="http://jboss.com/products/seam/components"
+ attributeFormDefault="unqualified">
+ <xs:import namespace="http://jboss.com/products/seam/components" schemaLocation="components-2.1.xsd"/>
+
+ <!-- TODO -->
+
+</xs:schema>
Added: trunk/src/resteasy/seam.properties
===================================================================
15 years, 11 months
Seam SVN: r8451 - in trunk: build and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-13 10:33:30 -0400 (Sun, 13 Jul 2008)
New Revision: 8451
Added:
trunk/build/resteasy.pom.xml
trunk/src/resteasy/
Modified:
trunk/build.xml
trunk/build/build.xml
trunk/build/ci.build.xml
trunk/build/classpath.tmpl
trunk/build/common.build.xml
trunk/build/root.pom.xml
Log:
Add resteasy module
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build/build.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -49,6 +49,7 @@
<deployWithSources pom="${ui.pom}" jar="${lib.dir}/jboss-seam-ui.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-ui-sources.jar"/>
<deployWithSources pom="${jbas5.pom}" jar="${lib.dir}/interop/jboss-seam-jbas5.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/interop/jboss-seam-jbas5-sources.jar"/>
<deployWithSources pom="${jul.pom}" jar="${lib.dir}/interop/jboss-seam-jul.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/interop/jboss-seam-jul-sources.jar"/>
+ <deployWithSources pom="${resteasy.pom}" jar="${lib.dir}/jboss-seam-resteasy.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-resteasy-sources.jar"/>
<deployExample name="booking" repositoryId="offline.repository.jboss.org"/>
<deployExampleNoDs name="numberguess" repositoryId="offline.repository.jboss.org"/>
<deployExample name="dvd" path="${seam.dir}/examples/dvdstore" repositoryId="offline.repository.jboss.org"/>
Modified: trunk/build/ci.build.xml
===================================================================
--- trunk/build/ci.build.xml 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build/ci.build.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -26,6 +26,7 @@
<deploySnapshot pom="${jbas5.pom}" jar="${lib.dir}/interop/jboss-seam-jbas5.jar" srcjar="${lib.dir}/interop/src/jboss-seam-jbas5-sources.jar"/>
<deploySnapshot pom="${jul.pom}" jar="${lib.dir}/interop/jboss-seam-jul.jar" srcjar="${lib.dir}/interop/src/jboss-seam-jul-sources.jar"/>
<deploySnapshot pom="${wicket.pom}" jar="${lib.dir}/jboss-seam-wicket.jar" srcjar="${lib.dir}/src/jboss-seam-wicket-sources.jar"/>
+ <deploySnapshot pom="${resteasy.pom}" jar="${lib.dir}/jboss-seam-resteasy.jar" srcjar="${lib.dir}/src/jboss-seam-resteasy-sources.jar"/>
<deploySnapshot pom="${gen.pom}" jar="${lib.dir}/jboss-seam-gen.jar" srcjar="${lib.dir}/src/jboss-seam-gen-sources.jar"/>
<deploySnapshot pom="${ioc.pom}" jar="${lib.dir}/jboss-seam-ioc.jar" srcjar="${lib.dir}/src/jboss-seam-ioc-sources.jar"/>
<deploySnapshot pom="${mail.pom}" jar="${lib.dir}/jboss-seam-mail.jar" srcjar="${lib.dir}/src/jboss-seam-mail-sources.jar"/>
Modified: trunk/build/classpath.tmpl
===================================================================
--- trunk/build/classpath.tmpl 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build/classpath.tmpl 2008-07-13 14:33:30 UTC (rev 8451)
@@ -4,6 +4,7 @@
<classpathentry kind="src" path="ui/src/main/java"/>
<classpathentry kind="src" path="src/wicket"/>
<classpathentry kind="src" path="src/remoting"/>
+ <classpathentry kind="src" path="src/resteasy"/>
<classpathentry kind="src" path="src/ioc" excluding="org/jboss/seam/ioc/microcontainer/**/*"/>
<classpathentry kind="src" path="src/mail"/>
<classpathentry kind="src" path="src/pdf"/>
Modified: trunk/build/common.build.xml
===================================================================
--- trunk/build/common.build.xml 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build/common.build.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -102,6 +102,7 @@
<pomfile name="wicket.pom" value="${build.dir}/wicket.pom.xml" />
<pomfile name="jbas5.pom" value="${build.dir}/jbas5.pom.xml" />
<pomfile name="jul.pom" value="${build.dir}/jul.pom.xml" />
+ <pomfile name="resteasy.pom" value="${build.dir}/resteasy.pom.xml" />
<pomfile name="gen.pom" value="${build.dir}/gen.pom.xml" />
<pomfile name="ioc.pom" value="${build.dir}/ioc.pom.xml" />
<pomfile name="mail.pom" value="${build.dir}/mail.pom.xml" />
@@ -120,8 +121,9 @@
<copyDependencies id="mail" pom="${mail.pom}" todir="${lib.dir}" scope="runtime" />
<copyDependencies id="pdf" pom="${pdf.pom}" todir="${lib.dir}" scope="runtime" />
<copyDependencies id="remoting" pom="${remoting.pom}" todir="${lib.dir}" scope="runtime" />
+ <copyDependencies id="resteasy" pom="${resteasy.pom}" todir="${lib.dir}" scope="runtime" />
<copyDependencies id="ui" pom="${ui.pom}" todir="${lib.dir}" scope="runtime" />
- <copyDependencies id="gen" pom="${gen.pom}" todir="${lib.dir}" scope="runtime" />
+ <copyDependencies id="gen" pom="${gen.pom}" todir="${lib.dir}" scope="runtime" />
<copyDependencies id="core" pom="${core.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="debug" pom="${debug.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="wicket" pom="${wicket.pom}" todir="${lib.dir}" scope="compile" />
@@ -129,6 +131,7 @@
<copyDependencies id="mail" pom="${mail.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="pdf" pom="${pdf.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="remoting" pom="${remoting.pom}" todir="${lib.dir}" scope="compile" />
+ <copyDependencies id="resteasy" pom="${resteasy.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="ui" pom="${ui.pom}" todir="${lib.dir}" scope="compile" />
<copyDependencies id="gen" pom="${gen.pom}" todir="${lib.dir}" scope="compile" />
<property name="copyseamdependenciesdone" value="true" />
@@ -143,6 +146,7 @@
<dependency groupId="org.jboss.seam" artifactId="jboss-seam-mail" version="${complete.version}" />
<dependency groupId="org.jboss.seam" artifactId="jboss-seam-pdf" version="${complete.version}" />
<dependency groupId="org.jboss.seam" artifactId="jboss-seam-remoting" version="${complete.version}" />
+ <dependency groupId="org.jboss.seam" artifactId="jboss-seam-resteasy" version="${complete.version}" />
<dependency groupId="org.jboss.seam" artifactId="jboss-seam-ui" version="${complete.version}" />
</copyInlineDependencies>
<property name="copyseamdone" value="true" />
@@ -178,6 +182,7 @@
<deploy pom="${core.pom}" jar="${seam.dir}/lib/jboss-seam.jar" repositoryId="@{repositoryId}" />
<deploy pom="${ui.pom}" jar="${seam.dir}/lib/jboss-seam-ui.jar" repositoryId="@{repositoryId}" />
<deploy pom="${remoting.pom}" jar="${seam.dir}/lib/jboss-seam-remoting.jar" repositoryId="@{repositoryId}" />
+ <deploy pom="${resteasy.pom}" jar="${seam.dir}/lib/jboss-seam-resteasy.jar" repositoryId="@{repositoryId}" />
<deploy pom="${pdf.pom}" jar="${seam.dir}/lib/jboss-seam-pdf.jar" repositoryId="@{repositoryId}" />
<deploy pom="${mail.pom}" jar="${seam.dir}/lib/jboss-seam-mail.jar" repositoryId="@{repositoryId}" />
<deploy pom="${ioc.pom}" jar="${seam.dir}/lib/jboss-seam-ioc.jar" repositoryId="@{repositoryId}" />
@@ -202,6 +207,7 @@
<propertyref name="parent.pom" />
<propertyref name="ui.pom" />
<propertyref name="remoting.pom" />
+ <propertyref name="resteasy.pom" />
<propertyref name="gen.pom" />
<propertyref name="pdf.pom" />
<propertyref name="ioc.pom" />
@@ -237,6 +243,7 @@
<propertyref name="parent.pom" />
<propertyref name="ui.pom" />
<propertyref name="remoting.pom" />
+ <propertyref name="resteasy.pom" />
<propertyref name="gen.pom" />
<propertyref name="pdf.pom" />
<propertyref name="ioc.pom" />
@@ -271,6 +278,7 @@
<propertyref name="parent.pom" />
<propertyref name="ui.pom" />
<propertyref name="remoting.pom" />
+ <propertyref name="resteasy.pom" />
<propertyref name="gen.pom" />
<propertyref name="pdf.pom" />
<propertyref name="ioc.pom" />
@@ -339,6 +347,7 @@
<outputDependencyReport module="pdf" />
<outputDependencyReport module="ioc" />
<outputDependencyReport module="wicket" />
+ <outputDependencyReport module="resteasy" />
<outputDependencyReport module="jbas5" />
<outputDependencyReport module="jul" />
<echo>Dependency Report written to ${seam.dir}/dependency-report.txt</echo>
Added: trunk/build/resteasy.pom.xml
===================================================================
--- trunk/build/resteasy.pom.xml (rev 0)
+++ trunk/build/resteasy.pom.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-resteasy</artifactId>
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>parent</artifactId>
+ <version>@seam.version@</version>
+ </parent>
+
+ <!-- See root pom for notes on how to declare dependencies -->
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ </dependency>
+
+ </dependencies>
+
+</project>
\ No newline at end of file
Property changes on: trunk/build/resteasy.pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build/root.pom.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -88,6 +88,12 @@
<artifactId>jboss-seam-remoting</artifactId>
<version>@seam.version@</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-resteasy</artifactId>
+ <version>@seam.version@</version>
+ </dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-07-13 14:32:53 UTC (rev 8450)
+++ trunk/build.xml 2008-07-13 14:33:30 UTC (rev 8451)
@@ -21,6 +21,7 @@
<property name="classes.wicket.dir" value="${classes.dir}/wicketclasses" />
<property name="classes.jbas5.dir" value="${classes.dir}/jbas5classes" />
<property name="classes.jul.dir" value="${classes.dir}/julclasses" />
+ <property name="classes.resteasy.dir" value="${classes.dir}/resteasyclasses" />
<property name="classes.remoting.dir" value="${classes.dir}/remotingclasses" />
<property name="classes.gen.dir" value="${classes.dir}/genclasses" />
<property name="classes.test.dir" value="${classes.dir}/testclasses" />
@@ -39,6 +40,7 @@
<property name="src.wicket.dir" value="src/wicket" />
<property name="src.jbas5.dir" value="src/interop/jbas5" />
<property name="src.jul.dir" value="src/interop/jul" />
+ <property name="src.resteasy.dir" value="src/resteasy" />
<property name="src.gen.dir" value="src/gen" />
<property name="src.remoting.dir" value="src/remoting" />
<property name="src.test.dir" value="src/test" />
@@ -72,6 +74,7 @@
<property name="dist.src.wicket.dir" value="${dist.dir}/src/wicket" />
<property name="dist.src.jbas5.dir" value="${dist.dir}/src/interop/jbas5" />
<property name="dist.src.jul.dir" value="${dist.dir}/src/interop/jul" />
+ <property name="dist.src.resteasy.dir" value="${dist.dir}/src/resteasy" />
<property name="dist.src.gen.dir" value="${dist.dir}/src/gen" />
<property name="dist.src.remoting.dir" value="${dist.dir}/src/remoting" />
<property name="dist.src.test.dir" value="${dist.dir}/src/test" />
@@ -155,7 +158,7 @@
<delete dir="${lib.dir}" quiet="${quietclean}" />
</target>
- <target name="build" depends="jarcore,jarpdf,jarioc,jarmail,jarremoting,jardebug,jargen,jarui,jarjbas5,jarwicket, jarjul" description="Build all distribution .jar files" />
+ <target name="build" depends="jarcore,jarpdf,jarioc,jarmail,jarremoting,jardebug,jargen,jarui,jarjbas5,jarwicket, jarjul, jarresteasy" description="Build all distribution .jar files" />
<target name="select-compiler">
<available classname="org.eclipse.jdt.core.JDTCompilerAdapter" property="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter" />
@@ -302,7 +305,21 @@
<target name="jarjul" depends="compilejul" description="Build the distribution .jar file for the JUL -> Log4J bridge integration package">
<archive classesdir="${classes.jul.dir}" module="jboss-seam-jul" pom="${jul.pom}" srcdir="${src.jul.dir}" outputdir="${lib.dir}/interop" />
</target>
+
+ <!-- ########################### RESTeasy TARGETS ###########################-->
+ <target name="initresteasy" depends="init, jarcore">
+ <init classesdir="${classes.resteasy.dir}" srcdir="${src.resteasy.dir}" modulename="resteasy" pom="${resteasy.pom}" />
+ </target>
+
+ <target name="compileresteasy" depends="initresteasy, select-compiler">
+ <compile classesdir="${classes.resteasy.dir}" srcdir="${src.resteasy.dir}" classpath="compile.resteasy.path" />
+ </target>
+
+ <target name="jarresteasy" depends="compileresteasy" description="Build the distribution .jar file for the resteasy -> Log4J bridge integration package">
+ <archive classesdir="${classes.resteasy.dir}" module="jboss-seam-resteasy" pom="${resteasy.pom}" srcdir="${src.resteasy.dir}" outputdir="${lib.dir}" />
+ </target>
+
<!-- ########################### GEN TARGETS ###########################-->
<target name="initgen" depends="init">
@@ -469,6 +486,7 @@
<copysource destdir="${dist.src.wicket.dir}" srcdir="${src.wicket.dir}" />
<copysource destdir="${dist.src.jbas5.dir}" srcdir="${src.jbas5.dir}" />
<copysource destdir="${dist.src.jul.dir}" srcdir="${src.jul.dir}" />
+ <copysource destdir="${dist.src.resteasy.dir}" srcdir="${src.resteasy.dir}" />
<copysource destdir="${dist.src.gen.dir}" srcdir="${src.gen.dir}" />
<copysource destdir="${dist.src.test.dir}" srcdir="${src.test.dir}" />
@@ -976,6 +994,7 @@
<propertyref name="debug.pom" />
<propertyref name="wicket.pom" />
<propertyref name="jbas5.pom" />
+ <propertyref name="resteasy.pokm" />
<propertyref name="testng.jvmargs"/>
</propertyset>
</ant>
@@ -988,6 +1007,7 @@
<dependenciesWithSources id="wicket" scope="compile" pom="${wicket.pom}" />
<dependenciesWithSources id="jbas5" scope="compile" pom="${jbas5.pom}" />
<dependenciesWithSources id="jul" scope="compile" pom="${jul.pom}" />
+ <dependenciesWithSources id="resteasy" scope="compile" pom="${resteasy.pom}" />
<dependenciesWithSources id="gen" scope="compile" pom="${gen.pom}" />
<dependenciesWithSources id="ioc" scope="compile" pom="${ioc.pom}" />
<dependenciesWithSources id="mail" scope="compile" pom="${mail.pom}" />
@@ -1007,6 +1027,7 @@
<dependencies id="wicket" scope="compile" pom="${wicket.pom}" />
<dependencies id="jbas5" scope="compile" pom="${jbas5.pom}" />
<dependencies id="jul" scope="compile" pom="${jul.pom}" />
+ <dependencies id="resteasy" scope="compile" pom="${resteasy.pom}" />
<dependencies id="gen" scope="compile" pom="${gen.pom}" />
<dependencies id="ioc" scope="compile" pom="${ioc.pom}" />
<dependencies id="mail" scope="compile" pom="${mail.pom}" />
@@ -1024,6 +1045,7 @@
<path refid="compile.ui.path" />
<path refid="compile.jbas5.path" />
<path refid="compile.jul.path" />
+ <path refid="compile.resteasy.path" />
<path refid="compile.wicket.path" />
</eclipseClasspath>
</target>
15 years, 11 months
Seam SVN: r8450 - trunk/src/main/org/jboss/seam/util.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-07-13 10:32:53 -0400 (Sun, 13 Jul 2008)
New Revision: 8450
Modified:
trunk/src/main/org/jboss/seam/util/Reflections.java
Log:
toString(Field) can be toString(Member)
Modified: trunk/src/main/org/jboss/seam/util/Reflections.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/Reflections.java 2008-07-13 13:07:38 UTC (rev 8449)
+++ trunk/src/main/org/jboss/seam/util/Reflections.java 2008-07-13 14:32:53 UTC (rev 8450)
@@ -5,6 +5,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
@@ -147,11 +148,11 @@
')';
}
- public static String toString(Field field)
+ public static String toString(Member member)
{
- return Strings.unqualify( field.getDeclaringClass().getName() ) +
+ return Strings.unqualify( member.getDeclaringClass().getName() ) +
'.' +
- field.getName();
+ member.getName();
}
public static Class classForName(String name) throws ClassNotFoundException
15 years, 11 months