|
From: Weinan Li <we...@re...> - 2015-12-02 04:05:54
|
Hi Charles,
Sorry I'm not sure whether I understand your question correctly, so please forgive me if I'm wrong :-)
To start a Resteasy container, first we need to create a ResteasyDeployment instance and initialize it:
ResteasyDeployment deployment = new ResteasyDeployment();
deployment.start();
Then we can register any resources into it:
deployment.getActualResourceClasses().add(SimpleResource.class);
Or you can also directly add into Registry class:
deployment.getRegistry().addPerRequestResource(Resource.class);
Because in ResteasyDeployment itself it's like:
if (resources != null)
{
for (Object obj : resources)
{
registry.addSingletonResource(obj);
}
}
for (Class actualResourceClass : actualResourceClasses)
{
registry.addPerRequestResource(actualResourceClass);
}
for (ResourceFactory factory : resourceFactories)
{
registry.addResourceFactory(factory);
}
All the scanners are implemented based on above logics. Here are some scanner examples:
https://github.com/wildfly/wildfly/blob/0c68aa0ebef3682e9ded4b473e24463b3e31af07/jaxrs/src/main/java/org/jboss/as/jaxrs/deployment/JaxrsScanningProcessor.java
https://github.com/resteasy/Resteasy/blob/85862364f1464532ceb2e5227fbbb214339fd73d/jaxrs/resteasy-servlet-initializer/src/main/java/org/jboss/resteasy/plugins/servlet/ResteasyServletInitializer.java
Hope the info is useful to you :-)
--
Weinan Li / JBoss
> On Dec 2, 2015, at 3:20 AM, Charles Moulliard <cmo...@re...> wrote:
>
> Hi,
>
> I'm currently working on Resteasy to deploy it on JBoss Fuse (= Apache Karaf OSGI container). I have been able to shade the Resteasy project in order to generate the OSGI MANIFEST file and to solve some TCCL issues like also to inject the BeanManager on OSGI but I can't use the option resteasy.scan = true
>
> Can somebody tell me where into the code of the api we scan the resources ?
>
> Regards,
> --
> Charles Moulliard
> Principal Solution Architect / JBoss Fuse Expert - Global Enablement @redhat
> cmo...@re... | work: +31 205 65 12 84 | mobile: +32 473 604 014
> MC-Square Business "Stockholm", Leonardo Da Vincilaan 19, Diegem 1831 - Belgium
> twitter: @cmoulliard | blog: cmoulliard.github.io
> committer: apache camel, karaf, servicemix, hawtio, fabric8, drools, jbpm, deltaspike
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140_______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|