[Design of POJO Server] - Re: Unifying metadata
by wolfc
The problem for EJB 3 is meta data translation and meta data repository.
For example defining a stateful bean with a remove method:
<enterprise-beans>
| <session>
| <description>A stateful bean</description>
| <ejb-name>StatefulBean</ejb-name>
| <local>org.jboss.ejb3.test.stateful.Stateful</local>
| <ejb-class>org.jboss.ejb3.test.stateful.StatefulBean</ejb-class>
| <remove-method>
| <bean-method>
| <method-name>removeBean</method-name>
| </bean-method>
| </remove-method>
| </session>
| </enterprise-beans>
is the same as:
package org.jboss.ejb3.test.stateful;
|
| @Stateful(description="A stateful bean")
| @Local(Stateful.class)
| public class StatefulBean implements Stateful
| {
| ...
| @Remove
| public void remove() { }
| }
or:
package org.jboss.ejb3.test.stateful;
|
| @Stateful(description="A stateful bean")
| public class StatefulBean implements Stateful
| {
| ...
| public void remove() { }
| }
|
| @Local
| public interface Stateful
| {
| @Remove
| void remove();
| }
You can see that a Description annotation never even enters the picture.
Secondly we use the class container as meta data repository, so we can do this:
<bind pointcut="execution(public * *->@javax.ejb.Remove(..))">
| <interceptor-ref name="org.jboss.ejb3.stateful.StatefulRemoveFactory"/>
| </bind>
Again the public API annotations are leading.
Another problem: we can't use the API annotations to express all meta data, because they're not conclusive. Not everything can be expressed in annotations. So I would rather have the unified meta data as the base, which is conclusive and un-ambiguous and some translator on top. So if you ask for getAnnotation(@Remove) it will look it up in the right meta data repository in the right meta data.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087888#4087888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087888
18 years, 6 months
[Design of JBoss Web Services] - Exception propagation for one way messaqges
by adinn
Can anyone clarify the intention of the WS 2.0 specification regarding the propagation of exceptions from server to client for messages whicih are tagged @OneWay. It is not clear to me whether an exeception generated by the web method implementation is supposed to be caught and handled by generating a corresponding exception for the client call.
The specific case I have in mind is one where an @OneWay web method interface is generated from WSDL. The corresponding operation is specified with a single message and no or messages and is bound ot a port and service using a SOAP binding. Obviously, I would be inetrested to hear opinions regarding what should happen in other related cases.
I have tested the case mentioned above on JBossWS 2.0.1GA (with AS5.0.0.Beta3), generating either a SOAPFaultException or a WebServiceException. The test invokes the one way method via a client proxy obtained from the generated soap service class. In both cases a client exception was not thrown. However, I'll note that neither is this definitive of what the spec intends nor does it necessarily indicate that this is the behaviour desired by the implementation. The latter point is explained below.
An HTTP error was returned to the invoking client and a SOAP fault containing the generated exception details was serialised into the response stream and dispatched back to the client. Affter I patched a bug in the remoting code the soap envelope was read from the http connection response stream as a String. This format was employed because the unmarshaller installed on the connection before invocation was an HTTP unmarshaller, not a SOAP unmarshaller. This appears to explain why the fault was not thrown in the client context. Given all the work involved in returning the SOAP fault I wonder if this was really what was meant to happen?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087841#4087841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087841
18 years, 6 months