IBM WebSphere® Application Server V7.0 Feature Pack for Service Component Architecture V1.0.1 IBM WebSphere® Application Server V7.0 Feature Pack for Service Component Architecture V1.0.1 JEE integration This presentation will cover the JEE integration in the SCA feature pack. It will specifically focus on the integration of SCA and Java™ EE within the context of a Java EE application. It will also look at the use of Java EE components as service component implementations and the deployment of Java EE archives either within or as SCA contributions. JEE archives as Service Component implementations JEE archives as Service Component implementations SCA testcase: JEE SCA integration implies the entire archive to be represented as a single coarse-grained component within SCA JEE implementation type Implementation.jee ex. * The current SCA JEE integration is the entire archive to be represented as a single coarse-grained component within SCA. The archive attribute specifies a relative path to the Java EE archive that serves as implementation artifact. The context of that relative path (the value “.”) is the location of the artifact that contains the implementation.jee element. All Java EE components contained in the archive are deployed, regardless of any SCA enhancements present. Every deployed SCA component using the JEE implementation type represents a deployment of the referred Java EE archive. The archive that is referred to by can be an artifact within a larger contribution (that is an EAR inside a larger compressed file), or the archive can itself be a contribution. In the latter case, the @archive attribute can be left unspecified, and the archive is assumed to be the archive of the contribution itself. The component type derived from a Java EE archive depends on whether it has been enhanced with SCA artifacts or contains an application composite. JEE integration SCA FP scenario implemented JEE integration SCA FP scenario implemented Non- SCA enhanced ear SCA enhanced ear (contains SCA artifacts like annotations) SCA.jar Implementation classes Composite file Example.ear or Let’s look at the scenario supported for SCA feature pack as far as JEE integration is concerned. As mentioned in the previous slide, implementation.jee is what is supported in this feature pack. Let’s look at an example: Suppose there is an EAR containing one or more EJB jars and one or more Web modules . An SCA jar can use such an EAR as its component implementation using the element, specifying the EAR in the "archive" attribute as shown. Direct use of EJB jar module or Web module as component implementation in SCA composites is not supported. The EAR itself can contain no SCA artifacts like annotations, in which case it is called a non-SCA enhanced EAR (when it contains annotations, its called an SCA enhanced EAR). The user can choose to provide an application composite file for the EAR (located within the META-INF directory of the EAR). This application composite can internally use and as component implementations pointing to EJB jars and Web wars within the EAR. In such cases the application composite will "promote" relevant services, references and properties to make them available to an SCA component using the EAR as implementation by way of . What this means is that direct use of and as component implementation from SCA composites are not supported. Rather users must always use in such cases. Example application composite Example application composite This is an example application.composite with implementation.ejb and implementation.web. This example is taken from the HelloJEE sample provided with the product. The next slide is a blown up version of some of the implementation.ejb and implementation.web lines of code shown here. Implementation (application composite) Implementation (application composite) Note the implementation.ejb and implementation.web. Basic steps for integrating a JEE application in SCA Basic steps for integrating a JEE application in SCA Create a JEE ear file Create an SCA jar file with the EAR file as it’s component implementation Import both the EAR file and the SCA jar file as assets Create a business level application Add both the EAR and the SCA jar into the BLA as deployed assets Start the BLA Here are simple steps for integrating a JEE application in SCA. First, create a JEE ear file. Then create an SCA jar file with the EAR file as it’s component implementation. Import both the EAR file and the SCA jar file as assets. You can then create a business level application.Add both the EAR and the SCA jar into the BLA as deployed assets. You can now start the BLA. SCA-enabled Java EE runtime scenarios SCA-enabled Java EE runtime scenarios Consume SCA-exposed services from Java EE components Use Session Beans as Service Component Implementations Expose Enterprise Applications into an SCA domain Use Recursive SCA Assembly in Enterprise Applications Use Java EE Archives as Service Component Implementation The following scenarios apply when enabling SCA on Java EE runtimes: Consume SCA-exposed services from Java EE components For example, a Web component should be able to easily consume a service implemented by a service component. This can be either by using SCA constructs in the implementation of a Java EE component implementation or by way of an EJB reference in combination with an EJB binding over an SCA service. Use Session Beans as Service Component Implementations The recursive assembly model of SCA provides rich means of configuration and re-use of service components that can be implemented as SCA composites or by some other implementation type. Session beans are the Java EE component implementation model and serve also as service component implementations. Expose Enterprise Applications into an SCA domain The SCA Assembly specification describes a deployment model for SCA contributions that provides cross-enterprise application assembly capabilities when layered over Java EE. Use Recursive SCA Assembly in Enterprise Applications SCA Assembly provides means to define sophisticated application assembly for enterprise applications. Deploy SCA Components as a Part of a Java EE application SCA applications will typically combine Java EE components with components using other implementation technologies, such as BPEL. The Java EE SCA specification enables the deployment of components implemented in these “foreign” technologies as part of a Java EE application, taking advantage of whatever tools and infrastructure support exists for the deployment and life cycle management of Java EE applications. Such components are treated as running in unmanaged environment and should not rely on Java EE features (access to java:comp/env, and so on.) Use Java EE Archives as Service Component Implementation SCA Java EE integration specification enables the creation of SCA applications whose components are implemented by Java JEE archives, so that they can be wired to each other and to components implemented using other technologies. This use-case requires a high-level view of the Java EE application as a single SCA component implementation, providing services and consuming references as a single component. JEE application as an SCA implementation JEE application as an SCA implementation EAR Composite Component WS Binding EJB Binding EJB exposed as normal EJB JMS Binding Enterprise Archive Name SLSB JEE Application SLSB SCA Binding WS Binding EJB Binding JMS Binding bv EJB Ref SCA Binding WS Binding EJB Binding JMS Binding EJB Ref SCA Binding JEE application as a SCA implementation: Here is a picture showing a JEE application as an SCA implementation. You can rewire an Enterprise JavaBeans (EJB) reference to a Service Component Architecture (SCA) reference that provides the same named operations. The rewiring does not require a change to existing code. Thus, you can use the SCA programming model without changing the implementation code. To rewire an EJB reference to an SCA service in an SCA component, add a element to the JEE module component as shown. The reference names must match the name of the EJB reference. The contract of operations supported must also match. Because references must be promoted in the composite, the names of the references must be unique. After the EJB reference is promoted, all matching instances of the EJB reference in the module are rewired to the SCA service. The EJB references are rewired to SCA references enabling Java EE modules to use SCA features without changing its implementation As shown in the picture, the EAR is then used in SCA as a component implementation. Component type of an SCA-enhanced Java EE archive Component type of an SCA-enhanced Java EE archive A Java EE archive that contains an application composite has the component type of the application composite as its component type when used with the JEE implementation type. Example: Let’s assume an SCA-enhanced Java EE archive application.ear that can be used as part of a larger non-Java EE contribution that declares a service component in some other composite that uses the archive application.ear as implementation artifact. In that case the component type of the EAR archive will expose a service. See next slide for an example. Sample component (2) Sample component (2) In this example, assuming there is an AccountReporting service, the component type of the EAR archive (mentioned in previous slide) will expose the service, the AccountReporting Assembly and deployment of SCA-enhanced Java EE archives Assembly and deployment of SCA-enhanced Java EE archives This slide shows how to apply SCA assembly concepts when assembling and deploying SCA-enhanced Java EE applications. A Java EE archive, for example a Java EE application or a Java EE module (a Web application, an ejb module), can be used as an SCA contribution. [Recap: A contribution (contribution.xml) is a special xml document that describes how composites should be deployed. It contains information regarding which composites in the deployable jar are executable, what their namespaces are and which can be used by other contributions.] Security and transaction support Security and transaction support Authorization policy for implementation.jee components handled by the implementation Roles and security identity specified in the EJB/EAR Transaction support for services handled by the implementation Required transaction attribute specified in the EJB deployment descriptor SCA transaction intents specified on the reference side to propagate or suspend transactions Authorization policy for implementation.jee components is handled by the implementation. Roles and security identity should be specified in the EJB/EAR. SCA policy sets to handle authorization cannot be attached to the component. Transaction support for services are also handled by the implementation. The required transaction attribute should be specified in the EJB deployment descriptor. SCA transaction intents can be specified on the reference side to propagate or suspend transactions. Benefits and summary Benefits and summary Section To summarize Benefits of JEE integration Benefits of JEE integration Ability to re-wire EJB module EJBRefs using SCDL without changing underlying JEE artifacts SCA programming model invokes business services in JEE components Ability to make available remotable services as SCA services over the SCA default binding without the need for defining an SCDL Ability for EJB services to be exposed as SCA services and then to be re-wired over various wire formats. What are the benefits of JEE integration? - Ability to reuse JEE components and modules as SCA implementations leveraging JEE business logic in SCA assemblies. - Ability for SCA components to be exposed as services when those services exist in an EAR simplifying application packaging experience when using both SCA and JEE. - Ability to rewire EJB Module EJBRefs using Service Component Definition Language (SCDL) without changing the underlying JEE artifacts making it possible to rewire existing JEE applications without changing them. - Ability to take advantage of the SCA programming model to invoke business services in JEE components allowing for SCA domain ease-of-use characteristics to access those services. - Ability to make available remotable services as SCA services over the SCA default binding without the need for defining a SCDL. This allows for existing JEE services to be wired to from SCA applications over the default binding. Thus leveraging the ease-of-use characteristics of the SCA domain without the need for writing specific SCDL. JEE spec limitations JEE spec limitations is only defined for Java EE archives that are compliant to Java EE 5 and higher Direct access to and implementation.web are not supported for this SCA feature pack Various parts of this specification are limited with respect to what version of Java EE specifications they refer and apply to. - is only defined for Java EE archives that are compliant to Java EE 5 and higher - Direct access to and implementation.web are not supported for this SCA feature pack References References SCA Java EE integration specification: http://www.osoa.org/download/attachments/35/SCA_JAVAEE_Integration_V100.pdf?version=1 IBM Education Assistant http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.wasfpsca/plugin_coverpage.html SCA feature pack information center http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.soafep.multiplatform.doc/info/welcome_nd.html SCA white papers http://www.ibm.com/developerworks/websphere/library/techarticles/0812_beck/0812_beck.html References Feedback Feedback Your feedback is valuable You can help improve the quality of IBM Education Assistant content to better meet your needs by providing feedback. Did you find this module useful? Did it help you solve a problem or answer a question? Do you have suggestions for improvements? Click to send e-mail feedback: mailto:iea@us.ibm.com?subject=Feedback_about_WASV7SCA101_JEE_Integration.ppt This module is also available in PDF format at: ../WASV7SCA101_JEE_Integration.pdf You can help improve the quality of IBM Education Assistant content by providing feedback. Trademarks