01: /*
02: * $Id: JcaService.java 11414 2008-03-18 03:16:19Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.module.jca;
12:
13: import org.mule.api.MuleEvent;
14: import org.mule.api.MuleException;
15: import org.mule.api.MuleMessage;
16: import org.mule.api.service.ServiceException;
17: import org.mule.module.jca.i18n.JcaMessages;
18: import org.mule.service.AbstractService;
19:
20: /**
21: * <code>JcaService</code> Is the type of service used in Mule when embedded inside
22: * an app server using JCA. In the future we might want to use one of the existing
23: * models.
24: */
25: public class JcaService extends AbstractService {
26:
27: /**
28: * Serial version
29: */
30: private static final long serialVersionUID = -1510441245219710451L;
31:
32: /**
33: * This is the synchronous call method and not supported by components managed in
34: * a JCA container
35: *
36: * @param event
37: * @return
38: * @throws MuleException
39: */
40: public MuleMessage sendEvent(MuleEvent event) throws MuleException {
41: throw new UnsupportedOperationException("sendEvent()");
42: }
43:
44: public boolean isPaused() {
45: // JcaService is a wrapper for a hosted service implementation and
46: // therefore cannot be paused by mule
47: return false;
48: }
49:
50: protected void waitIfPaused(MuleEvent event)
51: throws InterruptedException {
52: // JcaService is a wrapper for a hosted service implementation and
53: // therefore cannot be paused by mule
54: }
55:
56: protected void doPause() throws MuleException {
57: throw new ServiceException(JcaMessages
58: .cannotPauseResumeJcaComponent(), null, this );
59: }
60:
61: protected void doResume() throws MuleException {
62: throw new ServiceException(JcaMessages
63: .cannotPauseResumeJcaComponent(), null, this );
64: }
65:
66: protected void doDispatch(MuleEvent event) throws MuleException {
67: component.onCall(event);
68: }
69:
70: /**
71: * Implementation of template method which is never call because send() is
72: * overwritten
73: */
74: protected MuleMessage doSend(MuleEvent event) throws MuleException {
75: return null;
76: }
77:
78: }
|