KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > services > binding > ServicesStore


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * 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 JavaDoc;
25 import javax.management.ObjectName JavaDoc;
26
27 /** Interface for API to persist, read, and look up service configs
28  *
29  * @version $Revision: 37459 $
30  * @author <a HREF="mailto:bitpushr@rochester.rr.com">Mike Finn</a>.
31  * @author Scott.Stark@jboss.org
32  */

33 public interface ServicesStore
34 {
35    /** Load the contents of a store.
36     * @param storeURL the URL representing the location of the store
37     * @exception Exception thrown on any failure to load the store
38     */

39    public void load(URL JavaDoc storeURL) throws Exception JavaDoc;
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 JavaDoc storeURL) throws Exception JavaDoc;
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 JavaDoc serverName, ObjectName JavaDoc serviceName);
57
58    /** Add a ServiceConfig to the store. This is an optional method not used
59     * by the JBoss service configuration layer.
60     *
61     * @param serverName the name identifying the JBoss server instance in
62     * which the service is running.
63     * @param serviceName the JMX ObjectName of the service
64     * @param serviceConfig the configuration to add
65     * @throws DuplicateServiceException thrown if a configuration for the
66     * <serverName, serviceName> pair already exists.
67     */

68    public void addService(String JavaDoc serverName, ObjectName JavaDoc serviceName,
69       ServiceConfig serviceConfig)
70       throws DuplicateServiceException;
71
72    /** Remove a service configuration from the store. This is an optonal method
73     * not used by the JBoss service configuration layer.
74     *
75     * @param serverName the name identifying the JBoss server instance in
76     * which the service is running.
77     * @param serviceName the JMX ObjectName of the service
78     */

79    public void removeService(String JavaDoc serverName, ObjectName JavaDoc serviceName);
80 }
81
Popular Tags