[jbossws-issues] [JBoss JIRA] Created: (JBWS-1402) Ejb3 JMSTransportSupport

John Gilbert (JIRA) jira-events at jboss.com
Mon Nov 27 12:54:41 EST 2006


Ejb3 JMSTransportSupport
------------------------

                 Key: JBWS-1402
                 URL: http://jira.jboss.com/jira/browse/JBWS-1402
             Project: JBoss Web Services
          Issue Type: Patch
      Security Level: Public (Everyone can see)
         Environment: I made these changes to work with JBossWS 1.0.3 and JBoss AS 4.0.4.
            Reporter: John Gilbert


Allow the use of Ejb3 MDBs to support soap over jms. Note: This is a different solution then outlined in the referenced forum discussion.

Here is a sample Ejb3 MDB which is also annotated with JWS annotations:

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/AuthorizationCallbackQueue"),
		@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"),
		@ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable") })	
@WebService(name = "AuthorizationCallbackService", serviceName = "AuthorizationCallbackService")
@SOAPBinding(style = Style.RPC, use = Use.LITERAL, parameterStyle = ParameterStyle.BARE)
@SOAPMessageHandlers( { @SOAPMessageHandler(className = "org.jboss.ws.wsse.WSSecurityHandlerInbound") })
@SecurityDomain("portal")
public class AuthorizationCallbackMDB extends JMSTransportSupport implements MessageListener {

	@WebMethod
	@Oneway
	public void authorizationResponse(@WebParam(name = "paymentId") long paymentId, @WebParam(name = "status") boolean status) throws java.rmi.RemoteException {
		...
	}
}


The following changes where made to get this to work:

jbossws-core.jar -> org.jboss.ws.server.ServiceEndpointInfo constructor

		} else if (udi.type == UnifiedDeploymentInfo.Type.JSR181_EJB3) {
			String ejbName = sepMetaData.getLinkName();
			UnifiedApplicationMetaData applMetaData = (UnifiedApplicationMetaData) udi.metaData;
			UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData) applMetaData
					.getBeanByEjbName(ejbName);
			if (beanMetaData instanceof UnifiedMessageDrivenMetaData) {
				this.type = Type.MDB21;
			} else {
				this.type = Type.SLSB30;
			}
		}

jbossws-jboss-integration.jar -> org.jboss.ws.integration.jboss.DeployerInterceptorEJB3

	protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception {
		...
		for (Object container : ejb3Module.getContainers().values()) {
			if (container instanceof StatelessContainer) {
				StatelessContainer slc = (StatelessContainer) container;
				UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
				uslc.setEjbName(slc.getEjbName());
				uslc.setEjbClass(slc.getBeanClassName());
				beans.add(uslc);
			}
			if (container instanceof MDB) {
				MDB mdc = (MDB) container;
				if (mdc.resolveAnnotation(WebService.class) != null) {
					UnifiedBeanMetaData umdc = new UnifiedMessageDrivenMetaData();
					umdc.setEjbName(mdc.getEjbName());
					umdc.setEjbClass(mdc.getBeanClassName());
					ActivationConfigPropertyMetaData p = (ActivationConfigPropertyMetaData) mdc
							.getActivationConfigProperties().get("destination");
					((UnifiedMessageDrivenMetaData) umdc)
							.setDestinationJndiName(p.getValue());
					beans.add(umdc);
				}
			}
		}
		...
	}

	protected boolean isWebserviceDeployment(DeploymentInfo di) {
	        ...
		for (Object manager : ejb3Module.getContainers().values()) {
			if (manager instanceof StatelessContainer) {
				StatelessContainer container = (StatelessContainer) manager;
				if (container.resolveAnnotation(WebService.class) != null) {
					isWebserviceDeployment = true;
					break;
				}
			}
			if (manager instanceof MDB) {
				MDB container = (MDB) manager;
				if (container.resolveAnnotation(WebService.class) != null) {
					isWebserviceDeployment = true;
					break;
				}
			}
		}
		...
	}


The only thing I couldn't fix was the generated endpoint address in the wsdl. It still comes out like this

   <soap:address location='http://localhost:8080/payment-authorizer-0/AuthorizationCallbackMDB'/>

instead of something like this

   <soap:address location='jms://localhost/queue/AuthorizationCallbackQueue'/>

On a similar note I have created a straight forward jboss remoting JmsClientInvoker. It only works with Oneway messages, which is reasonable.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jbossws-issues mailing list