KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > util > configuration > ProtocolConfiguration


1 /**
2  * Copyright (C) 2005 - Bull S.A.
3  *
4  * CAROL: Common Architecture for RMI ObjectWeb Layer
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ProtocolConfiguration.java,v 1.2 2005/04/11 12:39:20 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.carol.util.configuration;
26
27 import java.util.Hashtable JavaDoc;
28 import java.util.Properties JavaDoc;
29
30 import javax.naming.Context JavaDoc;
31 import javax.naming.NamingException JavaDoc;
32
33 /**
34  * This interface defines an rmi configuration that is used by Carol.
35  * @author Florent Benoit
36  */

37 public interface ProtocolConfiguration {
38
39     /**
40      * @return the protocol used by this configuration.
41      */

42     Protocol getProtocol();
43
44     /**
45      * @return the name of this configuration
46      */

47     String JavaDoc getName();
48
49
50     /**
51      * Build an initial context with the given environment using our
52      * configuration
53      * @param env parameters for the initial context
54      * @return an InitialContext
55      * @throws NamingException if the context is not created
56      */

57     Context JavaDoc getInitialContext(Hashtable JavaDoc env) throws NamingException JavaDoc;
58
59     /**
60      * @return properties of this configuration
61      */

62     Properties JavaDoc getProperties();
63
64     /**
65      * @return the host.
66      */

67     String JavaDoc getHost();
68
69     /**
70      * @return the port for this protocol name service
71      */

72     int getPort();
73
74     /**
75      * @return the Provider URL attribute
76      */

77     String JavaDoc getProviderURL();
78
79     /**
80      * Configure this configuration with a given properties object
81      * @param properties given properties
82      * @throws ConfigurationException if the given config is invalid
83      */

84     void configure(Properties JavaDoc properties) throws ConfigurationException;
85 }
86
Popular Tags