org.ow2.carol.cmi.config
Class CMIConfig

java.lang.Object
  extended by org.ow2.carol.cmi.config.CMIConfig

@ThreadSafe
public final class CMIConfig
extends java.lang.Object

Utility to configure the manager of the cluster view located on the server-side.

Author:
The new CMI team

Field Summary
static java.lang.String CMI_PROPERTIES
          Filename for the properties.
static int DEFAULT_LOAD_FACTOR
          Default values for the load.
 
Method Summary
static java.lang.String getBindNameForDummyRegistry()
           
static java.lang.String getBindNameForProvider()
           
static java.lang.String getCMIAdminMBeanName()
           
static java.lang.String getCMIProperty(java.lang.String key)
          Get the value for a CMI property.
static int getLoadFactor()
           
static java.lang.String getMBeanDomainName()
           
static int getRefreshTime()
           
static java.lang.Class<? extends org.ow2.carol.cmi.controller.server.ServerClusterViewManager> getServerClusterViewManagerClass()
           
static void init()
          Initializes the CMI properties with reading the file cmi.properties.
static boolean isConfigured()
           
static boolean isConnectorEnabled(java.lang.String protocol)
           
static boolean isEmbedded()
           
static boolean isProviderBound()
           
static boolean isRegistryBound()
           
static void setEmbedded()
          Set that CMI is embedded.
static void setProperties(java.util.Properties props)
          Initializes the CMI properties with reading the given properties.
static void setProperties(java.net.URL url)
          Initializes the CMI properties with reading the file at a given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMI_PROPERTIES

public static final java.lang.String CMI_PROPERTIES
Filename for the properties.

See Also:
Constant Field Values

DEFAULT_LOAD_FACTOR

public static final int DEFAULT_LOAD_FACTOR
Default values for the load.

See Also:
Constant Field Values
Method Detail

init

public static void init()
                 throws CMIConfigException
Initializes the CMI properties with reading the file cmi.properties.

Throws:
CMIConfigException - if the configuration files are not correct

setProperties

public static void setProperties(java.util.Properties props)
                          throws CMIConfigException
Initializes the CMI properties with reading the given properties.

Parameters:
props - properties
Throws:
CMIConfigException - if the configuration files are not correct

setProperties

public static void setProperties(java.net.URL url)
                          throws CMIConfigException
Initializes the CMI properties with reading the file at a given location.

Parameters:
url - the URL to load CMI configuration
Throws:
CMIConfigException - If the configuration files are not correct.

getRefreshTime

public static int getRefreshTime()
Returns:
The duration between each refresh of the client view.

getServerClusterViewManagerClass

public static java.lang.Class<? extends org.ow2.carol.cmi.controller.server.ServerClusterViewManager> getServerClusterViewManagerClass()
Returns:
The class of the ServerClusterViewManager.

getCMIProperty

public static java.lang.String getCMIProperty(java.lang.String key)
Get the value for a CMI property.

Parameters:
key - The key.
Returns:
The associated value.

getMBeanDomainName

public static java.lang.String getMBeanDomainName()
Returns:
the name of domain for MBeans

getCMIAdminMBeanName

public static java.lang.String getCMIAdminMBeanName()
Returns:
the name of CMIAdmin MBean

isConnectorEnabled

public static boolean isConnectorEnabled(java.lang.String protocol)
Parameters:
protocol - a protocol name
Returns:
true if a RMI connector must be created for the given protocol

isProviderBound

public static boolean isProviderBound()
Returns:
true if a provider of the cluster view should be bound

getBindNameForProvider

public static java.lang.String getBindNameForProvider()
Returns:
name of the ClientClusterViewProvider that is used to bind it

getBindNameForDummyRegistry

public static java.lang.String getBindNameForDummyRegistry()
Returns:
the bind name of the dummy objects representing registry.

getLoadFactor

public static int getLoadFactor()
Returns:
the load factor

isConfigured

public static boolean isConfigured()
Returns:
true if CMI is configured

isRegistryBound

public static boolean isRegistryBound()
Returns:
true if the registry is bound

isEmbedded

public static boolean isEmbedded()
Returns:
true if CMI is embedded

setEmbedded

public static void setEmbedded()
Set that CMI is embedded.



Copyright © 2007 OW2 Consortium. All Rights Reserved.