In this post, we build a JavaServer Faces application that uses JBoss RichFaces components. The application communicates with Coherence in order to store data. Before we get all excited let us start with the WebLogic set-up. The WebLogic environment, next to the AdminServer and the Node Manager, has two managed servers that are clustered. For the different components (JBoss RichFaces, JavaServer Facelets and Coherence) we create the following shared libraries. The coherence-3.7.war shared library has the following contents:

coherence-3.7
	META-INF
		MANIFEST.MF
	WEB-INF
		lib
			coherence.jar

in which the MANIFEST.MF contains:

Manifest-Version: 1.0
Created-By: 1.6.0_05 (BEA Systems, Inc.)
Extension-Name: coherence
Specification-Title: Coherence Library
Specification-Version: 3.7
Specification-Vendor: Middleware Magic
Implementation-Title: Coherence Library
Implementation-Version: 3.7.1
Implementation-Vendor: Middleware Magic

The jsf-1.2.war shared library has the following contents:

jsf-1.2
	META-INF
		MANIFEST.MF
	WEB-INF
		lib
			jsf-api.jar
			jsf-facelets.jar
			jsf-impl.jar
			jstl-api-1.2.jar
			jstl-impl-1.2.jar

in which the MANIFEST.MF contains:

Manifest-Version: 1.0
Created-By: 1.6.0_05 (BEA Systems, Inc.)
Extension-Name: JSF
Specification-Title: JavaServer Faces Library
Specification-Version: 1.2
Specification-Vendor: Middleware Magic
Implementation-Title: JavaServer Faces Library
Implementation-Version: 1.2.14
Implementation-Vendor: Middleware Magic

The jboss-richfaces-3.3.war shared library has the following contents:

jboss-richfaces-3.3
	META-INF
		MANIFEST.MF
	WEB-INF
		lib
			commons-beanutils-1.7.0.jar
			commons-collections-3.2.jar
			commons-digester-1.8.jar
			commons-logging-1.0.4.jar
			jhighlight-1.0.jar
			richfaces-api-3.3.1.GA.jar
			richfaces-impl-3.3.1.GA.jar
			richfaces-ui-3.3.1.GA.jar

in which the MANIFEST.MF contains:

Manifest-Version: 1.0
Created-By: 1.6.0_05 (BEA Systems, Inc.)
Extension-Name: jbossrichfaces
Specification-Title: JBoss RichFaces Library
Specification-Version: 3.3
Specification-Vendor: Middleware Magic
Implementation-Title: JBoss RichFaces Library
Implementation-Version: 3.3.1
Implementation-Vendor: Middleware Magic

When the shared libraries are created deploy these libraries to the cluster.

Set-up Coherence

Next, let us see if we can get Coherence to work in a WebLogic cluster. We create one entity, i.e.,

package model.entities;

import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.io.pof.PortableObject;

import java.io.IOException;

public class Klant implements PortableObject {

    private Integer klantnummer;
    private String naam;
    private String adres;
    private String stad;
    private String provincie;
    private String postcode;
    private Integer gebied;
    private String telefoonnummer;
    private Integer reputatieNummer;
    private Double kredietlimiet;
    private String commentaar;

    public Klant() {
    }

    public Integer getKlantnummer() {
        return klantnummer;
    }

    public void setKlantnummer(Integer klantnummer) {
        this.klantnummer = klantnummer;
    }

    public String getNaam() {
        return naam;
    }

    public void setNaam(String naam) {
        this.naam = naam;
    }

    public String getAdres() {
        return adres;
    }

    public void setAdres(String adres) {
        this.adres = adres;
    }

    public String getStad() {
        return stad;
    }

    public void setStad(String stad) {
        this.stad = stad;
    }

    public String getProvincie() {
        return provincie;
    }

    public void setProvincie(String provincie) {
        this.provincie = provincie;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public Integer getGebied() {
        return gebied;
    }

    public void setGebied(Integer gebied) {
        this.gebied = gebied;
    }

    public String getTelefoonnummer() {
        return telefoonnummer;
    }

    public void setTelefoonnummer(String telefoonnummer) {
        this.telefoonnummer = telefoonnummer;
    }

    public Integer getReputatieNummer() {
        return reputatieNummer;
    }

    public void setReputatieNummer(Integer reputatieNummer) {
        this.reputatieNummer = reputatieNummer;
    }

    public Double getKredietlimiet() {
        return kredietlimiet;
    }

    public void setKredietlimiet(Double kredietlimiet) {
        this.kredietlimiet = kredietlimiet;
    }

    public String getCommentaar() {
        return commentaar;
    }

    public void setCommentaar(String commentaar) {
        this.commentaar = commentaar;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }

        if (object == null) {
            return false;
        }

        if (!(object instanceof Klant)) {
            return false;
        }

        Klant klant = (Klant) object;
        return klantnummer.equals(klant.getKlantnummer());
    }

    @Override
    public int hashCode() {
        if (klantnummer != null) {
            return 37 * klantnummer.hashCode();
        } else {
            return System.identityHashCode(this);
        }
    }

    @Override
    public String toString() {
        return naam + ", " + adres;
    }

    public void readExternal(PofReader reader) throws IOException {
        setKlantnummer(reader.readInt(0));
        setNaam(reader.readString(1));
        setAdres(reader.readString(2));
        setStad(reader.readString(3));
        setProvincie(reader.readString(4));
        setPostcode(reader.readString(5));
        setGebied(reader.readInt(6));
        setTelefoonnummer(reader.readString(7));
        setReputatieNummer(reader.readInt(8));
        setKredietlimiet(reader.readDouble(9));
        setCommentaar(reader.readString(10));
    }

    public void writeExternal(PofWriter writer) throws IOException {
        if (getKlantnummer() != null) {
            writer.writeInt(0, getKlantnummer());
        }
        if (getNaam() != null) {
            writer.writeString(1, getNaam());
        }
        if (getAdres() != null) {
            writer.writeString(2, getAdres());
        }
        if (getStad() != null) {
            writer.writeString(3, getStad());
        }
        if (getProvincie() != null) {
            writer.writeString(4, getProvincie());
        }
        if (getPostcode() != null) {
            writer.writeString(5, getPostcode());
        }
        if (getGebied() != null) {
            writer.writeInt(6, getGebied());
        }
        if (getTelefoonnummer() != null) {
            writer.writeString(7, getTelefoonnummer());
        }
        if (getReputatieNummer() != null) {
            writer.writeInt(8, getReputatieNummer());
        }
        if (getKredietlimiet() != null) {
            writer.writeDouble(9, getKredietlimiet());
        }
        if (getCommentaar() != null) {
            writer.writeString(10, getCommentaar());
        }
    }
}

Here, we have implemented PortableObject. The corresponding POF configuration file looks as follows:

<pof-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://xmlns.oracle.com/coherence/coherence-pof-config"
            xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-pof-config coherence-pof-config.xsd">
    <user-type-list>
        <include>coherence-pof-config.xml</include>
        <user-type>
            <type-id>1001</type-id>
            <class-name>model.entities.Klant</class-name>
        </user-type>
    </user-type-list>
    <allow-interfaces>true</allow-interfaces>
    <allow-subclasses>true</allow-subclasses>
</pof-config>

We perform basic cache operations (get, put and remove) for which we define the following interface

package model.logic;

import java.io.Serializable;
import java.util.List;

public interface GenericDAO<T, ID extends Serializable> {
    public void addEntity(ID id, T entity);

    public void removeEntity(ID id);

    public T findEntity(ID id);

    public List<T> findEntities();
}

The interface can be implemented as follows:

package model.logic;

import com.tangosol.net.CacheFactory;
import com.tangosol.net.NamedCache;
import com.tangosol.util.ValueExtractor;
import com.tangosol.util.extractor.ChainedExtractor;
import com.tangosol.util.filter.EqualsFilter;

import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

public abstract class GenericCoherenceDAO<T, ID extends Serializable> implements GenericDAO<T, ID> {

    private Class<T> persistentClass;
    private NamedCache namedCache;

    public GenericCoherenceDAO() {
        Type type = getClass().getGenericSuperclass();
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            setPersistentClass((Class<T>) parameterizedType.getActualTypeArguments()[0]);
        } else {
            System.out.println("Not an instance of parameterized type: " + type);
        }

        setNamedCache(CacheFactory.getCache(getPersistentClass().getName()));
    }

    public Class<T> getPersistentClass() {
        return persistentClass;
    }

    public void setPersistentClass(Class<T> persistentClass) {
        this.persistentClass = persistentClass;
    }

    public NamedCache getNamedCache() {
        return namedCache;
    }

    public void setNamedCache(NamedCache namedCache) {
        this.namedCache = namedCache;
    }

    public void addEntity(ID id, T entity) {
        getNamedCache().put(id, entity);
    }

    public void removeEntity(ID id) {
        getNamedCache().remove(id);
    }

    public T findEntity(ID id) {
        return (T) getNamedCache().get(id);
    }

    public List<T> findEntities() {
        ValueExtractor extractor = new ChainedExtractor("getClass.getName");
        Set keys = getNamedCache().keySet(new EqualsFilter(extractor, getPersistentClass().getName()));
        return new ArrayList<T>(getNamedCache().getAll(keys).values());
    }
}

Specific entity functionality is implemented in entity specific DAOs, for example,

package model.logic;

import model.entities.Klant;
import java.util.List;

public interface KlantDAO extends GenericDAO<Klant, Integer> {
    public List<Klant> getKlantData();
}

Which is implemented as follows

package model.logic;

import com.tangosol.net.cache.ContinuousQueryCache;
import com.tangosol.util.Filter;
import com.tangosol.util.QueryHelper;
import model.entities.Klant;

import java.util.*;

public class KlantDAOBean extends GenericCoherenceDAO<Klant, Integer> implements KlantDAO {

    private ContinuousQueryCache continuousQueryCache;

    public KlantDAOBean() {
        Filter filter = QueryHelper.createFilter("kredietlimiet between 4000.0 and 12000.0");
        continuousQueryCache = new ContinuousQueryCache(getNamedCache(), filter);
    }

    public List<Klant> getKlantData() {
        List<Klant> klanten = new ArrayList<Klant>();
        Iterator<Map.Entry<Integer, Klant>> iterator = continuousQueryCache.entrySet().iterator();
        while (iterator.hasNext()) {
            klanten.add(iterator.next().getValue());
        }
        return klanten;
    }
}

The Coherence cache configuration has the following contents:

<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
              xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
    <defaults>
        <serializer>
            <instance>
                <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
                <init-params>
                    <init-param>
                        <param-type>String</param-type>
                        <param-value>security-pof-config.xml</param-value>
                    </init-param>
                </init-params>
            </instance>
        </serializer>
    </defaults>
    <caching-scheme-mapping>
        <cache-mapping>
            <cache-name>*</cache-name>
            <scheme-name>near-cache</scheme-name>
            <init-params>
                <init-param>
                    <param-name>front-size-limit</param-name>
                    <param-value>1000</param-value>
                </init-param>
                <init-param>
                    <param-name>back-size-limit</param-name>
                    <param-value>250M</param-value>
                </init-param>
            </init-params>
        </cache-mapping>
    </caching-scheme-mapping>
    <caching-schemes>
        <near-scheme>
            <scheme-name>near-cache</scheme-name>
            <front-scheme>
                <local-scheme>
                    <high-units>{front-size-limit 0}</high-units>
                    <expiry-delay>{front-expiry-delay 1m}</expiry-delay>
                </local-scheme>
            </front-scheme>
            <back-scheme>
                <distributed-scheme>
                    <scheme-ref>distributed-cache</scheme-ref>
                </distributed-scheme>
            </back-scheme>
            <invalidation-strategy>none</invalidation-strategy>
            <autostart>true</autostart>
        </near-scheme>
        <distributed-scheme>
            <scheme-name>distributed-cache</scheme-name>
            <service-name>DistributedCache</service-name>
            <thread-count>5</thread-count>
            <backup-count>1</backup-count>
            <backing-map-scheme>
                <partitioned>true</partitioned>
                <local-scheme>
                    <scheme-ref>local-backing-map</scheme-ref>
                </local-scheme>
            </backing-map-scheme>
            <autostart>true</autostart>
        </distributed-scheme>
        <local-scheme>
            <scheme-name>local-backing-map</scheme-name>
            <eviction-policy>hybrid</eviction-policy>
            <high-units>{back-size-limit 0}</high-units>
            <unit-calculator>binary</unit-calculator>
            <expiry-delay>{back-expiry-delay 1h}</expiry-delay>
        </local-scheme>
    </caching-schemes>
</cache-config>

To make sure our cache configuration is used, we create a tangosol-coherence-override.xml with the following contents:

<coherence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns="http://xmlns.oracle.com/coherence/coherence-operational-config"
           xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-operational-config coherence-operational-config.xsd">
    <configurable-cache-factory-config>
        <class-name>com.tangosol.net.DefaultConfigurableCacheFactory</class-name>
        <init-params>
            <init-param>
                <param-type>java.lang.String</param-type>
                <param-value system-property="tangosol.coherence.cacheconfig">security-cache-config.xml</param-value>
            </init-param>
        </init-params>
    </configurable-cache-factory-config>
</coherence>

To test the Coherence set-up we will use the following servlet:

package userinterface.servlets;

import model.entities.Klant;
import model.logic.KlantDAO;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Random;

public class TestServlet extends HttpServlet {

    private Random generator;
    private KlantDAO klantDAO;

    @Override
    public void init() throws ServletException {
        klantDAO = (KlantDAO)getServletContext().getAttribute("klantDAO");
        generator = (Random)getServletContext().getAttribute("generator");
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doTest();
    }

    private void doTest() {
        // generate a random client
        Klant klant = createKlant();
        // insert or update a client - an update is issued when the client already exists
        klantDAO.addEntity(klant.getKlantnummer(), klant);
        if (generator.nextDouble() &lt; 0.001) {
            // remove a client
            klantDAO.removeEntity(generateKlantNummer());
            // get all client data
            klantDAO.findEntities();
            // get data from the continuous query cache
            klantDAO.getKlantData();
        } else {
            // find a client by ID
            klantDAO.findEntity(generateKlantNummer());
        }
    }

    private Klant createKlant() {
        int klantnummer = generateKlantNummer();

        Klant klant = new Klant();
        klant.setKlantnummer(klantnummer);
        klant.setNaam("Middleware" + klantnummer);
        klant.setAdres("Magic");
        klant.setStad("Pune");
        klant.setProvincie("IN");
        klant.setPostcode("1234AB");
        klant.setGebied(1);
        klant.setTelefoonnummer("123-4567");
        klant.setReputatieNummer(1);
        klant.setKredietlimiet(Math.rint(generator.nextDouble() * 5000.0));
        klant.setCommentaar(Long.toString(Math.abs(generator.nextLong()), 36));

        return klant;
    }

    private Integer generateKlantNummer() {
        return generator.nextInt(10000);
    }
}

with the following servlet configuration in the web.xml deployment descriptor:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
           version="2.5">
    <servlet>
        <servlet-name>TestServlet</servlet-name>
        <servlet-class>userinterface.servlets.TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>TestServlet</servlet-name>
        <url-pattern>/test</url-pattern>
    </servlet-mapping>
	<listener>
        <listener-class>userinterface.listeners.ContextListener</listener-class>
    </listener>
</web-app>

in which the ContextListener looks as follows:

package userinterface.listeners;

import com.tangosol.net.CacheFactory;
import model.logic.KlantDAO;
import model.logic.KlantDAOBean;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.Random;

public class ContextListener implements ServletContextListener {

    private ServletContext context;

    public void contextInitialized(ServletContextEvent servletContextEvent) {
        context = servletContextEvent.getServletContext();
        CacheFactory.ensureCluster();

        Random generator = new Random();
        KlantDAO klantDAO = new KlantDAOBean();

        context.setAttribute("generator", generator);
        context.setAttribute("klantDAO", klantDAO);
    }

    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        context.removeAttribute("generator");
        context.removeAttribute("klantDAO");
        CacheFactory.shutdown();
    }
}

By using a ServletContextListener we initialize the Coherence cluster when the servlet context is initialized and shut the Coherence cluster down when the servlet context is destroyed. To ensure that the data in the cluster is maintained when the servlet context is destroyed (for example, by stopping or undeploying the application) can use a default cache server that is started outside of the WebLogic cluster, for example, by using the following start script:

set COHERENCE_MANAGEMENT_OPTIONS=-Dtangosol.coherence.management=all -Dtangosol.coherence.management.remote=true
set COHERENCE_OPTIONS=%COHERENCE_MANAGEMENT_OPTIONS%

set JAVA_HOME=C:\bea\jrockit_160_24_D1.1.2-4
set MEM_ARGS=-jrockit -Xms256m -Xmx256m -Xns64m -Xgc:throughput

set CLASSPATH=C:\documents\IDM\Voorbeelden\Code\Security\lib\Coherence\coherence.jar;C:\documents\IDM\Voorbeelden\Code\Security\out\artifacts\test\test.jar

%JAVA_HOME%/bin/java %MEM_ARGS% %COHERENCE_OPTIONS% com.tangosol.net.DefaultCacheServer

At last a Windows script instead of the preferred (RedHat) Linux. Package the application as a war file and deploy it to the cluster. To this end create the following directory structure:

application-name
	app
		application-name.war
	plan
		WEB-INF (created by WebLogic)
			weblogic.xml
		Plan.xml (created by WebLogic)

When the application is deployed, WebLogic will automatically create a deployment plan (Plan.xml) and the deployment override WEB-INF/weblogic.xml. Add the following contents to the weblogic.xml such that the deployed shared libraries will be picked by the application:

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
				  xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
	<security-role-assignment>
		<role-name>EMPLOYEE</role-name>
		<principal-name>employees</principal-name>
	</security-role-assignment>
	<security-role-assignment>
		<role-name>MANAGER</role-name>
		<principal-name>managers</principal-name>
	</security-role-assignment>
	<library-ref>
		<library-name>coherence</library-name>
		<specification-version>3.7</specification-version>
		<implementation-version>3.7.1</implementation-version>
		<exact-match>true</exact-match>
	</library-ref>
	<library-ref>
		<library-name>JSF</library-name>
		<specification-version>1.2</specification-version>
		<implementation-version>1.2.14</implementation-version>
		<exact-match>true</exact-match>
	</library-ref>
	<library-ref>
		<library-name>jbossrichfaces</library-name>
		<specification-version>3.3</specification-version>
		<implementation-version>3.3.1</implementation-version>
		<exact-match>true</exact-match>
	</library-ref>
</weblogic-web-app>

We also added role mappings to the deployment override, these will be used when we configure security for the application. When the deployment is active, enter the URLs of the test servlet for the servers in the cluster, for example, http://hostname:port/context-root/test. Look in the respective server log files to see how Coherence is doing. The log files are present in the ${DOMAIN_HOME}/servers/<server-name>/logs directory. As the servers are started by the node manager the Coherence log output can be found in the <server-name>.out file. Log output for server1:

2011-10-30 16:10:42.859/212.188 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/coherence/qatg73/WEB-INF/lib/coherence.jar!/tangosol-coherence.xml"
2011-10-30 16:10:42.891/212.220 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/coherence/qatg73/WEB-INF/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2011-10-30 16:10:42.922/212.251 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/security/yzugjc/war/WEB-INF/lib/_wl_cls_gen.jar!/tangosol-coherence-override.xml"
2011-10-30 16:10:42.922/212.251 Oracle Coherence 3.7.1.0 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 3.7.1.0 Build 27797
 Grid Edition: Development mode
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

2011-10-30 16:10:44.109/213.438 Oracle Coherence GE 3.7.1.0 <Warning> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Local address "127.0.0.1" is a loopback address; this cluster node will not connect to nodes located on different machines
2011-10-30 16:10:44.312/213.641 Oracle Coherence GE 3.7.1.0 <D4> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): TCMP bound to /127.0.0.1:8090 using SystemSocketProvider
2011-10-30 16:10:48.203/217.532 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): This Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0xFCDB" with senior Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
2011-10-30 16:10:48.469/217.798 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
2011-10-30 16:10:48.500/217.829 Oracle Coherence GE 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Started cluster Name=cluster:0xFCDB

Group{Address=224.3.7.0, Port=37000, TTL=4}

MasterMemberSet(
  ThisMember=Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer)
  OldestMember=Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
  ActualMemberSet=MemberSet(Size=2
    Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
    Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer)
    )
  MemberId|ServiceVersion|ServiceJoined|MemberState
    1|3.7.1|2011-10-30 16:10:44.312|JOINED,
    2|3.7.1|2011-10-30 16:10:48.359|JOINED
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0
    )
  )

TcpRing{Connections=[1]}
IpMonitor{AddressListSize=0}

2011-10-30 16:10:48.594/217.923 Oracle Coherence GE 3.7.1.0 <D5> (thread=Invocation:Management, member=2): Service Management joined the cluster with senior service member 1
2011-10-30 16:10:48.859/218.188 Oracle Coherence GE 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=2): Loaded cache configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/security/yzugjc/war/WEB-INF/lib/_wl_cls_gen.jar!/security-cache-config.xml"
2011-10-30 16:10:49.219/218.548 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=2): Member 1 joined Service DistributedCache with senior member 1
2011-10-30 16:10:49.359/218.688 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=2): Loaded POF configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/security/yzugjc/war/WEB-INF/lib/_wl_cls_gen.jar!/security-pof-config.xml"
2011-10-30 16:10:49.375/218.704 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=2): Loaded included POF configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server1/tmp/_WL_user/coherence/qatg73/WEB-INF/lib/coherence.jar!/coherence-pof-config.xml"
2011-10-30 16:10:49.500/218.829 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=2): Service DistributedCache joined the cluster with senior service member 1
2011-10-30 16:10:49.766/219.095 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=2): Asking member 1 for 128 primary partitions
2011-10-30 16:15:16.500/485.829 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=2): Member(Id=3, Timestamp=2011-10-30 16:15:16.312, Address=127.0.0.1:8092, MachineId=60314, Location=site:,machine:localhost,process:3320, Role=CoherenceServer) joined Cluster with senior member 1
2011-10-30 16:15:17.125/486.454 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=2): Member 3 joined Service Management with senior member 1
2011-10-30 16:15:17.812/487.141 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=2): Member 3 joined Service DistributedCache with senior member 1
2011-10-30 16:15:18.047/487.376 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=2): 3> Transferring primary PartitionSet{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41} to member 3 requesting 42
2011-10-30 16:15:18.078/487.407 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=2): Transferring 0KB of backup[1] for PartitionSet{42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83} to member 3

Log output for server2:

2011-10-30 16:10:42.859/160.219 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/coherence/jjexem/WEB-INF/lib/coherence.jar!/tangosol-coherence.xml"
2011-10-30 16:10:42.891/160.251 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/coherence/jjexem/WEB-INF/lib/coherence.jar!/tangosol-coherence-override-dev.xml"
2011-10-30 16:10:42.906/160.266 Oracle Coherence 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Loaded operational overrides from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/security/eequ47/war/WEB-INF/lib/_wl_cls_gen.jar!/tangosol-coherence-override.xml"
2011-10-30 16:10:42.922/160.282 Oracle Coherence 3.7.1.0 <D5> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 3.7.1.0 Build 27797
 Grid Edition: Development mode
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

2011-10-30 16:10:43.969/161.329 Oracle Coherence GE 3.7.1.0 <Warning> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Local address "127.0.0.1" is a loopback address; this cluster node will not connect to nodes located on different machines
2011-10-30 16:10:44.188/161.548 Oracle Coherence GE 3.7.1.0 <D4> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): TCMP bound to /127.0.0.1:8088 using SystemSocketProvider
2011-10-30 16:10:47.797/165.157 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): Created a new cluster "cluster:0xFCDB" with Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) UID=0x7F000001000001335561FA58EB9A1F98
2011-10-30 16:10:47.906/165.266 Oracle Coherence GE 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=n/a): Started cluster Name=cluster:0xFCDB

Group{Address=224.3.7.0, Port=37000, TTL=4}

MasterMemberSet(
  ThisMember=Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
  OldestMember=Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
  ActualMemberSet=MemberSet(Size=1
    Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
    )
  MemberId|ServiceVersion|ServiceJoined|MemberState
    1|3.7.1|2011-10-30 16:10:47.812|JOINED
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0
    )
  )

TcpRing{Connections=[]}
IpMonitor{AddressListSize=0}

2011-10-30 16:10:48.047/165.407 Oracle Coherence GE 3.7.1.0 <D5> (thread=Invocation:Management, member=1): Service Management joined the cluster with senior service member 1
2011-10-30 16:10:48.203/165.563 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=1): Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer) joined Cluster with senior member 1
2011-10-30 16:10:48.234/165.594 Oracle Coherence GE 3.7.1.0 <Info> (thread=[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)', member=1): Loaded cache configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/security/eequ47/war/WEB-INF/lib/_wl_cls_gen.jar!/security-cache-config.xml"
2011-10-30 16:10:48.609/165.969 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=1): Member 2 joined Service Management with senior member 1
2011-10-30 16:10:48.953/166.313 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=1): Loaded POF configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/security/eequ47/war/WEB-INF/lib/_wl_cls_gen.jar!/security-pof-config.xml"
2011-10-30 16:10:48.969/166.329 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=1): Loaded included POF configuration from "zip:C:/bea/user_projects/domains/base_domain/servers/server2/tmp/_WL_user/coherence/jjexem/WEB-INF/lib/coherence.jar!/coherence-pof-config.xml"
2011-10-30 16:10:49.062/166.422 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=1): Service DistributedCache joined the cluster with senior service member 1
2011-10-30 16:10:49.750/167.110 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=1): Member 2 joined Service DistributedCache with senior member 1
2011-10-30 16:10:49.812/167.172 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=1): 3> Transferring primary PartitionSet{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127} to member 2 requesting 128
2011-10-30 16:10:49.922/167.282 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=1): 1> Transferring 129 out of 129 partitions to a node-safe backup 1 at member 2 (under 129)
2011-10-30 16:10:49.922/167.282 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=1): Transferring 0KB of backup[1] for PartitionSet{128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256} to member 2

Log output for the default cache server (which is started with the management options -Dtangosol.coherence.management=all and -Dtangosol.coherence.management.remote=true in order to get some insight in the cache statistics):

2011-10-30 16:15:14.062/1.516 Oracle Coherence 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Loaded operational configuration from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/lib/Coherence/coherence.jar!/tangosol-coherence.xml"
2011-10-30 16:15:14.094/1.532 Oracle Coherence 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/lib/Coherence/coherence.jar!/tangosol-coherence-override-dev.xml"
2011-10-30 16:15:14.125/1.563 Oracle Coherence 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Loaded operational overrides from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/out/artifacts/test/test.jar!/tangosol-coherence-override.xml"
2011-10-30 16:15:14.125/1.563 Oracle Coherence 3.7.1.0 <D5> (thread=Main Thread, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified

Oracle Coherence Version 3.7.1.0 Build 27797
 Grid Edition: Development mode
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

2011-10-30 16:15:14.484/1.922 Oracle Coherence GE 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Loaded cache configuration from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/out/artifacts/test/test.jar!/security-cache-config.xml"
2011-10-30 16:15:14.969/2.407 Oracle Coherence GE 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Loaded Reporter configuration from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/lib/Coherence/coherence.jar!/reports/report-group.xml"
2011-10-30 16:15:15.469/2.907 Oracle Coherence GE 3.7.1.0 <Warning> (thread=Main Thread, member=n/a): Local address "127.0.0.1" is a loopback address; this cluster node will not connect to nodes located on different machines
2011-10-30 16:15:15.797/3.235 Oracle Coherence GE 3.7.1.0 <D4> (thread=Main Thread, member=n/a): TCMP bound to /127.0.0.1:8092 using SystemSocketProvider
2011-10-30 16:15:16.188/3.626 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): Failed to satisfy the variance: allowed=16, actual=47
2011-10-30 16:15:16.188/3.626 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): Increasing allowable variance to 19
2011-10-30 16:15:16.516/3.954 Oracle Coherence GE 3.7.1.0 <Info> (thread=Cluster, member=n/a): This Member(Id=3, Timestamp=2011-10-30 16:15:16.312, Address=127.0.0.1:8092, MachineId=60314, Location=site:,machine:localhost,process:3320, Role=CoherenceServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0xFCDB" with senior Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
2011-10-30 16:15:16.703/4.141 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer) joined Cluster with senior member 1
2011-10-30 16:15:16.922/4.360 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
2011-10-30 16:15:16.922/4.360 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member 1 joined Service DistributedCache with senior member 1
2011-10-30 16:15:16.938/4.376 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Management with senior member 1
2011-10-30 16:15:16.938/4.376 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=n/a): Member 2 joined Service DistributedCache with senior member 1
2011-10-30 16:15:16.953/4.391 Oracle Coherence GE 3.7.1.0 <Info> (thread=Main Thread, member=n/a): Started cluster Name=cluster:0xFCDB

Group{Address=224.3.7.0, Port=37000, TTL=4}

MasterMemberSet(
  ThisMember=Member(Id=3, Timestamp=2011-10-30 16:15:16.312, Address=127.0.0.1:8092, MachineId=60314, Location=site:,machine:localhost,process:3320, Role=CoherenceServer)
  OldestMember=Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
  ActualMemberSet=MemberSet(Size=3
    Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer)
    Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer)
    Member(Id=3, Timestamp=2011-10-30 16:15:16.312, Address=127.0.0.1:8092, MachineId=60314, Location=site:,machine:localhost,process:3320, Role=CoherenceServer)
    )
  MemberId|ServiceVersion|ServiceJoined|MemberState
    1|3.7.1|2011-10-30 16:10:44.312|JOINED,
    2|3.7.1|2011-10-30 16:10:47.938|JOINED,
    3|3.7.1|2011-10-30 16:15:16.719|JOINED
  RecycleMillis=1200000
  RecycleSet=MemberSet(Size=0
    )
  )

TcpRing{Connections=[2]}
IpMonitor{AddressListSize=0}

2011-10-30 16:15:17.125/4.563 Oracle Coherence GE 3.7.1.0 <D5> (thread=Invocation:Management, member=3): Service Management joined the cluster with senior service member 1
2011-10-30 16:15:17.531/4.969 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=3): Loaded POF configuration from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/out/artifacts/test/test.jar!/security-pof-config.xml"
2011-10-30 16:15:17.547/4.985 Oracle Coherence GE 3.7.1.0 <Info> (thread=DistributedCache, member=3): Loaded included POF configuration from "jar:file:/C:/documents/IDM/Voorbeelden/Code/Security/lib/Coherence/coherence.jar!/coherence-pof-config.xml"
2011-10-30 16:15:17.672/5.110 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=3): Service DistributedCache joined the cluster with senior service member 1
2011-10-30 16:15:17.766/5.204 Oracle Coherence GE 3.7.1.0 <Info> (thread=Main Thread, member=3):
Services
  (
  ClusterService{Name=Cluster, State=(SERVICE_STARTED, STATE_JOINED), Id=0, Version=3.7.1, OldestMemberId=1}
  InvocationService{Name=Management, State=(SERVICE_STARTED), Id=1, Version=3.1, OldestMemberId=1}
  PartitionedCache{Name=DistributedCache, State=(SERVICE_STARTED), LocalStorage=enabled, PartitionCount=257, BackupCount=1, AssignedPartitions=0, BackupPartitions=0}
  )

Started DefaultCacheServer...

2011-10-30 16:15:17.828/5.266 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 1 for 43 primary partitions
2011-10-30 16:15:18.016/5.454 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 2 for 42 primary partitions

# Application is stopped
2011-10-30 16:54:16.969/2344.407 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 2 left service Management with senior member 1
2011-10-30 16:54:16.969/2344.407 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 1 left service Management with senior member 3
2011-10-30 16:54:17.000/2344.438 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 1 for 44 primary partitions
2011-10-30 16:54:17.109/2344.547 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 2 for 86 primary partitions
2011-10-30 16:54:17.234/2344.672 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 1 for 43 primary partitions
2011-10-30 16:54:17.250/2344.688 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 1 left service DistributedCache with senior member 2
2011-10-30 16:54:17.266/2344.704 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): Asking member 2 for 42 primary partitions
2011-10-30 16:54:17.281/2344.719 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 2 left service DistributedCache with senior member 3
2011-10-30 16:54:17.875/2345.313 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): TcpRing disconnected from Member(Id=2, Timestamp=2011-10-30 16:10:47.938, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer) due to a peer departure; removing the member.
2011-10-30 16:54:17.875/2345.313 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member(Id=2, Timestamp=2011-10-30 16:54:17.875, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer) left Cluster with senior member 1
2011-10-30 16:54:20.328/2347.766 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): TcpRing connection to Member(Id=1, Timestamp=2011-10-30 16:10:44.312, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer) refused (Connection refused: no further information); removing the member.
2011-10-30 16:54:20.328/2347.766 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member(Id=1, Timestamp=2011-10-30 16:54:20.328, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer) left Cluster with senior member 3

# Application is started again
2011-10-30 16:55:06.750/2394.188 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member(Id=4, Timestamp=2011-10-30 16:55:06.524, Address=127.0.0.1:8088, MachineId=60314, Location=site:,machine:localhost,process:1908, Role=WeblogicServer) joined Cluster with senior member 3
2011-10-30 16:55:07.062/2394.500 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member(Id=5, Timestamp=2011-10-30 16:55:06.875, Address=127.0.0.1:8090, MachineId=60314, Location=site:,machine:localhost,process:3784, Role=WeblogicServer) joined Cluster with senior member 3
2011-10-30 16:55:07.297/2394.735 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 4 joined Service Management with senior member 3
2011-10-30 16:55:07.906/2395.344 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 5 joined Service Management with senior member 3
2011-10-30 16:55:08.938/2396.376 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 4 joined Service DistributedCache with senior member 3
2011-10-30 16:55:09.156/2396.594 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=3): 3> Transferring primary PartitionSet{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127} to member 4 requesting 128
2011-10-30 16:55:09.625/2397.063 Oracle Coherence GE 3.7.1.0 <D4> (thread=DistributedCache, member=3): 1> Transferring 129 out of 129 partitions to a node-safe backup 1 at member 4 (under 129)
2011-10-30 16:55:09.812/2397.250 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=3): Transferring 4KB of backup[1] for PartitionSet{128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256} to member 4
2011-10-30 16:55:10.078/2397.516 Oracle Coherence GE 3.7.1.0 <D5> (thread=Cluster, member=3): Member 5 joined Service DistributedCache with senior member 3
2011-10-30 16:55:10.422/2397.860 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=3): 3> Transferring primary PartitionSet{128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170} to member 5 requesting 43
2011-10-30 16:55:10.453/2397.891 Oracle Coherence GE 3.7.1.0 <D5> (thread=DistributedCache, member=3): Transferring 1KB of backup[1] for PartitionSet{171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213} to member 5

The default server logging also shows what happens when the application is stopped and started again. By using an MBean browser that is connected to the default cache server the cache statistics can be observed.

Integrate JBoss RichFaces

To configure JBoss RichFaces, we can use the following web.xml entries:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
           version="2.5">
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
    </context-param>
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
    </context-param>
    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>enable</param-value>
    </context-param>
    <filter>
        <filter-name>RichFaces Filter</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>RichFaces Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
	<security-constraint>
        <web-resource-collection>
            <web-resource-name>All</web-resource-name>
            <url-pattern>/faces/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>MANAGER</role-name>
            <role-name>EMPLOYEE</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>
    </security-constraint>
    <login-config>
        <auth-method>FORM</auth-method>
        <form-login-config>
            <form-login-page>/login.jspx</form-login-page>
            <form-error-page>/login.jspx</form-error-page>
        </form-login-config>
    </login-config>
    <security-role>
        <role-name>MANAGER</role-name>
    </security-role>
    <security-role>
        <role-name>EMPLOYEE</role-name>
    </security-role>
</web-app>

in which we have also secured the access to the faces servlet. An example page that adds, deletes and views customers is the following:

<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
      xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich">
<head>
    <title>Overview</title>
</head>
<body>
<a4j:form id="form">
    <rich:panel header="Customers" style="width:750px">
        <rich:dataTable id="datatable" value="#{bean.klanten}" var="klant" rows="20"
                        reRender="datascroller">
            <f:facet name="caption">
                <h:panelGroup>
                    <h:commandButton id="insert" value="#{res['button.toevoegen']}"
                                     actionListener="#{bean.insertActionListener}"/>
                    <h:commandButton id="alle" value="#{res['button.show']}"
                                     actionListener="#{bean.showCustomersActionListener}"/>
                    <h:commandButton id="rijke" value="#{res['button.showrich']}"
                                     actionListener="#{bean.showRichCustomersActionListener}"/>
                </h:panelGroup>
            </f:facet>
            <f:facet name="header">
                <rich:columnGroup>
                    <rich:column>
                        <h:outputText value="#{res['tabel.header.klantnummer']}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{res['tabel.header.naam']}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{res['tabel.header.adres']}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{res['tabel.header.kredietlimiet']}"/>
                    </rich:column>
                    <rich:column>
                        <h:outputText value="#{res['tabel.header.commentaar']}"/>
                    </rich:column>
                    <rich:column rendered="#{security.manager}">
                        <rich:spacer/>
                    </rich:column>
                </rich:columnGroup>
            </f:facet>
            <rich:column>
                <h:outputText value="#{klant.klantnummer}"/>
            </rich:column>
            <rich:column>
                <h:outputText value="#{klant.naam}"/>
            </rich:column>
            <rich:column>
                <h:outputText value="#{klant.adres}"/>
            </rich:column>
            <rich:column>
                <h:outputText value="#{klant.kredietlimiet}">
                    <f:convertNumber pattern="####0.00"/>
                </h:outputText>
            </rich:column>
            <rich:column>
                <h:outputText value="#{klant.commentaar}"/>
            </rich:column>
            <rich:column rendered="#{security.manager}">
                <a4j:commandLink value="#{res['button.verwijderen']}" onclick="#{rich:component('modalpanel')}.show()"
                                 reRender="deletepersoon">
                    <f:setPropertyActionListener value="#{klant}" target="#{bean.klant}"/>
                </a4j:commandLink>
            </rich:column>
            <f:facet name="footer">
                <rich:datascroller id="datascroller"/>
            </f:facet>
        </rich:dataTable>
        <rich:modalPanel id="modalpanel">
            <rich:panel header="Delete Client">
                <h:panelGrid id="deletepersoon">
                    <h:outputText value="#{bean.klant}"/>
                    <f:facet name="footer">
                        <rich:toolBar height="20" itemSeparator="line">
                            <rich:toolBarGroup location="right">
                                <a4j:commandButton value="save"
                                                   actionListener="#{bean.deleteActionListener}"
                                                   oncomplete="#{rich:component('modalpanel')}.hide()"
                                                   reRender="datatable"/>
                                <a4j:commandButton value="cancel"
                                                   onclick="#{rich:component('modalpanel')}.hide()"/>
                            </rich:toolBarGroup>
                        </rich:toolBar>
                    </f:facet>
                </h:panelGrid>
            </rich:panel>
        </rich:modalPanel>
    </rich:panel>
</a4j:form>
</body>
</html>

The backing bean that controls the page looks as follows:

package userinterface.beans;

import model.entities.Klant;
import userinterface.resources.Utilities;

import javax.faces.event.ActionEvent;
import java.util.List;

public class BackingBean {

    private List<Klant> klanten;
    private Klant klant;
    private boolean showAll = true;

    public List<Klant> getKlanten() {
        if (showAll) {
            klanten = Utilities.getKlantDAO().findEntities();
        } else {
            klanten = Utilities.getKlantDAO().getKlantData();
        }
        return klanten;
    }

    public void setKlanten(List<Klant> klanten) {
        this.klanten = klanten;
    }

    public Klant getKlant() {
        return klant;
    }

    public void setKlant(Klant klant) {
        this.klant = klant;
    }

    public void showCustomersActionListener(ActionEvent actionEvent) {
        showAll = true;
    }

    public void showRichCustomersActionListener(ActionEvent actionEvent) {
        showAll = false;
    }

    public void insertActionListener(ActionEvent actionEvent) {
        Klant newKlant = createKlant();
        Utilities.getKlantDAO().addEntity(newKlant.getKlantnummer(), newKlant);
    }

    public void deleteActionListener(ActionEvent actionEvent) {
        if (getKlant() != null) {
            Utilities.getKlantDAO().removeEntity(getKlant().getKlantnummer());
        }
    }

    private Klant createKlant() {
        int klantnummer = generateKlantNummer();

        Klant klant = new Klant();
        klant.setKlantnummer(klantnummer);
        klant.setNaam("Middleware" + klantnummer);
        klant.setAdres("Magic");
        klant.setStad("Pune");
        klant.setProvincie("IN");
        klant.setPostcode("1234AB");
        klant.setGebied(1);
        klant.setTelefoonnummer("123-4567");
        klant.setReputatieNummer(1);
        klant.setKredietlimiet(Math.rint(Utilities.getGenerator().nextDouble() * 5000.0));
        klant.setCommentaar(Long.toString(Math.abs(Utilities.getGenerator().nextLong()), 36));

        return klant;
    }

    private Integer generateKlantNummer() {
        return Utilities.getGenerator().nextInt(10000);
    }
}

The faces configuration file has the following contents:

<?xml version='1.0' encoding='UTF-8'?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
              version="1.2">
    <application>
        <message-bundle>userinterface.resources.messagebundle</message-bundle>
        <locale-config>
            <supported-locale>en</supported-locale>
            <supported-locale>nl</supported-locale>
        </locale-config>
        <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
    </application>
    <managed-bean>
        <managed-bean-name>bean</managed-bean-name>
        <managed-bean-class>userinterface.beans.BackingBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <managed-bean>
        <managed-bean-name>res</managed-bean-name>
        <managed-bean-class>userinterface.resources.ResourceHandler</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
	<managed-bean>
        <managed-bean-name>security</managed-bean-name>
        <managed-bean-class>userinterface.beans.SecurityBackingBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
</faces-config>

In which the view-handler is needed when we want to use facelets. As a little extra let us add some security, for example, only users with the manager role can delete customers. To this end we create the following backing bean:

package userinterface.beans;

import userinterface.resources.Utilities;

public class SecurityBackingBean {

    private String role;
    private String user;

    private static final String EMPLOYEE = "EMPLOYEE";
    private static final String MANAGER = "MANAGER";
    private static final String[] ROLE_NAMES = {EMPLOYEE, MANAGER};

    public SecurityBackingBean() {
        this.user = Utilities.getExternalContext().getRemoteUser();

        for (String roleName : ROLE_NAMES) {
            if (Utilities.getExternalContext().isUserInRole(roleName)) {
                this.role = roleName;
                break;
            }
        }
    }

    public boolean isEmployee() {
        return EMPLOYEE.equals(this.role);
    }

    public boolean isManager() {
        return MANAGER.equals(this.role);
    }

    public String getUser() {
        return this.user;
    }
}

By using this backing bean we can control if certain JSF components are rendered, for example, <rich:column rendered="#{security.manager}">.

When a user logs in with MANAGER privledges, the user able to delete customers:

The Show Rich Customers button lets the user view the contents of the Continuous Query Cache:

When a user logs in with EMPLOYEE privledges, the delete option is not rendered:

References

[1] RichFaces Developer Guide.
[2] RichFaces Component Reference.
[3] RichFaces Project Page.