View Javadoc

1   /*
2    * Copyright (c) 1998-2004 The Jgroup Team.
3    *
4    * This program is free software; you can redistribute it and/or modify
5    * it under the terms of the GNU Lesser General Public License version 2 as
6    * published by the Free Software Foundation.
7    *
8    * This program is distributed in the hope that it will be useful,
9    * but WITHOUT ANY WARRANTY; without even the implied warranty of
10   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11   * GNU Lesser General Public License for more details.
12   *
13   * You should have received a copy of the GNU Lesser General Public License
14   * along with this program; if not, write to the Free Software
15   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16   *
17   */
18  
19  package jgroup.core.registry;
20  
21  import java.io.IOException;
22  import java.rmi.AccessException;
23  import java.rmi.NotBoundException;
24  import java.rmi.Remote;
25  import java.rmi.RemoteException;
26  
27  import jgroup.core.JgroupException;
28  import jgroup.core.Layer;
29  
30  /**
31   * Service interface for performing lookups from a replicated
32   * client group.  This service must be used for client groups
33   * to ensure that proxies downloaded to client group members
34   * are correctly initialized with the important group manager
35   * information required to suppress duplicates from the clients
36   * at the server-side.  That is, the proxy needs access to the
37   * <code>TimestampService</code>.
38   *
39   * @author Hein Meling
40   */
41  public interface LookupService
42    extends Layer
43  {
44  
45    /**
46     * Returns a proxy for the remote object group associated with
47     * the specified name.
48     *
49     * @param name
50     *   The name associated with the remote object group.
51     * @return
52     *   A proxy for the remote object group.
53     *
54     * @exception RemoteException
55     *   If remote operation failed.
56     * @exception JgroupException
57     *   If the dependable registry could not be found.
58     * @exception NotBoundException
59     *   If there is no object group with this name in the registry/reggie.
60     * @exception AccessException
61     *   If this operation is not permitted.
62     */
63    public Remote lookup(String name)
64      throws RemoteException, JgroupException, NotBoundException, AccessException;
65  
66    /**
67     * Returns a proxy for the remote object group associated with 
68     * the specified name and class in greg. 
69     *  
70     * @param name
71     *   The name associated with the remote object group.
72     * @param clas
73     *   The class associated with the remote object group.
74     * @return
75     *   A proxy for the remote object group.
76     * 
77     * @exception IOException
78     *   If an error occured during lookup.
79     */
80    public Object lookup(String name, Class clas)
81      throws IOException;
82  
83  } // END LookupService