org.jboss.services.binding
Class XMLServicesStore

java.lang.Object
  extended byorg.jboss.services.binding.XMLServicesStore
All Implemented Interfaces:
ServicesStore (src)

public class XMLServicesStore
extends java.lang.Object
implements ServicesStore (src)

XML implementation of ServicesStore.

Reads/writes/manages the XML config file for the ServiceBinding Manager module


Constructor Summary
XMLServicesStore()
           
 
Method Summary
 void addService(java.lang.String serverName, ObjectName (src)  serviceName, ServiceConfig (src)  config)
          This method is not usable in this implementation as XMLServiceStore is read-only
 ServiceConfig (src) getService(java.lang.String serverName, ObjectName (src)  serviceName)
          Looks up a service, by server name and service name.
 void load(java.net.URL cfgURL)
          Loads XML config file into memory and parses it into ServiceConfig objects.
 void removeService(java.lang.String serverName, ObjectName (src)  serviceName)
          This method is not usable in this implementation as XMLServiceStore is read-only
 void store(java.net.URL cfgURL)
          Store is a noop as this is a read-only store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLServicesStore

public XMLServicesStore()
Method Detail

addService

public void addService(java.lang.String serverName,
                       ObjectName (src)  serviceName,
                       ServiceConfig (src)  config)
                throws DuplicateServiceException (src) 
This method is not usable in this implementation as XMLServiceStore is read-only

Specified by:
addService in interface ServicesStore (src)
Parameters:
serverName -
serviceName -
config -
Throws:
DuplicateServiceException (src) - never thrown
UnsupportedOperationException("XMLServiceStore - is read-only") always thrown

getService

public ServiceConfig (src)  getService(java.lang.String serverName,
                                ObjectName (src)  serviceName)
Looks up a service, by server name and service name. If the server or service does not exist, a null object is returned.

Specified by:
getService in interface ServicesStore (src)
Parameters:
serverName - The name of the server in the config file
serviceName - The name of the service (i.e. the JMX object name)
Returns:
The ServiceConfig if one exists for the pair, null otherwise.

removeService

public void removeService(java.lang.String serverName,
                          ObjectName (src)  serviceName)
This method is not usable in this implementation as XMLServiceStore is read-only

Specified by:
removeService in interface ServicesStore (src)
Parameters:
serverName -
serviceName -
Throws:
UnsupportedOperationException("XMLServiceStore - is read-only") always thrown

load

public void load(java.net.URL cfgURL)
          throws java.lang.Exception
Loads XML config file into memory and parses it into ServiceConfig objects.

Specified by:
load in interface ServicesStore (src)
Parameters:
cfgURL - the URL representing the location of the store
Throws:
java.lang.Exception - on any parse error

store

public void store(java.net.URL cfgURL)
           throws java.lang.Exception
Store is a noop as this is a read-only store

Specified by:
store in interface ServicesStore (src)
Parameters:
cfgURL - the URL representing the location of the store
Throws:
java.lang.Exception - thrown on any failure to save the store