[JBossWS] - Re: Class Cast Exception under Endpoint.publish()
by adinn
Thanks for the quick response, Richard.
anonymous wrote :
| Endpoint.publish(), Endpoint.unpublish() is faulty by design IMHO.
| It doesn't make sense to be able to publish POJOs to different web contexts.
|
| Here are top two reasons why I think it is broken and hence excluded from TCK5 tests:
| * security issue (how to configure java security for such ugly published endpoints where e.g. Security Manager is turned on)?
| * design problem (why web archive should be able to publish another web/ejb archive)?
|
I'm not sure exactly why you think this makes it either undesirable or impossible to implement the Endpoint API as defined in the JaxWS spec. Let's go through these in turn:
1) It definitely makes sense to publish a specific POJO to a specific web context. Firstly, this API is simpler to use than providing a war with web.xml config. Secondly, it is dynamic, which allows all sorts of options not available using fixed web.xml config. For example, the endpoint implementation class might be loaded (or even generated) dynamically by the application.
And, actually, if you want to use the same POJO to masquerade behind two (or more) different URLs what is wrong with that? I can imagine good reasons for presenting a single service via multiple URLs and iIt's quite straightforward to deal with any threading issues this might imply.
2) The JaxWS spec does talk about security (Subsection 5.2.3 of the 21. spec) and, indeed, the Security permission it defines is checked by the current implementation of class EndpointImpl. Why can this implementation not be retro-fitted to conform to the JBoss Security Manager requirements?
3) I don't want a web archive to publish another web/ejb archive. In my case I have a test runner program for the XTS (Web Services Transactions) implementation. I deploy the test runner as a POJO via a jboss-beans.xml file. The test runner dynamically loads and executes different tests on different runs. Depending upon the specifics of the test, it needs to be able to install 0 or more POJOs as web service endpoints during test bootstrap.
I could, of course, deploy my test runner inside a war which statically deploys N endpoints via a web.xml config file. At present, I only use a single POJO service implementation but I don't always need the same value of N. In fact, for some runs (more precisely, on some of the AS instances employed in some of the runs -- the tests employ more than one AS) I don't even need to deploy a web service to complete the test.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200991#4200991
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200991
17 years, 6 months
[Microcontainer] - Re: Microcontainer support in Netty
by alesj
"trustin" wrote :
| * A glue module that combines all together to run the server up
| (will look up proper handler and codec instances via KernelController
| - I guess it's a piece of cake, right?)
|
I would try to use MC's API as little as possible.
Your stuff is all about beans, so we should be able to handle it w/o the explicit usage of MC API.
e.g. contextual injection, callbacks, installs, value-factory, ...
"trustin" wrote :
| Should I use some call back in this case, or does MC hide this race condition during upgrade (or redeployment)?
|
I would use callback.
e.g. callback on addProtocol(Protocol p)
Nope, MC doesn't explicitly handle that.
But if you would have proper dependencies, this would not matter.
"trustin" wrote :
| BTW, I still didn't figure out how to hide internal beans. How can I
| exactly do that?
|
Annotate your bean with @DeploymentScope and @ApplicationScope - via xml or directly on the class.
This will move the bean out of main Kernel(Controller) into a scoped one.
By default your scoped bean only 'sees' its scope and ancestors.
But you can 'change' the lookup order with @Search markup.
@Search takes type on how to search - currently only annotation support.
But you need to explicitly add SearchAnnotationPlugin - see the tests on how to do it.
"trustin" wrote :
| I'm also thinking about distributing a minimal JBossMC binary tarball
| with my tutorial so that a user can play with MC more easily (i.e.
| untar and drop the sample JARs etc etc). I think it might help MC
| adoption because people are really used to just downloading a Tomcat
| tarball and dropping a WAR and see it working. We already have
| something similar in jboss-demos, but I think it needs to be a binary
| form so that users can familiarize with MC quickly. I can do this
| while I write my tutorial. WDYT?
I would add your example directly under mc-demos.
Simply create new netty sub-module and hack all the stuff there.
See my previous examples on how to do this, following the same concept.
Glue code:
- bootstrap
- jmx
- classloading
Actual example code:
- models
- ioc
- classpath
Then simply link the tutorial to that code.
Or even better, write a simple article about it at DZone,
could be even part of my MC series - more than welcome to 'host' it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200980#4200980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200980
17 years, 6 months