01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.services.binding;
23:
24: import java.net.URL;
25: import javax.management.ObjectName;
26:
27: /** Interface for API to persist, read, and look up service configs
28: *
29: * @version $Revision: 57210 $
30: * @author <a href="mailto:bitpushr@rochester.rr.com">Mike Finn</a>.
31: * @author Scott.Stark@jboss.org
32: */
33: public interface ServicesStore {
34: /** Load the contents of a store.
35: * @param storeURL the URL representing the location of the store
36: * @exception Exception thrown on any failure to load the store
37: */
38: public void load(URL storeURL) throws Exception;
39:
40: /** Save the current store contents
41: * @param storeURL the URL representing the location of the store
42: * @exception Exception thrown on any failure to save the store
43: */
44: public void store(URL storeURL) throws Exception;
45:
46: /** Obtain a ServiceConfig object for the given server instance and target
47: * service JMX ObjectName. This is called by the JBoss service configuration
48: * layer to obtain service attribute binding overrides.
49: *
50: * @param serverName the name identifying the JBoss server instance in
51: * which the service is running.
52: * @param serviceName the JMX ObjectName of the service
53: * @return The ServiceConfig if one exists for the <serverName, serviceName>
54: * pair, null otherwise.
55: */
56: public ServiceConfig getService(String serverName,
57: ObjectName serviceName);
58:
59: /** Add a ServiceConfig to the store. This is an optional method not used
60: * by the JBoss service configuration layer.
61: *
62: * @param serverName the name identifying the JBoss server instance in
63: * which the service is running.
64: * @param serviceName the JMX ObjectName of the service
65: * @param serviceConfig the configuration to add
66: * @throws DuplicateServiceException thrown if a configuration for the
67: * <serverName, serviceName> pair already exists.
68: */
69: public void addService(String serverName, ObjectName serviceName,
70: ServiceConfig serviceConfig)
71: throws DuplicateServiceException;
72:
73: /** Remove a service configuration from the store. This is an optonal method
74: * not used by the JBoss service configuration layer.
75: *
76: * @param serverName the name identifying the JBoss server instance in
77: * which the service is running.
78: * @param serviceName the JMX ObjectName of the service
79: */
80: public void removeService(String serverName, ObjectName serviceName);
81: }
|