APAC WebLogic Suite Workshop Oracle Parcel Service Overview Jeffrey West Application Grid Product Management
Oracle Parcel Service
What is it? Oracle Parcel Service An enterprise application to showcase WebLogic features Libraries built using both Standard Java and Spring Goal is to have a Java version and a Spring version for any given application module Subset of application code is used for this workshop <LINK> Built for a webcast series on WebLogic and Java EE 6 <LINK> Full source available on samplecode.oracle.com <LINK>
Application Modules Oracle Parcel Service Completely Integrated with Maven Domain Model Generation from XSD with JAXB WebLogic Deployment with Oracle WebLogic Maven Plugin Presentation Layer with JSF 2.0 & PrimeFaces JPA 2.0 Data Access Layer Built with EclipseLink: Java EE 6 JPA 2.0 Reference Implementation RESTful Services with JAX-RS 1.1 & Jersey Both Java EE and Spring examples SOAP Web Services with Both JAX-WS and Spring-WS Message Driven services with JMS Java Message Driven Beans and Spring Message-Driven POJO Business Logic with EJB 3.0 EJB & Persistence Context Injection
What can you do with it? Oracle Parcel Service Use cases Create Shipment with Multiple Parcels Track Shipment Update Parcel Tracking Log Simulate a number of Shipments Utility Features Session Invalidation Coherence Cache Sizes View
Home Screen Oracle Parcel Service Application
Queries Shipment and Parcel Oracle Parcel Service Application Query by: ID External Reference ID Destination ZIP Destination State
Shipment Functions Oracle Parcel Service Application
Parcel Functions Oracle Parcel Service Application
Coherence Functions Oracle Parcel Service Application
View Session Contents Oracle Parcel Service Application
Simulate a Batch of Shipments and Events Oracle Parcel Service Application
Application Deployment Topology ops_domain Load Balancer (7000) AdminServer (7001) ops-cluster-1 ops-ms-1 (7101) ops-ms-2 (7102) ops-coherencecluster-1 ops-coh-tlg-1 ops-coh-tlg-2 ops-coh-web-1 ops-coh-web-2
Spring Support on WebLogic
WebLogic-Spring Integration Ongoing Spring Support Develop/deploy Spring apps to WebLogic Supported for multiple WebLogic releases Integration features to host Spring applications Simplified config w/spring pre-configured beans Leverage WebLogic in Spring apps Datasources, JMS, Work Managers Clustering Transactions Monitoring Management Automation Oracle Enterprise Pack for Eclipse Support Spring IDE, DAO generation, Facets Generate JAX-WS from bean Validate Spring config file Easy project configuration and library mgmt Graph view for relationship among Spring Beans WebLogic Admin Server WebLogic Console WebLogic Cluster/Domain Managed Server Spring Apps Java EE Managed Server Spring Apps JEE
Generated Spring MBeans Spring Application Management on WebLogic Automatically Generates a set of Read-Only Spring MBeans off the WebLogic ApplicationRuntimeMBeans SpringApplicationContextRuntimeMBean SpringBeanDefinitionRuntimeMBean SpringRuntimeMBean SpringTransactionManagerRuntimeMBean SpringTransactionTemplateRuntimeMBean SpringViewResolverRuntimeMBean SpringViewRuntimeMBean Provides better visibility into what s happening inside Spring applications running in the WLS container Accessible via WLST or JMX Browser
WebLogic Admin Console Spring Extension Spring Application Management on WebLogic Additional pages added to the WebLogic Admin Console Provides a view of the WebLogic generated MBeans Provides runtime metrics for: Types and amounts of Spring beans that have been created for the deployed applications Application Context Scope and performance metrics of Spring Application beans WebLogic managed transactions that have been initiated via the Spring library code in the deployed application Need to enable the extension in the Admin Console Requires a restart of the server
WebLogic-Injected Spring Beans Spring Application Development on WebLogic WebLogic adds a parent context to a Spring Application Context during the startup of a spring-enabled Web Application Context is pre-populated with the following 3 WebLogic specific beans A WebLogic Transaction Manager bean (ref="transactionmanager") extends org.springframework.transaction.jta.jtatransactionmanager A WebLogic Edit Server MBean Connection bean (ref="editmbeanserverconnection") implements javax.management.mbeanserverconnection A WebLogic Runtime Server MBean Connection bean (ref="runtimembeanserverconnection") implements javax.management.mbeanserverconnection Developers can refer to these WebLogic-specific beans (using the ref ids shown above) and have them injected into application code. Example: a developer may want to inject a reference to the WebLogic ServerRuntime JMX Server into a piece of code, to enable the code to then use JMX to inspect the host server's runtime MBeans, using a Spring declaration similar to the following: <bean id="mytestbean" class="com.acme.mytestbean"> <property name="mbeansvrconn" ref="runtimembeanserverconnection"/> </bean>
Enabling Spring Support in WLS Spring Application Development on WebLogic Deploy weblogic-spring.jar as a Library file in your WebLogic domain Add the following to your application s Manifest.mf file Extension-List: WeblogicSpring WeblogicSpring-Extension-Name: weblogic-spring WeblogicSpring-Specification-Version: 10.3.5.0 WeblogicSpring-Implementation-Version: 10.3.5.0
Custom MBeans with Spring Spring Application Development on WebLogic Spring provides an easy mechanism for creating custom MBeans org.springframework.jmx.export.mbeanexporter Exposes data to generic JMX utilities such as Jconsole, but can also be published to WebLogic s Runtime Mbean Server Accessible from WLST Able to be utilized with WLDF Can be secured
Spring Applications/WLS SCA Container SCA Runtime is installed by default with WebLogic Server Container is imported as a shared library by SCA applications Shared library dependency for SCA SCA Applications have 3 main parts POJO classes that house the application logic Spring context file (no explicit SCDL file) Wires up POJOs Declares SCA services/references with appropriate bindings Weblogic.xml or weblogic-application.xml where shared library is imported SCA application can act as a component is a larger composite within SOA Suite