head	1.22;
access;
symbols;
locks; strict;
comment	@# @;


1.22
date	2001.08.17.19.43.17;	author dlr;	state Exp;
branches;
next	1.21;

1.21
date	2001.08.17.18.17.08;	author leonardr;	state Exp;
branches;
next	1.20;

1.20
date	2001.08.16.00.45.19;	author dlr;	state Exp;
branches;
next	1.19;

1.19
date	2001.08.11.09.08.09;	author dlr;	state Exp;
branches;
next	1.18;

1.18
date	2001.08.03.17.44.02;	author dlr;	state Exp;
branches;
next	1.17;

1.17
date	2001.08.03.16.59.29;	author dlr;	state Exp;
branches;
next	1.16;

1.16
date	2001.08.03.02.41.14;	author dlr;	state Exp;
branches;
next	1.15;

1.15
date	2001.05.21.21.06.01;	author leonardr;	state dead;
branches;
next	1.14;

1.14
date	2001.04.16.22.13.47;	author dlr;	state Exp;
branches;
next	1.13;

1.13
date	2001.04.11.03.32.22;	author dlr;	state Exp;
branches;
next	1.12;

1.12
date	2001.04.09.23.11.35;	author dlr;	state Exp;
branches;
next	1.11;

1.11
date	2001.04.09.22.40.57;	author dlr;	state Exp;
branches;
next	1.10;

1.10
date	2001.04.09.22.27.34;	author dlr;	state Exp;
branches;
next	1.9;

1.9
date	2001.04.09.22.09.17;	author dlr;	state Exp;
branches;
next	1.8;

1.8
date	2001.04.09.21.57.48;	author dlr;	state Exp;
branches;
next	1.7;

1.7
date	2001.04.09.20.45.58;	author dlr;	state Exp;
branches;
next	1.6;

1.6
date	2001.04.09.20.30.01;	author dlr;	state Exp;
branches;
next	1.5;

1.5
date	2001.04.09.20.02.22;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.04.09.20.01.01;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.04.09.19.59.46;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.04.09.19.47.24;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.04.09.19.37.16;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.22
log
@Changed if/else if/else block on primitive value to switch for better
readability.
@
text
@/* ================================================================
 * Copyright (c) 2000-2001 CollabNet.  All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * 
 * 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * 
 * 2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * 
 * 3. The end-user documentation included with the redistribution, if
 * any, must include the following acknowlegement: "This product includes
 * software developed by CollabNet (http://www.collab.net/)."
 * Alternately, this acknowlegement may appear in the software itself, if
 * and wherever such third-party acknowlegements normally appear.
 * 
 * 4. The hosted project names must not be used to endorse or promote
 * products derived from this software without prior written
 * permission. For written permission, please contact info@@collab.net.
 * 
 * 5. Products derived from this software may not use the "Tigris" name
 * nor may "Tigris" appear in their names without prior written
 * permission of CollabNet.
 * 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL COLLABNET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * ====================================================================
 * 
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CollabNet.
 */

package org.tigris.helm.tool.cluster;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import java.util.Iterator;

//import spread.AdvancedMessageListener;
import spread.MembershipInfo;
import spread.SpreadConnection;
import spread.SpreadException;
import spread.SpreadGroup;
import spread.SpreadMessage;

import org.apache.commons.util.exception.NestableException;

import org.apache.fulcrum.BaseService;
import org.apache.fulcrum.InitializationException;
//import org.apache.fulcrum.ServiceException;
import org.apache.fulcrum.TurbineServices;

import org.apache.commons.collections.ExtendedProperties;

import org.tigris.helm.event.ToolEvent;
import org.tigris.helm.event.ClusterEvent;
import org.tigris.helm.event.EventType;
import org.tigris.helm.event.SingletonElectionEvent;
import org.apache.turbine.util.Log;

/**
 * Initializes cluster-level services.  Currently, this consists of a
 * Spread communication channel.
 *
 * @@author <a href="mailto:dlr@@collab.net">Daniel Rall</a>
 * @@version $Id: ClusterService.java,v 1.21 2001/08/17 18:17:08 leonardr Exp $
 */
public class ClusterService extends BaseService
{
    /**
     * The name of this service.  Used to retrive it from the broker.
     */
    public static final String SERVICE_NAME = "ClusterService";

    /**
     * Key to the host name of the server in the config file.
     */
    private static final String CLUSTER_SERVER_HOST = "serverHost";

    /**
     * Key to the port of the server in the config file.
     */
    private static final String CLUSTER_SERVER_PORT = "serverPort";

    /**
     * The communication server host.
     */
    private String serverHost;

    /**
     * The communication server port.
     */
    private int serverPort;

    private Hashtable groupMemberships;

    /**
     * The list of connections to the Spread server.  Used at service
     * shutdown time to close connections.
     */
    private Hashtable connections;

    /**
     * A table of {@@link spread.SpreadGroup} objects keyed by
     * {@@link org.tigris.helm.tool.cluster.Clustered}.
     */
    private Hashtable groups;

    /**
     * Elections currently in progress.
     */
    private Hashtable elections;

    /**
     * The singleton for the cluster communication service.
     */
    public static final ClusterService getService()
    {
        return (ClusterService) TurbineServices
            .getInstance().getService(ClusterService.SERVICE_NAME);
    }

    /**
     * Creates a new instance.
     */
    public ClusterService()
    {
        groupMemberships = new Hashtable();
        connections = new Hashtable();
        groups = new Hashtable();
        elections = new Hashtable();
    }

    /**
     * Initializes this service.  Called during Fulcrum
     * initialization.  Should be configured to be initialized early.
     */
    public void init()
        throws InitializationException
    {
        System.err.println("CS.init() called");
        if (!isInitialized())
        {
            System.err.println("CS starting init()");
            try
            {
                // Read Spread server configuration.
                ExtendedProperties cfg = getConfiguration();
                serverHost = cfg.getString(CLUSTER_SERVER_HOST, "127.0.0.1");
                serverPort = cfg.getInt(CLUSTER_SERVER_PORT, 4803);

                synchronized (this)
                {
                    // Assure that we can open connections to the
                    // Spread server.
                    SpreadConnection conn = getServerConnection(null);
                    conn.disconnect();
                }

                setInit(true);
            }
            catch (Exception e)
            {
                throw new InitializationException
                    (SERVICE_NAME + " initialization failed: " +
                     e.getMessage());
            }
        }
    }

    /**
     * Retrieves the port of this cluster's communication server.
     */
    public int getServerPort()
    {
        return serverPort;
    }

    /**
     * Retrieves the host running this cluster's communication server.
     */
    public String getServerHost()
    {
        return serverHost;
    }

    /**
     * Retrieves a connection to this cluster's communication server.
     *
     * @@param clustered The member to retrieve a connection for.
     * @@return        The server connection.
     */
    public synchronized void register(Clustered clustered)
        throws NestableException
    {
        Log.debug(SERVICE_NAME + ": Registering " + clustered.getDescriptor());
        if (connections.containsKey(clustered))
        {
            throw new NestableException(SERVICE_NAME + ": " + clustered +
                                       " attempted re-registration");
        }

        try
        {
            SpreadConnection conn = getServerConnection(null);
            SpreadGroup group = new SpreadGroup();
            String groupName = clustered.getDescriptor();
            group.join(conn, groupName);
            groups.put(clustered, group);
            connections.put(clustered, conn);
            Log.debug(SERVICE_NAME + ": Done registering " +
                      clustered.getDescriptor());
        }
        catch (Exception e)
        {
            throw new NestableException(SERVICE_NAME + ": Unable to establish "
                                       + "connection to communications server",
                                       e);
        }
    }

    /**
     * Returns a connected {@@link spread.SpreadConnection}.
     *
     * @@param privateName The unique name for the connection, or
     * <code>null</code> for a unique random name to be assigned by
     * the Spread daemon.
     */
    private final SpreadConnection getServerConnection(String privateName)
        throws UnknownHostException, SpreadException
    {
        SpreadConnection conn = new SpreadConnection();
        Log.debug(SERVICE_NAME + ": Opening connection to communications " +
                  "server " + serverHost + " on port " + serverPort);
        conn.connect(InetAddress.getByName(serverHost), serverPort,
                     privateName, false, true);
        return conn;
    }

    /**
     * Discards the connection associated with a member of the cluster
     * we represent, leaving groups and closing connection.
     *
     * @@param clustered The instance to use as a key into member Hashtables.
     */
    public void unregister(Clustered clustered)
        throws NestableException
    {
        SpreadConnection conn =
            (SpreadConnection) connections.remove(clustered);
        if (conn != null)
        {
            try
            {
                SpreadGroup group = (SpreadGroup) groups.remove(clustered);
                group.leave();
                conn.disconnect();
            }
            catch (SpreadException e)
            {
                Log.warn(SERVICE_NAME + ": Error disconnecting from server");
            }
        }
    }

    /**
     * Receives a {@@link org.tigris.helm.event.ClusterEvent} from the
     * communication server (blocks until message received).  Invokes
     * {@@link org.tigris.helm.tool.cluster.Clustered.eventReceived()}
     * callback.  
     *
     * @@param clustered The clustered to receive a message for and invoke
     *                a callback on.
     */
    public void receiveEvent(Clustered clustered)
        throws NestableException
    {
        SpreadConnection conn = (SpreadConnection) connections.get(clustered);
        //Log.debug(SERVICE_NAME + ": conn [" + clustered + "]=" + conn);
        try
        {
            // receive() blocks until a message is received.
            SpreadMessage msg = conn.receive();
            if (msg.isRegular())
            {
                switch (msg.getType())
                {
                case ClusterEvent.CLUSTER_EVENT:
                case ClusterEvent.TOOL_EVENT:
                    ClusterEvent event = (ClusterEvent) msg.getObject();
                    clustered.eventReceived(event);
                    break;

                case ClusterEvent.ELECTION_EVENT:
                    String clusteredDescriptor = clustered.getDescriptor();
                    synchronized (elections)
                    {
                        Election election =
                            (Election) elections.get(clusteredDescriptor);
                        if (election == null)
                        {
                            //We know there's only one group; the one
                            //holding the election.
                            SpreadGroup group = msg.getGroups()[0];
                            SpreadGroup[] members = (SpreadGroup[])
                                groupMemberships.get(group);
                            election = new Election(members);
                            elections.put(clusteredDescriptor, election);
                        }
                        SingletonElectionEvent ee =
                            (SingletonElectionEvent) msg.getObject();
                        election.recordBid(msg.getSender(),
                                           new Float(ee.getBid()));
                        if (election.allBidsIn())
                        {
                            SpreadGroup winner = election.decision();
                            if (conn.getPrivateGroup().equals(winner))
                            {
                                ((ClusteredSingletonService) clustered)
                                    .setActive(true);
                            }
                            elections.remove(clusteredDescriptor);
                        }
                    }
                    break;

                default:
                    Log.warn(SERVICE_NAME + ": Uknown event type received: " +
                             msg.getType());
                }
            }
            else if (msg.isMembership())
            {
                MembershipInfo m = msg.getMembershipInfo();
                groupMemberships.put(m.getGroup(), m.getMembers());

                // We only care about membership events for
                // ClusteredSingletonService implementations.
                if (clustered instanceof ClusteredSingletonService)
                {
                    // Send out election bid.
                    Log.debug(SERVICE_NAME + ": Sending election bid for " +
                              clustered.getDescriptor());
                    ClusteredSingletonService css =
                        (ClusteredSingletonService) clustered;
                    sendEvent(clustered,
                              new SingletonElectionEvent(css.bid()));
                }
            }
            else
            {
                Log.info(SERVICE_NAME + ": Unhandled SpreadMessage type");
            }
        }
        catch (Exception e)
        {
            throw new NestableException(SERVICE_NAME +
                                       ": receiveEvent() failed", e);
        }
    }

    /**
     * Sends the provided message for the specified cluster clustered.
     */
    public void sendEvent(Clustered clustered, ClusterEvent event)
        throws NestableException
    {
        SpreadConnection conn = (SpreadConnection) connections.get(clustered);
        SpreadMessage msg = new SpreadMessage();
        msg.setType(event.getType());
        // ASSUMPTION: We only want to send to one group.
        msg.addGroup(clustered.getDescriptor());
        msg.setReliable();
        try
        {
            msg.setObject(event);
            conn.multicast(msg);
        }
        catch (SpreadException e)
        {
            throw new NestableException(SERVICE_NAME +
                                       ": sendEvent() failed", e);
        }
    }

    /**
     * Shuts down this service, closing connections to the
     * communication server.
     */
    public void shutdown()
    {
        Enumeration keys = connections.keys();
        while (keys.hasMoreElements())
        {
            try
            {
                unregister((Clustered) keys.nextElement());
            }
            catch (NestableException ignored)
            {
            }
        }
    }
}
@


1.21
log
@Cleaned up election irregularities (which required a patch to Spread) and got the TaskRunner working again.
@
text
@d83 1
a83 1
 * @@version $Id: ClusterService.java,v 1.20 2001/08/16 00:45:19 dlr Exp $
d303 1
a303 1
                if (msg.getType() == ClusterEvent.CLUSTER_EVENT)
d305 2
d309 3
a311 8
                }
                else if (msg.getType() == ClusterEvent.TOOL_EVENT)
                {
                     ToolEvent event = (ToolEvent) msg.getObject();
                     clustered.eventReceived(event);
                }
                else if (msg.getType() == ClusterEvent.ELECTION_EVENT)
                {
d342 3
a344 3
                }
                else
                {
@


1.20
log
@Used Commons Collections ExtendedProperties instead of Velocity's deprecated Configuration class.
@
text
@d32 1
a32 1
 * IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
d54 1
d72 1
d83 1
a83 1
 * @@version $Id: ClusterService.java,v 1.19 2001/08/11 09:08:09 dlr Exp $
d112 2
d145 1
d308 5
d322 6
a327 1
                            election = new Election(msg.getGroups());
d354 3
@


1.19
log
@Upgrading to Turbine 3.0-dev, Fulcrum 1.0, and Torque 1.0.
@
text
@d69 1
a69 1
import org.apache.velocity.runtime.configuration.Configuration;
d81 1
a81 1
 * @@version $Id: ClusterService.java,v 1.18 2001/08/03 17:44:02 dlr Exp $
d160 1
a160 1
                Configuration cfg = getConfiguration();
@


1.18
log
@Corrected build error.
@
text
@d62 7
a70 4
import org.apache.turbine.services.*;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.TurbineException;

d74 1
d81 1
a81 1
 * @@version $Id: ClusterService.java,v 1.17 2001/08/03 16:59:29 dlr Exp $
d83 1
a83 1
public class ClusterService extends TurbineBaseService
d147 2
a148 1
     * Late initialization.
d154 1
a154 1
        if (!getInit())
d206 1
a206 1
        throws TurbineException
d211 1
a211 1
            throw new TurbineException(SERVICE_NAME + ": " + clustered +
d228 1
a228 1
            throw new TurbineException(SERVICE_NAME + ": Unable to establish "
d259 1
a259 1
        throws TurbineException
d288 1
a288 1
        throws TurbineException
d359 1
a359 1
            throw new TurbineException(SERVICE_NAME +
d368 1
a368 1
        throws TurbineException
d383 1
a383 1
            throw new TurbineException(SERVICE_NAME +
d401 1
a401 1
            catch (TurbineException ignored)
@


1.17
log
@* Threw InitializationException instead of logging error, as dictated
by API.

* JavaDoc'd unregister(), and switched to logging warning on error
condition -- Spread server will handle situation.

* Called unregister() from inside of shutdown() to avoid code
duplication.
@
text
@d77 1
a77 1
 * @@version $Id: ClusterService.java,v 1.16 2001/08/03 02:41:14 dlr Exp $
d392 7
a398 1
            unregister((Clustered) keys.nextElement());
@


1.16
log
@Now with delicious Spread!
@
text
@d77 1
a77 1
 * @@version $Id: ClusterService.java,v 1.14 2001/04/16 22:13:47 dlr Exp $
d171 3
a173 1
                Log.error(SERVICE_NAME + " initialization failed", e);
d247 7
a253 1
    public synchronized void unregister(Clustered clustered)
d268 1
a268 1
                throw new TurbineException(e);
d392 1
a392 10
            Clustered key = (Clustered) keys.nextElement();
            try
            {
                ((SpreadConnection) connections.get(key)).disconnect();
                connections.remove(key);
            }
            catch (SpreadException e)
            {
                Log.warn(SERVICE_NAME + ": Error disconnecting from server");
            }
@


1.15
log
@Moved clustering features out of RMI and into the database.
@
text
@a48 1
import java.util.Properties;
d50 13
a62 1
import javax.servlet.ServletConfig;
a64 1
import org.apache.turbine.services.resources.*;
d68 3
a70 1
import org.tigris.helm.tool.rmi.RemoteImplRegistrar;
d73 2
a74 1
 * Initializes cluster services such as the RMI registry.
d86 45
a130 4
    private static final String CLUSTER_HOST = "host";
    private static final String RMI_REGISTRY_PORT = "rmiRegistryPort";
    private static final String MEDIATOR_CLASS_KEYS = "mediator.classKeys";
    private static final String MEDIATOR_CLASS_NAMES = "mediator.classNames";
d132 9
a140 2
    private String mediatorHost;
    private int rmiRegistryPort;
d143 1
a143 3
     * Called during <code>Turbine.init()</code> (i.e. early initialization).
     *
     * @@param config The configuration we're operating under.
d145 2
a146 1
    public void init(ServletConfig config)
d148 1
d151 1
d154 4
a157 7
                ResourceService resource =
                    ((TurbineServices) TurbineServices.getInstance())
                    .getResources(SERVICE_NAME);
                String localhost = InetAddress.getLocalHost().getHostName();
                mediatorHost = resource.getString(CLUSTER_HOST, localhost);
                rmiRegistryPort =
                    Integer.parseInt(resource.getString(RMI_REGISTRY_PORT));
d159 1
a159 11
                // Check whether we host the RMI registry.
                if (localhost.equalsIgnoreCase(mediatorHost))
                {
                    // HACK: Using Anzu's RMI registry due to the fact that
                    // the system class loader is unaware of the Remote
                    // implementations loaded by JServ's AdaptiveClassLoader
                    // (as specified in its repositories config).
                    //RemoteImplRegistrar.createRMIRegistry(rmiRegistryPort);
                    registerServedObjects(resource);
                }
                else
d161 4
a164 3
                    Log.info(SERVICE_NAME + " determined localhost [" +
                             localhost + "] to not be the equivalent of " +
                             "cluster mediator [" + mediatorHost + ']');
d177 1
a177 1
     * Retrieves the RMI registry port of this cluster.
d179 1
a179 1
    public static int getRMIRegistryPort()
d181 1
a181 1
        return getService().rmiRegistryPort;
d185 1
a185 1
     * Retrieves the host running this cluster's mediator.
d187 1
a187 1
    public static String getMediatorHost()
d189 1
a189 1
        return getService().mediatorHost;
d193 4
a196 1
     * Registers some objects to be shared across the network.
d198 1
a198 1
    protected void registerServedObjects(ResourceService resource)
d201 6
a206 2
        String[] classKeys = resource.getStringArray(MEDIATOR_CLASS_KEYS);
        String[] classNames = resource.getStringArray(MEDIATOR_CLASS_NAMES);
d208 17
a224 1
        RemoteImplRegistrar.registerBindings(classKeys, classNames);
d227 9
a235 1
    private static final ClusterService getService()
d237 158
a394 2
        return (ClusterService) TurbineServices
            .getInstance().getService(ClusterService.SERVICE_NAME);
@


1.14
log
@Defauled the cluster mediator host to localhost.
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.13 2001/04/11 03:32:22 dlr Exp $
@


1.13
log
@HACK: Using Anzu's RMI registry due to the fact that the system class
loader is unaware of the Remote implementations loaded by JServ's
AdaptiveClassLoader (as specified in its repositories config).
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.12 2001/04/09 23:11:35 dlr Exp $
d95 2
a96 1
                mediatorHost = resource.getString(CLUSTER_HOST);
a98 1
                String localhost = InetAddress.getLocalHost().getHostName();
@


1.12
log
@Made of use foward-compatible initialization.
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.11 2001/04/09 22:40:57 dlr Exp $
d103 5
a107 2
                    // Create and initialize the RMI registry.
                    RemoteImplRegistrar.createRMIRegistry(rmiRegistryPort);
@


1.11
log
@Added constants for props file keys.
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.10 2001/04/09 22:27:34 dlr Exp $
d92 4
a95 2
                Properties props = getProperties();
                mediatorHost = props.getProperty(CLUSTER_HOST);
d97 1
a97 1
                    Integer.parseInt(props.getProperty(RMI_REGISTRY_PORT));
d105 1
a105 1
                    registerServedObjects();
d142 1
a142 1
    protected void registerServedObjects()
a144 3
        ResourceService resource =
            ((TurbineServices) TurbineServices.getInstance())
            .getResources(SERVICE_NAME);
@


1.10
log
@Changed props file constants appropriately.
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.9 2001/04/09 22:09:17 dlr Exp $
d75 2
d146 2
a147 2
        String[] classKeys = resource.getStringArray("mediator.classKeys");
        String[] classNames = resource.getStringArray("mediator.classNames");
@


1.9
log
@Get the class mapping for registerServedObjects to pass off
RemoteImplRegistrar.registerBindings().
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.8 2001/04/09 21:57:48 dlr Exp $
d73 1
a73 1
    private static final String MEDIATOR_HOST = "mediator.host";
d91 1
a91 1
                mediatorHost = props.getProperty(MEDIATOR_HOST);
@


1.8
log
@* Use the right port.

* Broke network object registration into separate method.
@
text
@d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.7 2001/04/09 20:45:58 dlr Exp $
d141 5
a145 3
        // TODO: Parse arrrays.
        String[] classKeys = null;
        String[] classNames = null;
@


1.7
log
@* Simplified cluster mediator host self-check.

* Added informational logging of self-check failure.
@
text
@d56 1
d64 1
a64 1
 * @@version $Id: ClusterService.java,v 1.6 2001/04/09 20:30:01 dlr Exp $
d100 2
a101 2
                    RemoteImplRegistrar.createRMIRegistry(1098);
                    RemoteImplRegistrar.registerBindings();
d133 13
@


1.6
log
@Renamed RMI registry property.
@
text
@d63 1
a63 1
 * @@version $Id: ClusterService.java,v 1.5 2001/04/09 20:02:22 dlr Exp $
d93 1
d96 1
a96 2
                if (InetAddress.getLocalHost().getHostName()
                    .equalsIgnoreCase(mediatorHost))
d101 6
@


1.5
log
@Moved try/catch blocks inside initialization predicate.
@
text
@d63 1
a63 1
 * @@version $Id: ClusterService.java,v 1.4 2001/04/09 20:01:01 dlr Exp $
d73 1
a73 1
    private static final String RMI_REGISTRY_PORT = "mediator.rmiRegistryPort";
@


1.4
log
@Corrected Exception error message.
@
text
@d63 1
a63 1
 * @@version $Id: ClusterService.java,v 1.3 2001/04/09 19:59:46 dlr Exp $
d85 1
a85 1
        try
d87 1
a87 1
            if (!getInit())
d105 4
a108 4
        }
        catch (Exception e)
        {
            Log.error(SERVICE_NAME + " initialization failed", e);
@


1.3
log
@* Narrowed imports.

* Checking whether the RMI registry should be created and the
registrar should do its thing.
@
text
@d63 1
a63 1
 * @@version $Id: ClusterService.java,v 1.2 2001/04/09 19:47:24 dlr Exp $
d108 1
a108 2
            Log.error(SERVICE_NAME +
                      ": Cryptography provider initialization failed", e);
@


1.2
log
@Added instance members and static service accessor wrapper methods for
retrieving the cluster data stored in said instance members.
@
text
@d49 2
a50 1
import java.util.*;
d63 1
a63 1
 * @@version $Id: ClusterService.java,v 1.1 2001/04/09 19:37:16 dlr Exp $
d95 2
a96 1
                if (true)
@


1.1
log
@Initializes cluster services such as the RMI registry.
@
text
@d62 1
a62 1
 * @@version $Id: $
d71 6
d88 5
d100 1
d109 22
@

