Posts tagged Java
Java Callout in Mediator to Automatically Deal With Empty Elements
Mar 18th
One of the most annoying things with XML Schema validation is that it will not accept empty elements of certain types, like xsd:date and xsd:double, even though the element is defined as optional (minOccurs=”0″). OK, I do understand that an empty element _does_ occur, and that this behaviour is therefore correct, but the implication is that developers will have to add <xsl:if> tags in their XSLT transformations around each and every element where this may cause a problem.
This article will show how using a small and generic Java class and the “Java Callout” feature of the 11g Mediator, we can automatically “fix” these empty elements so that they will not cause problems with schema validation any more. Read the rest of this entry »
Complex Event Processing – Java Magazine – Sources & References
Feb 25th
This article contains the resources for an article on Complex Event Processing (using Oracle CEP) that is published in the March 2010 issue of the Dutch Java Magazine. This article describes the interaction between CEP and Java Applications, using examples of temperature sensors that are monitored (aggregating their readings and looking out for any broken sensors) and web shops that try to determine the most popular and the most efficient search terms as well as the search terms that are quite useless (as they never result in a transaction).
The article is in Dutch – it will be made available for download later on. Note that it is based on Chapter 19 in the upcoming Oracle SOA Suite 11g Handbook (Oracle Press, due Summer 2010).
Sources
Temperatuur Simulator en Temperatuur Sensor Processor: TemperatuurSensorenSimulatorEnProcessor
WebApplicatie Analyzer: WebWinkelAnalyse.zip
References & Resources
Download Oracle CEP en CEP Plugin for Eclipse:
Oracle CEP Server: http://www.oracle.com/technology/software/products/cep/index.html
Oracle CEP Plugin voor Eclipse: http://download.oracle.com/technology/software/cep-ide/11/
Installatie instructies:
Setting up your development environment:http://download.oracle.com/docs/cd/E15523_01/doc.1111/e14476/examples.htm#i1013710
Configuring Eclipse:http://download.oracle.com/docs/cd/E15523_01/doc.1111/e14301/ide_intro.htm#CHDDAADG
Creating CEP Servers in Eclipse:http://download.oracle.com/docs/cd/E15523_01/doc.1111/e14301/ide_serv.htm#CHDEJEHC
Documentatie voor CEP ontwikkelaars:
ASCII art as a DSL for unit testing
Feb 16th
Complicated tree structures are being used a lot within my current project. Tree nodes have elements behind them. An element is unique, but there can be multiple tree nodes for a single element. Tree nodes have different drag and drop behavior based on flags on both the tree nodes and the elements. Also tree nodes can inherit children from other tree nodes etc. This blog will be about how to unit test these trees or more exactly how to setup a unit test so that it is fun to create and easy to maintain.
Read the rest of this entry »
SOA Suite 11g – Using Spring Component to mimic Http Binding and integrate RESTful services
Dec 16th
In an earlier post, I showed for the Oracle SOA Suite 11g how we can use the Mediator's Java Callout functionality to integrate RESTful services into our SOA Composite applications, even though we currently have no Http Binding Service nor WSIF support (SOAP Java Binding) at our disposal in the SOA Suite – link to article. In SOA Suite 11g PS1 – released in November 2009 – is the preview (not yet officially supported and only available for PoC and early trials – of Spring components. This feature provides another way of integrating Java classes into our SOA Composite applications.
This article demonstrates how we can use the Spring component to bind our SOA Composite Application to the RESTful Translation service provided by Google.

Leveraging RESTful Services from Java applications using Jersey (Introduction)
Dec 14th
While researching for the Oracle SOA Suite 11g Handbook, I wanted to take a quick look at REST(ful) WebServices and see how those can be integrated into the SCA based SOA Composite Applications that we create with the Oracle SOA Suite. Currently, it does not have the HTTP binding that the 10.1.3 release of the SOA Suite used to have. So what are the alternatives? But first, how does one call a simple HTTP only (no SOAP/WS*) service from a piece of Java code? With as little programming and as much framework lifting as possible.
One of the frameworks available for RESTful operations is Jersey – a framework that should be more REST aware than plain HTTP communication oriented libraries like Apache HTTP Client, as well as offer some support for typical formats used in RESTful interactions, such as JSON, XML, RSS, CSV. So let’s create the simples Java application consuming a RESTful service – the Google Translation service – using the Jersey library.
AMIS Query – Verslag van Oracle Open World 2009 – dinsdag 27 oktober (uitnodiging)
Oct 23rd
Vorige week was in San Francisco het hoogtepunt van het Oracle jaar: Oracle Open World 2009, de grootste IT conferentie ter wereld. Tijdens deze conferentie ontvouwde Oracle haar strategie en visie voor de komende periode, lieten product managers de nabije toekomst zien van bestaande en nieuwe producten, deelden honderden specialisten hun ervaringen en toonden leveranciers en Oracle engineers op de demo-grounds de nieuwste snufjes. Ca. 40.000 bezoekers waren aanwezig in het hart van San Francisco om zich vijf dagen lang te laten overvoeren met Oracle weetjes.
Als je er bij was vind je het misschien leuk nog eens herinneringen op te halen en ervaringen te bespreken. Als je er niet bij was ben je misschien geinteresseerd in de belangrijkste aankondigingen, de mooiste demo’s en wetenswaardigste feiten. Dat kan, aanstaande dinsdag op de AMIS Query – Verslag van Oracle Open World 2009. In deze (gratis) sessie doet de AMIS-delegatie naar OOW (Marco Gralike, Peter Ebell en Lucas Jellema) verslag van de conferentie. Je bent van harte welkom om daarbij aanwezig te zijn. Vanaf 17.30 serveren wij een diner, om 18.30 start de sessie die duurt tot pakweg 21.00 uur. Om je aan te melden, ga naar: registreren AMIS Query OOW 2009.
In deze sessie komen onder andere de volgende onderwerpen aan bod:
OOW 2009: James Gosling speaking at Oracle Open World
Oct 13th
James Gosling, the "father of Java", is the hero, the star, the god of many Java conferences such as JavaOne. I have seen the adoration and worship, as recently as four months ago at JavaOne 2009. Yesterday I witnessed a performance by James Gosling in a very different setting. At Oracle Open World (at least three times the size of JavaOne) he is seen by many as ‘just an interesting looking gray haired fellow in a T-Shirt and jeans’.

They are somewhat surprised that Ted Farrell, chief architect of Oracle middleware development technology, makes way for this old geezer. And some even leave the room – how interesting can his story be. After the session, I run into James on the escalators, wearing his jeans, T-Shirt and bagpack with laptop – just like 1000s of other attendants on this conference. Of course he is still recognized by many, but he is slightly out of the universe that revolves around him in a setting that has yet to get to know him and appreciate him. I can imagine that must be tough. Or a nice challenge, see how to win this audience over too. One way of doing that is of course by throwing gadgets into the audience – a favorite stunt of his – and he donated a few dozen Dukes this time.
Anyway, he did a good job of explaining to this developer audience what Sun was doing, what the scale is of Java activity around the world and across technology platforms. He fondly plugged NetBeans – standing next to guy who is responsible for Oracle JDeveloper as well as the extensive range of Oracle tooling for Eclipse – indicating how it has specializations in many different areas, JEE and also the other languages that run on the JVM. He stated that magic of Java is not in the programming language as such, but is in he JVM. In saying so he seemed to warmly embrace languages such as Ruby/Rails, Groovy/Grails, Scala, Pyhton, PHP and others that can run on the JVM- and integrate together in the JVM. Gosling at this point also plugged Kenai – a cloud based developer environment, a much advanced version of SourceForge.
Publish a WebService from a POJA (plain old Java application) – that is: out of the container using EndPoint class
Jun 5th
This very brief article will demonstrate a very useful feature of Java 6 Standard Edition – that means: the Java as it is running in any stand-alone application. It is possible – and even extremely simple as it turns out – to have a Java SE application publish a (SOAP) WebService. That is: without using a Web Server or Application Server, your Java application can receive WebService calls. I had heard about this but could not actually believe that I understood correctly. When I met Gerard Davison this week – a very nice and knowledgeable guy working on web services tools for the JDeveloper IDE – he confirmed and explained it to me.
Through the EndPoint class – part of the JAX-WS implementation – we can instruct the JVM to start receiving SOAP calls on the URL we tell it to listen to and have those calls forwarded to our Java class. Thus it is very simple all of a sudden to for example provide mock implementations of services our BPEL process or ESB needs to invoke. This mechanism makes interoperability between for example .NET and Java very easy – especially in terms of the infrastructure required. And of course in situation where a Java application running outside any container make a call to an Asynchronous WebService – this is the basis of the answer to the question how the asynchronous response can be handed back to the application. See for example Gerard’s article on this: Calling Asynchronous WebServices from Java application. Read the rest of this entry »
Last preprations and first impressions from JavaOne 2009 – guess who is not a sponsor (not even an iron or wood level?)
Jun 1st
As JavaOne – preceded by CommunityOne which kicks off tomorrow morning – is approaching fast, this might be a good moment to discuss some of the early rumours, the expectations and certainly the questions that this year’s edition of JavaOne will hopefully answer over the next 5 days or so.
One remarkable thing: Last year, Oracle was the platinum sponsor of JavaOne 2008. This year, Oracle acquired Sun (or at least made a deal with Sun’s board of directors). Whether they are now short on cash and could not afford the sponsorship or whether through Sun Oracle will be visible all the same or whatever the reason is: Oracle is not a sponsor and apparently is not even on the Java Pavilion. So Big Red, who swallowed BEA with the WebLogic, Aqualogic and Plumtree products, Collaxa/BPEL, Coherence DataGrid, EclipseLink, Apache Trinidad, … , is not very visible. I noticed a few presentations by Oracle speakers, so there is some presence but it is minimal.
So who are the big sponsors? Read the rest of this entry »
Using asynchronous mechanisms in Java and JavaScript for improving the user experience
Feb 23rd
In this article, we will continue a discussion on asynchronous processing started in a previous article that introduced asynchronous and parallel processing Java using Executors, Futures, Callable Objects and the underlying thread model in Java 5 and 6.
While a stand alone Java application – without UI – is a rare thing in my world, a Java Web application certainly is not. And performance, especially perceived performance, is pretty important in that world. The first page load is the most important measure I suppose for what the user feels is the performance of the web application. The fact that after the initial load, additional elements can be loaded into the page – asynchronously – is fine. The intial page load and the browser’s indication that the load is done (and the hourglass disappears) is what is most important for the happiness of the user.
We will see three stages in this article, of a very simple web page. It is a JSF (JavaServer Faces) page, that contains some very simple elements of which one displays an ‘expensive’ value – a value that takes some time to get hold of. Maybe because a database query is involved or web service is called. Whatever the cause, this one element is expensive. Read the rest of this entry »


