01: /*
02: * %W% %E%
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.jump.module.serviceregistry;
28:
29: import com.sun.jump.module.JUMPModule;
30:
31: import java.rmi.Remote;
32: import java.rmi.AlreadyBoundException;
33: import java.rmi.NotBoundException;
34: import java.rmi.RemoteException;
35: import java.rmi.AccessException;
36:
37: /**
38: * <code>JUMPServiceRepository</code> represents a registry of services
39: * in which processes in JUMP system can register and let others to use
40: * in the form of lightweight remote method invocation (RMI).
41: */
42:
43: public interface JUMPServiceRegistryModule extends JUMPModule {
44:
45: /**
46: * Registers a service under a given name to the registry, and make it
47: * available for other JUMP processes.
48: * A wrapper for IxcRegistry.bind(String, Remote)
49: *
50: * @throws AlreadyBoundException if the name is already bound to another service.
51: * @throws RemoteException if the service object is not well-formed.
52: **/
53: public void registerService(String name, Remote service)
54: throws RemoteException, AlreadyBoundException;
55:
56: /**
57: * Removes a service with a given name from the registry.
58: * A wrapper for IxcRegistry.unbind(String)
59: *
60: * @throws NotBoundException if the name is not found in this registry.
61: * @throws AccessException if the name is bound not by the caller.
62: **/
63: public void unregisterService(String name)
64: throws NotBoundException, AccessException;
65:
66: /**
67: * Gets a service from the registry under a given name.
68: * A wrapper for IxcRegistry.lookup(name)
69: *
70: * @throws NotBoundException if the name is not found in this registry.
71: * @throws RemoteException if the service retrieval fails.
72: **/
73: public Remote getService(String name) throws NotBoundException,
74: RemoteException;
75:
76: /**
77: * Provides a list of service names currently available in this registry.
78: * A wrapper for IxcRegistry.list()
79: **/
80: public String[] listRegisteredServices();
81:
82: }
|