Distributed Installation

This type of deployment can be done for better performance and scalability, achieved by deploying the Infinity Process Platform Portal and Infinity Process Platform engine in two different application servers.

You can for example deploy the Infinity Process Platform Portal to a Tomcat servlet container and the Infinity Process Engine to a separate EJB Application server. Here you could use the Tomcat container to service all Web requests and HTML rendering while the JBoss container services all EJB requests and processing of daemons and events.

The following sections discuss the deployment of the Infinity Process Platform Portal to a Tomcat servlet container and the Infinity Process Engine to a separate EJB Application server. This deployment utilizes the Tomcat container to service all Web requests and HTML rendering while the JBoss container services all EJB requests and processing of daemons and events.

It is noted that other approaches may work in setting up a distributed Infinity Process Platform environment that may use other technologies for the Web tier such as an EJB container like WebLogic, JBoss, WebSphere or Tomcat with OpenEJB. The approach outlined in the following sections utilize the native capabilities of the Tomcat server without any EJB extensions.

Prerequisites

The following sections discuss using Tomcat to host the Web tier of a Infinity Process Platform system while JBoss hosts the business and data access tiers of the Infinity Process Platform system.

The following sections are based on a carnot.ear deployment. Use the preconfigured deployment configurations provided by Infinity:

Please refer to chapter Creating a Runtime Environment with Apache Maven in the Installation Guide section Maven Archetypes of our Infinity Process Platform Wiki Maven/Basic Setup page for details on how to retrieve these configurations.

JBoss

Follow all the prerequesites outlined in the JBoss deployment handbook such as setting up JDBC Drivers, XA Connection Factory and JMS Queues. This information is found in the JBoss Deployment Guide.

Custom Resource Factory

Since servlet containers such as Tomcat do not have the ability to defined EJB resources in the deployment descriptors, a custom resource factory must be created and utilized to create the home interfaces for the EJBs running within the remote JBoss server. Since Infinity Process Platform utilizes resources named  "ejb/<ServiceName>", a custom resource factory must be created that can translate local resource naming lookups into remote EJB home references located in the remote JBoss server. The following code must be added to the Infinity Process Platform Portal WAR file.

The custom resource factory class file can either be placed in the WEB-INF/classes directory or placed in a JAR file that is located in the WEB-INF/lib directory of the WAR file.

package carnot.custom;

import java.util.Enumeration;
import java.lang.Exception;
import java.util.Hashtable;
import java.util.Properties;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.RefAddr;
import javax.naming.Reference;

public class RemoteEJBFactory implements javax.naming.spi.ObjectFactory 
{

	private final static String JNDINAME = "jndi-name";
	
	public Object getObjectInstance( Object obj, javax.naming.Name name,
			javax.naming.Context context, Hashtable hashtable) throws Exception
	{
		Object home = null;
		String jndiName = null;
		String factory = null;
		String url = null;
		String pkgPrefixes = null;

//		Class referenceClass = Class.forName("org.apache.naming.EjbRef");
		String parameterName;
		String parameterValue;
		RefAddr address = null;
		Properties env = new Properties();
//			Obtain the reference to the parameters defined in ResourceParams
		Reference reference = (Reference)obj;
//			Process all the parameters

		Enumeration parameters = reference.getAll();
		while (parameters.hasMoreElements())
		{
			address = (RefAddr)parameters.nextElement();
			parameterValue = address.getContent().toString();
			parameterName = address.getType();
			if (parameterName.equals(Context.INITIAL_CONTEXT_FACTORY))
				factory = parameterValue;
			else if (parameterName.equals(Context.PROVIDER_URL))
				url = parameterValue;
			else if (parameterName.equals(Context.URL_PKG_PREFIXES))
				pkgPrefixes = parameterValue;
			else if (parameterName.equals(JNDINAME))
				jndiName = parameterValue;
		}

//			Only do the lookup when there is a defined jndi-name parameter
		if (jndiName != null)
		{
			if (url == null) throw new Exception( "Naming URL not defined.");
			if (factory == null) throw new Exception( "Naming Factory not defined.");
			if (pkgPrefixes == null) throw new Exception( "Naming Package Prefixes not defined.");

			env.put(Context.INITIAL_CONTEXT_FACTORY, factory);
			env.put(Context.PROVIDER_URL, url);
			env.put(Context.URL_PKG_PREFIXES, pkgPrefixes);

			home = (new InitialContext(env)).lookup(jndiName);
		}
		else
		{
			throw new Exception( "JNDI Name missing for Resource - " + name.toString());			
		}
		return home;
	}
}
	

Deployment

Server

The following sections discuss preparation of the Infinity Process Engine Enterprise Application Archive (EAR) file prior to deployment into the JBoss Application server.

The Infinity Process Platform provides EAR files for the Infinity Process Platform Engine that with minor modifications can be re-added for deployment into a JBoss Application Server.

The procedures require unpacking the EAR file, making the appropriate changes, and re-packing the EAR file.

Procedures

Client

The following sections discuss preparation of the Infinity Process Platform Web Application Archive (WAR) files prior to deployment into the Tomcat servlet container.

The Infinity Process Platform components provide a WAR file for the Infinity Process Platform Portal that with minor modifications can be re-added for deployment into a Tomcat Servlet container. This file is located in the carnot.ear file and is named ipp-portal.war.

The procedures require to copy the WAR file from the original carnot.ear file, unpacking the WAR file, making the appropriate changes, and re-packing the WAR file.

Procedures