org.ow2.jonas.registry.carol
Class CarolRegistryService

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.registry.carol.CarolRegistryService
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, RegistryService, Service

public class CarolRegistryService
extends AbsServiceImpl
implements RegistryService

Implementation of the RegistryService interface.

Author:
Helene Joanin Contributor(s): Julien Lehembre (Libelis)

Field Summary
static String COLLOCATED
          Collocated mode.
static String DEFAULT_MODE
          Automatic mode.
static String REMOTE
          Remote mode.
 
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
CarolRegistryService()
           
 
Method Summary
 void doStart()
          Abstract start-up method to be implemented by sub-classes.
 void doStop()
          Abstract method for service stopping to be implemented by sub-classes.
 List<String> getActiveProtocolNames()
          
 String getDefaultProtocolName()
          
 int getExportedObjectPort(String protocolName)
          
 String getInitialContextFactoryName(String protocolName)
          
 URI getProviderURL(String protocolName)
          
 InitialContext getRegistryContext()
          Get the initialContext used in this jonas server.
 VersioningService getVersioningService()
           
 void setComponentContextFactory(JComponentContextFactory factory)
          Bind the JComponentContextFactory to use.
 void setConfiguration(String configurationURL)
           
 void setConfigurationURL(URL configurationURL)
           
 void setDefaultProtocol(String protocolName)
          Set the current protocol to the given parameter.
 void setDelegate(JComponentContextFactoryDelegate delegate)
          Bind the JComponentContextFactoryDelegate to use.
 void setDeploymentPlanDeployer(DeploymentPlanDeployer deploymentPlanDeployer)
           
 void setIgnoreError(boolean ignoreError)
           
 void setMbeanServer(MBeanServer mbeanServer)
           
 void setMode(String mode)
           
 void setStartRegistry(boolean startRegistry)
           
 void setVersioningService(VersioningService versioningService)
           
 void unsetVersioningService()
          Sets the versioning service to null.
 
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString
 
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter
initLogger, sendReconfigNotification, sendSaveNotification
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Field Detail

DEFAULT_MODE

public static final String DEFAULT_MODE
Automatic mode.

See Also:
Constant Field Values

COLLOCATED

public static final String COLLOCATED
Collocated mode.

See Also:
Constant Field Values

REMOTE

public static final String REMOTE
Remote mode.

See Also:
Constant Field Values
Constructor Detail

CarolRegistryService

public CarolRegistryService()
Method Detail

setMode

public void setMode(String mode)
Parameters:
mode - Registry mode (default, collocated or remote).

doStart

public void doStart()
             throws ServiceException
Abstract start-up method to be implemented by sub-classes.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - service start-up failed

doStop

public void doStop()
            throws ServiceException
Abstract method for service stopping to be implemented by sub-classes.

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - service stopping failed

getActiveProtocolNames

public List<String> getActiveProtocolNames()

Specified by:
getActiveProtocolNames in interface RegistryService
Returns:
Returns a List of currently active protocols names (rmi, irmi, iiop, ...).

getDefaultProtocolName

public String getDefaultProtocolName()

Specified by:
getDefaultProtocolName in interface RegistryService
Returns:
Returns the default protocol name.

getExportedObjectPort

public int getExportedObjectPort(String protocolName)

Specified by:
getExportedObjectPort in interface RegistryService
Parameters:
protocolName - protocol name
Returns:
Returns the given protocol port where objects are exported. Returns 0 if unset.

getInitialContextFactoryName

public String getInitialContextFactoryName(String protocolName)

Specified by:
getInitialContextFactoryName in interface RegistryService
Parameters:
protocolName - protocol name
Returns:
Returns the InitialContextFactory classname of the given protocol.

getProviderURL

public URI getProviderURL(String protocolName)

Specified by:
getProviderURL in interface RegistryService
Parameters:
protocolName - protocol name
Returns:
Returns the given protocol provider URL.

setDefaultProtocol

public void setDefaultProtocol(String protocolName)
Set the current protocol to the given parameter.

Specified by:
setDefaultProtocol in interface RegistryService
Parameters:
protocolName - the new default protocol name.

setComponentContextFactory

public void setComponentContextFactory(JComponentContextFactory factory)
Bind the JComponentContextFactory to use.

Parameters:
factory - selected factory

setDelegate

public void setDelegate(JComponentContextFactoryDelegate delegate)
Bind the JComponentContextFactoryDelegate to use.

Parameters:
delegate - selected delegate

setStartRegistry

public void setStartRegistry(boolean startRegistry)
Parameters:
startRegistry - the bStartRegistry to set

setIgnoreError

public void setIgnoreError(boolean ignoreError)
Parameters:
ignoreError - the bIgnoreError to set

setConfigurationURL

public void setConfigurationURL(URL configurationURL)
Parameters:
configurationURL - the configurationURL to set

setConfiguration

public void setConfiguration(String configurationURL)
                      throws MalformedURLException
Parameters:
configurationURL - the configurationURL to set
Throws:
MalformedURLException - throws if the URL is not valid

getRegistryContext

public InitialContext getRegistryContext()
Get the initialContext used in this jonas server.

Specified by:
getRegistryContext in interface RegistryService
Returns:
InitialContext the initial context.
Throws:
NamingException

setMbeanServer

public void setMbeanServer(MBeanServer mbeanServer)
Parameters:
mbeanServer - the mbeanServer to set

setDeploymentPlanDeployer

public void setDeploymentPlanDeployer(DeploymentPlanDeployer deploymentPlanDeployer)
Parameters:
deploymentPlanDeployer - the deploymentPlanDeployer to set

setVersioningService

public void setVersioningService(VersioningService versioningService)
Parameters:
versioningService - The versioning service to set.

unsetVersioningService

public void unsetVersioningService()
Sets the versioning service to null.


getVersioningService

public VersioningService getVersioningService()
Returns:
The versioning service.


Copyright © 2010 OW2 Consortium. All Rights Reserved.