axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chamikara Jayalath" <chamikar...@gmail.com>
Subject [Axis2] [clustering] Some more changes to the ClusterManager interface
Date Wed, 07 Mar 2007 00:12:05 GMT
Hi All,

It seemed that the current ClusterManager interface will not be sufficient
in some of the user scenarios. Based on the discussions I had with some
people, I would like to suggest several changes to the interface.

1. Add a layer to replicate configuration changes.

It seemed that sometimes it will be useful to  make the cluster aware of
configuration changes as well (new services, policy changes etc.) When
configuration changes happen somebody who is aware of it can call the
respective method in any one of the Nodes of the cluster. Other nodes of the
cluster will get this event through group communication.

This is basically for a environment where hot-deployment or hot-update is
not enabled. For example think of scenario where the nodes of the cluster
are pointing to a remote repository using the URLBasedAxisConfigurator. In
this case the user can update the repository and inform the Nodes of the
cluster through these newly added methods.

2. Moved the context management and configuration management methods to two
sub interfaces of the ClusterManager.

The old Context management methods were moved to an interface named
ContextManager and the newly added Configuration management methods were
added to a interface named ConfigurationManager. These could be obtained
through the ClusterManager API. The new configuration manager will have
several additional methods to apply it's changes in a transactional way.

3. Added a listener mechanism to capture to changes of the cluster.

It seemed that our solution did not provide a clean way for capturing the
incoming events. Users may need to override this part without doing changes
to the other methods of the ClusterManager. Also some users may need to do
their specific work in this kind of events.

By adding a mechanism to register a listener in the ClusterManager we can
give this added flexibility. We will be providing a default listener which
will have the current receiving logic (I.e. the logic that updates the
system once a event is received - for e.g. about a context update). There
will be two listeners one to capture the configuration changes and the other
to capture the context changes.

Here is the proposed interface,

public interface ClusterManager {
    /**
     * Initializes the CM. Node is joint to the cluster.
     */
    public void init(ConfigurationContext context);

    /**
     * To obtain the ContextManager, which has methods to manage contexts
     */
    public ContextManager getContextManager();

    /**
     * To obtain the ConfigurationManager, which has methods to manage
configurations.
     */
    public ConfigurationManager getConfigurationManager();
}

/**
 * API to boradcast context changes to the cluster.
 */
interface ContextManager {

    /*
     * Context management methods
     */
    public void addContext(AbstractContext context);
    public void removeContext(AbstractContext context);
    public void updateState(AbstractContext context);
    public boolean isContextClusterable(AbstractContext context);

    /**
     * For registering a context event listener.
     */
    public void addContextManagerListener(ContextManagerListener listener);
}

/**
 * API to boradcast configuration changes to the cluster.
 */
interface ConfigurationManager {

    /*
     * Configuration management methods
     */
    void loadServiceGroup(String serviceGroupName);
    void unloadServiceGroup(String serviceGroupName);
    void applyPolicy(String serviceGroupName, Policy policy);
    void reloadConfiguration();

    /*
     * Transaction management methods
     */
    void prepare();
    void rollback();
    void commit();

    /**
     * For registering a configuration event listener.
     */
    void addConfigurationManagerListener(ConfigurationManagerListener
listener);
}

/**
 * To listen to context event broadcasts from the cluster
 */
interface ContextManagerListener{
    public void contextAdded(ContextEvent event);
    public void contextRemoved(ContextEvent event);
    public void contextUpdated(ContextEvent event);
}

/**
 * To listen to configuration event broadcasts from the cluster
 */
interface ConfigurationManagerListener{
    public void serviceGroupLoaded(ConfigurationEvent event);
    public void serviceGroupUnloaded(ConfigurationEvent event);
    public void policyApplied(ConfigurationEvent event);
    public void configurationReloaded (ConfigurationEvent event);
    public void propareCalled (ConfigurationEvent event);
    public void rollbackCalled (ConfigurationEvent event);
    public void commitCalled (ConfigurationEvent event);
}


Please send your comments...

Thanks,
Chamikara

Mime
View raw message