org.jboss.services.binding
Class ServiceBindingManager

java.lang.Object
  extended by org.jboss.services.binding.ServiceBindingManager
All Implemented Interfaces:
javax.management.MBeanRegistration, ServiceBindingManagerMBean, org.jboss.system.ServiceBinding

public class ServiceBindingManager
extends Object
implements javax.management.MBeanRegistration, ServiceBindingManagerMBean

The services configuration binding manager mbean implementation.

The ServiceBindingManager enables the centralized management of ports, by service. The port configuration store is abstracted out using the ServicesStore and ServicesStoreFactory interfaces. Note that this class does not implement the JBoss services lifecycle methods and hook its behavior off of those because this service is used to configure other services before any of the lifecycle methods are invoked.

Version:
$Revision: 57210 $
Author:
Mike Finn, Scott.Stark@jboss.org, Dimitris Andreadis

Field Summary
 
Fields inherited from interface org.jboss.services.binding.ServiceBindingManagerMBean
OBJECT_NAME
 
Constructor Summary
ServiceBindingManager()
           
 
Method Summary
 void applyServiceConfig(javax.management.ObjectName serviceName)
          Looks up the service config for the requested service using the server name bound to this mbean and invokes the configuration delegate to apply the bindings to the service.
 String getServerName()
           
 ServiceConfig getServiceConfig(javax.management.ObjectName serviceName)
          Looks up the service config for the given service using the server name bound to this mbean.
 javax.management.ObjectName getServiceController()
          Get the ObjectName of the ServiceController
 String getStoreFactoryClassName()
           
 URL getStoreURL()
           
 void postDeregister()
           
 void postRegister(Boolean registrationDone)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
           
 void setServerName(String serverName)
          The name of the server this manager is associated with.
 void setServiceController(javax.management.ObjectName serviceController)
          Set the ObjectName of the ServiceController.
 void setStoreFactoryClassName(String storeFactoryClassName)
          The name of the class implementation of the ServicesStoreFatory.
 void setStoreURL(URL storeURL)
          Set the string representation of the store URL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceBindingManager

public ServiceBindingManager()
Method Detail

getServerName

public String getServerName()
Specified by:
getServerName in interface ServiceBindingManagerMBean

setServerName

public void setServerName(String serverName)
Description copied from interface: ServiceBindingManagerMBean
The name of the server this manager is associated with. This is a logical name used to lookup ServiceConfigs from the ServicesStore.

Specified by:
setServerName in interface ServiceBindingManagerMBean

getStoreFactoryClassName

public String getStoreFactoryClassName()
Specified by:
getStoreFactoryClassName in interface ServiceBindingManagerMBean

setStoreFactoryClassName

public void setStoreFactoryClassName(String storeFactoryClassName)
Description copied from interface: ServiceBindingManagerMBean
The name of the class implementation of the ServicesStoreFatory. The default value is org.jboss.services.binding.XMLServicesStoreFactory.

Specified by:
setStoreFactoryClassName in interface ServiceBindingManagerMBean

getStoreURL

public URL getStoreURL()
Specified by:
getStoreURL in interface ServiceBindingManagerMBean

setStoreURL

public void setStoreURL(URL storeURL)
Set the string representation of the store URL

Specified by:
setStoreURL in interface ServiceBindingManagerMBean

getServiceController

public javax.management.ObjectName getServiceController()
Get the ObjectName of the ServiceController

Specified by:
getServiceController in interface ServiceBindingManagerMBean

setServiceController

public void setServiceController(javax.management.ObjectName serviceController)
                          throws Exception
Set the ObjectName of the ServiceController.

Specified by:
setServiceController in interface ServiceBindingManagerMBean
Parameters:
serviceController - the name of the controller to register to
Throws:
Exception - if there is a problem registering with the controller

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
Exception

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
Exception

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

getServiceConfig

public ServiceConfig getServiceConfig(javax.management.ObjectName serviceName)
                               throws Exception
Looks up the service config for the given service using the server name bound to this mbean.

Specified by:
getServiceConfig in interface ServiceBindingManagerMBean
Parameters:
serviceName - the JMX ObjectName of the service
Returns:
ServiceConfig instance if found, null otherwise
Throws:
Exception

applyServiceConfig

public void applyServiceConfig(javax.management.ObjectName serviceName)
                        throws Exception
Looks up the service config for the requested service using the server name bound to this mbean and invokes the configuration delegate to apply the bindings to the service. If no config if found then this method is a noop.

Specified by:
applyServiceConfig in interface org.jboss.system.ServiceBinding
Parameters:
serviceName - the JMX ObjectName of the service
Throws:
Exception, - thrown on failure to apply an existing configuration
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.