Tuesday, November 25, 2008

Warsjawa Eclipse DemoCamp 2008

Last week Warsaw JUG held "Warsjawa Eclipse DemoCamp 2008" event. I'd had a chance to help a bit with preparations (blame me if you don't like the T-shirt ;). As it was not meant to be a big conference the numbers are quite impressive: 153 attendees! Łukasz and Jacek have already written more complete reviews on their blogs (in Polish). I will just leave you with photos ;)

Tuesday, July 29, 2008

Embedded OpenDS 1.0.0

I was recently playing with OpenDS LDAP server 1.0.0. As its pure Java implementation it is used in embedded mode in JBoss AS and JBoss Portal testsuites. What is so cool about embedded OpenDS and why you should look at it?
  • It requires only two jar files for basic features support
  • Just few lines of code for management operations are needed.
  • Community on the mailing lists is very responsive
There are few good resources describing how to embed OpenDS available on the web:
However as the project evolves rapidly they don't cover the most recent 1.0.0 version. Here are few simple steps needed to bootstrap OpenDS from Java code:

  1. Download OpenDS 1.0.0 and unzip it.
  2. Fire the 'setup' config script from the main directory and alter the configuration as you need. Remember to shutdown the server if you let to start it.
  3. Embedded OpenDS will require a special directory structure to be able to start. All needed files can be copied from the server directory and are shown on the picture below:

    The 'db' directory can be left empty if you want to add the root entry manually in the code

  4. Copy OpenDS.jar and je.jar files from OpenDS-1.0.0/lib/ directory and add them to the project classpath
  5. Edit opends/config/config.ldif and remove following entry:

    dn: cn=SNMP Connection Handler,cn=Connection Handlers,cn=config
    objectClass: top
    objectClass: ds-cfg-snmp-connection-handler
    objectClass: ds-cfg-connection-handler
    ds-cfg-listen-port: 161
    ds-cfg-enabled: false
    ds-cfg-trap-port: 162
    ds-cfg-java-class: org.opends.server.snmp.SNMPConnectionHandler
    cn: SNMP Connection Handler


    (This entry requires to have OpenDS-1.0.0/lib/extensions/snmp-mib2605.jar file on the classpath)
Now with such prepared directory structure OpenDS can be started directly from the Java code. Belpw there is a very simple class that manages server lifecycle - it just needs two jar files in the classpath (OpenDS.jar and je.jar)




public class OpenDSService
{
private String serverRoot = "";

public DirectoryEnvironmentConfig getConfig()
{
DirectoryEnvironmentConfig config = new DirectoryEnvironmentConfig();

try
{

// Server root points to the directory with opends configuration
config.setServerRoot(new File(getServerRoot()));
config.setForceDaemonThreads(true);

}
catch (InitializationException e)
{
e.printStackTrace();
}

return config;
}


public void start()
{
if (!EmbeddedUtils.isRunning())
{
try
{
EmbeddedUtils.startServer(getConfig());
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

public void stop()
{
if (EmbeddedUtils.isRunning())
{
EmbeddedUtils.stopServer(this.getClass().getName(), null);
}
}

public String getServerRoot()
{
return serverRoot;
}

public void setServerRoot(String serverRoot)
{
this.serverRoot = serverRoot;
}
}





Here there is a trivial example maven project that starts opends and performs simple JNDI search.

Thursday, June 12, 2008

Book Review: Business Process Management with JBoss jBPM

Probably all of you have a private list of technologies that you want to look more deeply at but don't have much time to do so because of other duties. BPM was one of those on my private list so when Packt Publishing asked me to write a review of their book "Business Process Management with JBoss jBPM" I decided it was the right moment to give it a try. Although a subtitle on the main page states that it is "A Practical Guide for Business Analysts" it turns out a perfect position for anyone who does a first look on the technology.

The author begins with a brief high level overview of what Business Process Management is and what benefits it can give to the enterprise. Then we are introduced to the example project case study - Bland Records Inc. and it explains the whole context of introducing BPM in real life and unveil all the non-technical aspects of it. Step by step we learn how to work with people to discover all the processes that are defined in the company and how to describe and improve them.

The book goes step by step through the whole process from gathering requirements to deploying complete system and introducing it to the real users. The amount of technical knowledge required from the reader is really low. At some points it can be even a bit boring for a JEE developer to read about how to install Java on Windows machine and configure MySQL database with JBoss Application Server, but it gives an opportunity to quickly learn all the basics of jBPM framework. Author shows how to leverage JBoss Developer Studio for most of tasks described in the book. It also covers Business Activity Monitoring and explains integration with the SeeWhy Business Intelligence platform.

All activities described in the book are illustrated with lots of screenshots, diagrams and dialogs. It is written with a very easy informative style. The author achieved a good balance between explaining the methodology behind introducing BPM in the company and technical details about jBPM framework. I can recommend this book to anyone who wants to quickly gain a base knowledge about jBPM.