Friday, September 28, 2007

IBM Rational Clear Case vs. Continuum Build Server

and how to install a Business Module on a Build-Server. I haven't blogged for a long time now because I was/am very busy at work and also university starts next week and I had/still have to do some prep-work for it.
In this post I'd like to write a tutorial about how to install a Business Module on the Continuum Build-Server. This so-called Business Module is a company-specific multi-module Maven-project which stands under version-controll of IBM's Rational Clear Case.
In the following screenshot you're able to see the directory-structure of the Business Module in an Editor-View of Clear Case on my local workstation. This view shows a so-called Dynamic View of the Business Module.
From Misc


My upcoming task is to create a View of the Business Module's Integration Stream on another workstation within the company's intranet. Why do I have to do this?

The Continuum Build-Server only handles Maven-Projects on the same machine as the server is installed. God thanks on this server there is also a version of IBM Rational Clear Case installed so it won't be a problem to get the Business-Module deployed on Continuum.

So, the first thing to do is to start a Remote-Desktop-Control and connect to the server where everything is installed. The next step is to open the Project Explorer which is a sub-application of Clear Case. You will be able to see this explorer in the next screenshot.

From Misc


You now have to select the Business Module's Integration Stream of which you want to create a View. In my case I have to select the OMDev_Int. Right click the Integration Stream and choose 'Create View...'

From Misc


A new window will pop-up. In this window you can leave all the selected options and click Next.

From Misc


Now choose the directory where you would like to copy all the Business Module's files and optionally enter a corresponding comment and then click next.

From Misc


In the wizzard's next screen you are able to choose the components which you would like to copy to your workstation. In my case I only need the OMSrc component. Click next. A confirmation screen appears and again click next.

From Misc


Now all the sources will be copied to the path which you have entered a couple of screens before.

From Misc


If everything worked out fine you should see a 'View successfully created'-screen as the following.

From Misc

Now open your Clear Case Explorer and press Alt+F5. This shortcut will refresh your Clear Case View Shortcuts and then you'll be able to see the new Business Module with all your chose components.

From Misc

New Business Module wiht Src-component.
From Misc

The next step is to install the Business Module on Continuum Build-Server. So, open your Web Browser and start your Continuum installation.

From Misc

Login and press the 'Maven 2.0+Project' button under the category 'Add Project'.
From Misc

Now here comes the tricky-part. Continuum will have problems with your pom.xml file because it stands under version-control and hence it is read-only. Here comes the workaround: You have to create a new pom-file and call it something like 'pom1.xml'.

From Misc

Now you will have to copy the whole content of the original pom and paste it to the newly created one. Continuum has problems with mulit-module projects so if you want to browse for the file you have to delete all the modules, assumed you have configured one in the pom-file, and then Continuum won't have any troubles anymore.

From Misc

After pressing the Submit-button you should see something like the following screen:

From Misc

Now you can confiugre your build-settings for the new Business-Module. If you also have a multi-module project you will ask yourself how it will work that all the modules which you have deleted previously in your pom1.xml will now also build in Continuum. The answer is: If you configure your Build Definition you will be able to configure the old pom.xml by passing the path to it. You can see my settings in the following screen:

From Misc

So now, if you invoke the build with these settings all the sub-modules will also be build. Tricky ha, but very effective ;o) You don't believe me? Swich to your 'Working Copy'-view of your project and then you will see all modules which are configured in your original pom.xml file.

From Misc

And, what's your result? Are you also able to see something like the follwing:
From Misc

Happy Mavin'-Continuumin'-CCin'

Cheers

Wednesday, September 05, 2007

NetBeans Platform | GUIs

  • GUI Builder Matisse.
  • New Layout Manager: GroupLayout.
  • Form always will look like a native application on any OS.
  • If creating a new GUI-form there will be two files. A Java and a XML (form's layout) file.
  • Options Panel, Wizard, WIndow Component
  • Platform provides the infrastructure of event handling by generating the code to link the occurrence of each event invocation of a private method in the form class.
  • Connection Wizard for generating event infrastructure code.
  • TODO

Cheers

Sunday, September 02, 2007

Enterprise Java Beans

  • Wieder verwendbare Software Komponenten
  • EJBs Kapseln Anwendungslogik
  • Verfügen über keine Darstellungskomponente
  • Der Einsatz von EJBs lohnt sich erst ab mittelgroßen Systemen bei der verschieden Applikation auf die gleiche Businesslogik zugreifen.
  • EJB-Container ist notwendig

Aufgaben eines EJB-Containers

  • Überwachung des Lebenszyklus von EJBs
  • Instanzen-Pooling
  • Namens- und Verzeichnisdienst
  • Transaktionsdienst
  • Nachrichtendienst (Message Service)
  • Persistenz

Beans

  • In sich geschlossene Software-Komponente

JavaBeans

  • Eine JavaBean inst eine wiederverwendbare Software-Komponente, die mit einem Builder-Tool visuell manipuliert werden kann.
  • JavaBeans ist nichts anderes, als eine Sammlung von Eigenschaften einer (grafischen) Komponente.
  • Datencontainer mit bestimmten Eigenschaften eines Objekts.
  • Erlaubt diese Eigenschafte auch dynamisch zu erkennen und per Reflection zu manipulieren.
  • Konzentriert sich im Wesentlichen auf die Persistenz dieser Eigenschaften.

Enterprise JavaBeans (EJB)

  • Die EJB-Spezifikation beschreibt nun ein Framework, dass die verteilte Verarbeitung von transaktionsorientierter Geschäftslogik ermöglicht.
  • Bleiben für den Benutzer stehts verborgen.
  • Werden im Wesentlichen durch die APIs und Services definiert.
  • Kern der EJB-Technologie ist der Methoden-Fernaufruf (RMI).
  • Stub, Skeleton, Broker
  • Restriktionen siehe J2EE Codebook Seite 604

Entity Beans

  • Schnittstelle zur Datenbank oder anderen persistenten Speichermedien.
  • Repräsentieren ein Objekt der Business Logic.
  • Bean Managed Persistence vs Container Managed Persistence
  • Muss immer einen Primary Key besitzen.
  • Lebenszyklus siehe J2EE Codebook Seite 605

Session-Beans

  • Implementieren Geschäftsprozesse (e.g. Überweisung zwischen Konten)
  • Session-Beans operieren auf Entity-Beans
  • Stateful-/Stateless Session-Beans
  • Stateful Session-Bean: Für die gesamte Dauer des Session dem Client zugeordnet
  • Stateless Session-Bean: können auch unbemerkt innerhalb einer Session ausgetausht werden (vom Client unbemerkt).

Stateless Session-Beans

  • Diese vergessen, nachdem eine Operation abgeschlossen ist, den Client augenblicklich und können zu keinem Zeitpunkt entscheiden, ob sie mit dem aktuellen Client schon einmal verbunden waren.
  • Werden vom Container über einen Pool verwaltet.
  • Es ist nicht möglich Werte in einer Instanzvariable zu speichern.
  • Von ihnen bereitgestellten Methoden ähneln damit statischen Klassenmethoden.

Stateful Session-Beans

  • Können ihren Zustand in Instanzvariablen speichern. => Koversationsgedächtnis.
  • Client arbeitet stets mit der gleichen Instanz.
  • Verfügen über einen inneren Zustand, der häufig den Zustand und Fortschritt eines bestimmten Geschäftsprozesses darstellt.

Message Driven Beans

  • Ermöglichen ansynchrone Kommunikation von EJB-Komponenten über den Java Message Service (JMS).
  • Sind im Grunde erweiterte Stateless Session-Beans bei denen die Partner nicht mehr aufeinander warten müssen und parallel weiterarbeiten können.
  • Hinterlassen eine Nachricht (mit gewünschter Operation) im MessageQueue des Empfängers und schauen von Zeit zu Zeit in Ihrem Eingang, ob eine Antwort vorliegt.
  • Client kommuniziert nur über eine MessageQueue mit MDB.
  • Besitzen keinen inneren Zustand.

Bestandteile einer EJB

  • In der Regel besteht eine EJB aus mehreren Java-Klassen.
  • Home-Interface dient dazu, die Bean zu erzeugen.
  • Home-Interface muss von EJBHome abgeleitet werden.
  • Über das Remote-Interface kommuniziert der Client mit der entfernten EJB.
  • Dieses deklariert alle Methoden die der Client auf dem Objekt aufrufen kann.
  • EJB-Implementierung bildet den Kern der EJB-Anwendung und nimmt die gewünschte Geschäftslogik auf, implementiert die Methoden des Remote- und des Home-Interface, die erforderliche interne Repräsentation der Daten sowie Methoden, über die der EJB-Container die Bean verwaltet.

Eine Session-Bean erstellen

  • TODO

JNDI

  • Es handelt sich bei JNDI um eine Schnittstelle.
  • Die konkrete Implementierung wird auch Service Provider Interface genannt.
  • Naming Service = Name assoziiert mit einem Objekt
  • Directory Service = Zusätzlich können auch noch Attribute (read/write) gesetzt werden.
  • Beim Naming Service müssen die Objekte aller Kontexte von ein und demselben Typ sein.
  • Kontext = Suche, Auflistung von Objekten sowie die Erstellung und das Löschen von Einträgen.
  • Ermöglicht es, flexible Verbindung zwischen unseren Komponenten zu verwenden und diese damit zu entkoppeln.

Naming Services

  • Verbindet eine Menge von Namen mit Objekten eines bestimmten Typs.
  • Diese können in einem Kontext abgelegt werden.
  • Syntaxregel = Naming Conventions
  • Atomic Name (e.g sun), Compound Name (e.g. java.sun.com), Composite Name (e.g. java.sun.com/home/index.jsp)
  • Namenskonventionen Buch Seite 182

Directory Services

  • Ein Directory ist eine Menge von Verzeichnisobjekten, Directory Entries, welche bestimmten Objekten oder Referenzen auf Objekten zugeordnet sind. Im Gegensatz zu den Naming Services sind Attribute möglich.
  • Klassisches Beispiel => Telefonbuch
  • RDBMS vs DS Buch Seite 184
  • DS => über das Netzwerk verteilte, hierarchische Datenbank, die auf einem Client/Server-Prinzip basiert.

LDAP

  • Unterstützt im wesentlichen den Zugriff auf Verzeichnisse und emuliert andere Funktionen lediglich.

How To

  • File System Service Provider speichert gebundene Objekte in versteckter Datei (.bindings), die sich unter Windows im Root-Verzeichnis des aktuellen Laufwerks befindet.