Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: None
    • Labels:
      None

      Description

      This feature enables Synapse to call external EJBs within the mediation sequence. This feature adds two new mediators, namely, <bean> and <ejb>.

      Bean mediator - Bean mediator can manipulate a JavaBean that is bound to the Synapse message context as a property. This mediator can be used to create a new bean (CREATE action), remove an existing bean (REMOVE action), set a property of an existing JavaBean (SET_PROPERTY action) or to retrieve a property of an existing JavaBean (GET_PROPERTY action). Classes of objects manipulated by this mediator must follow the JavaBeans specification.

      <bean action="CREATE | REMOVE | SET_PROPERTY | GET_PROPERTY" var="string"
      [class="string"] [property="string"]
      [value="string |

      {xpath}"] />


      EJB Mediator - EJB mediator calls an external Enterprise JavaBean(EJB) and stores the result in the message payload or in a message context property. Currently, this mediator supports EJB3 Stateless Session Beans and Stateful Session Beans.

      <ejb beanstalk="string" class="string" [sessionId="string"] [remove="true | false"]
      [method="string"] [target="string | {xpath}

      "] [jndiName="string"] />
      <args>
      <arg (value="string |

      {xpath}

      ")/>*
      </args>
      </ejb>

      1. EJB_Support_for_Synapse.patch
        89 kB
        Sadeep Jayasumana
      2. Synapse-EJB-Sample.zip
        23 kB
        Sadeep Jayasumana

        Activity

        Sadeep Jayasumana created issue -
        Hide
        Sadeep Jayasumana added a comment -

        Attaching the patch. Please review and commit.

        Show
        Sadeep Jayasumana added a comment - Attaching the patch. Please review and commit.
        Sadeep Jayasumana made changes -
        Field Original Value New Value
        Attachment EJB_Support_for_Synapse.patch [ 12510877 ]
        Hide
        Sadeep Jayasumana added a comment -

        Adding a conventional Synapse sample for this feature is bit tricky since it involves hosting EJBs on an external EJB container. Therefore, attaching a manually configured sample for initial testing purposes.

        Show
        Sadeep Jayasumana added a comment - Adding a conventional Synapse sample for this feature is bit tricky since it involves hosting EJBs on an external EJB container. Therefore, attaching a manually configured sample for initial testing purposes.
        Sadeep Jayasumana made changes -
        Attachment Synapse-EJB-Sample.zip [ 12510885 ]
        Hide
        Hudson added a comment -

        Integrated in Synapse - Trunk #4330 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4330/)
        SYNAPSE-838: Introducing Bean and EJB mediators. (Revision 1361639)

        Result = FAILURE
        sadeep :
        Files :

        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/CacheEntry.java
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalk.java
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkConstants.java
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkManager.java
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkView.java
        • /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkViewMBean.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Axis2SynapseController.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorFactory.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorSerializer.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/EJBMediatorFactory.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/EJBMediatorSerializer.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanConstants.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanMediator.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanUtils.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/Target.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise/EJBConstants.java
        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise/EJBMediator.java
        Show
        Hudson added a comment - Integrated in Synapse - Trunk #4330 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4330/ ) SYNAPSE-838 : Introducing Bean and EJB mediators. (Revision 1361639) Result = FAILURE sadeep : Files : /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/CacheEntry.java /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalk.java /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkConstants.java /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkManager.java /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkView.java /synapse/trunk/java/modules/commons/src/main/java/org/apache/synapse/commons/beanstalk/enterprise/EnterpriseBeanstalkViewMBean.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/Axis2SynapseController.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorFactory.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorSerializer.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/EJBMediatorFactory.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/EJBMediatorSerializer.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorFactoryFinder.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/MediatorSerializerFinder.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/Value.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanConstants.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanMediator.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/BeanUtils.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/Target.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise/EJBConstants.java /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/bean/enterprise/EJBMediator.java
        Sadeep Jayasumana made changes -
        Assignee Sadeep Jayasumana [ sadeep ]
        Sadeep Jayasumana made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Hudson added a comment -

        Integrated in Synapse - Trunk #4339 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4339/)
        SYNAPSE-838: Adding unit tests. (Revision 1364056)

        Result = SUCCESS
        sadeep :
        Files :

        • /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorSerializer.java
        • /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/BeanMediatorSerializationTest.java
        • /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/EJBMediatorSerializationTest.java
        • /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean
        • /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean/BeanMediatorTest.java
        • /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean/Quote.java
        Show
        Hudson added a comment - Integrated in Synapse - Trunk #4339 (See https://builds.apache.org/job/Synapse%20-%20Trunk/4339/ ) SYNAPSE-838 : Adding unit tests. (Revision 1364056) Result = SUCCESS sadeep : Files : /synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/xml/BeanMediatorSerializer.java /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/BeanMediatorSerializationTest.java /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/config/xml/EJBMediatorSerializationTest.java /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean/BeanMediatorTest.java /synapse/trunk/java/modules/core/src/test/java/org/apache/synapse/mediators/bean/Quote.java
        Hide
        Hiranya Jayathilaka added a comment -

        Sadeep,

        Is there any reason why this issue is still open?

        BTW has the EJB sample been checked into the trunk?

        Show
        Hiranya Jayathilaka added a comment - Sadeep, Is there any reason why this issue is still open? BTW has the EJB sample been checked into the trunk?
        Hide
        Sadeep Jayasumana added a comment - - edited

        Hi Hiranya,

        The sample is not checked in yet.

        The sample has a dependency to javaee.javaee-api which is not used by any other part of Synapse. Furthermore, integrating this sample to the usual framework requires some significant modifications to the stockquote client code or writing a new client (please see Synapse-EJB-Sample.zip/README). I'm not sure whether these changes are worth it, since it's just one sample.

        WDYT? What would be the best way to add this sample to Synapse?

        Show
        Sadeep Jayasumana added a comment - - edited Hi Hiranya, The sample is not checked in yet. The sample has a dependency to javaee.javaee-api which is not used by any other part of Synapse. Furthermore, integrating this sample to the usual framework requires some significant modifications to the stockquote client code or writing a new client (please see Synapse-EJB-Sample.zip/README). I'm not sure whether these changes are worth it, since it's just one sample. WDYT? What would be the best way to add this sample to Synapse?
        Hide
        Hiranya Jayathilaka added a comment -

        How about we provide instructions to use Curl as the sample client?

        You might also want to provide the source code for the EJB backend service, so that a user can replicate it accurately.

        Show
        Hiranya Jayathilaka added a comment - How about we provide instructions to use Curl as the sample client? You might also want to provide the source code for the EJB backend service, so that a user can replicate it accurately.
        Hide
        Sadeep Jayasumana added a comment -

        +1 for curl.

        For the backend EJB source code, would committing to "trunk/java/modules/samples/services" without adding it to the build be appropriate?

        Show
        Sadeep Jayasumana added a comment - +1 for curl. For the backend EJB source code, would committing to "trunk/java/modules/samples/services" without adding it to the build be appropriate?
        Hide
        Hiranya Jayathilaka added a comment -

        The service should somehow be distributed in source form. You can add it to "trunk/java/modules/samples/services", but make sure to indicate that in the documentation and perhaps also some instructions on how it should be built (what dependencies are required etc.).

        Show
        Hiranya Jayathilaka added a comment - The service should somehow be distributed in source form. You can add it to "trunk/java/modules/samples/services", but make sure to indicate that in the documentation and perhaps also some instructions on how it should be built (what dependencies are required etc.).
        Hide
        Sadeep Jayasumana added a comment -

        +1. I will make those changes and close this issue soon.

        Show
        Sadeep Jayasumana added a comment - +1. I will make those changes and close this issue soon.
        Sadeep Jayasumana made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hiranya Jayathilaka made changes -
        Fix Version/s 3.0 [ 12324903 ]

          People

          • Assignee:
            Sadeep Jayasumana
            Reporter:
            Sadeep Jayasumana
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development