KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > component > carol > Protocol


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
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: Protocol.java 1022 2006-08-04 11:02:28Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.component.carol;
27
28 /**
29  * Protocol class which describe the RMI protocol configuration.
30  * @author Florent Benoit
31  */

32 public class Protocol {
33
34     /**
35      * Default hostname.
36      */

37     private static final String JavaDoc DEFAULT_HOSTNAME = "localhost";
38
39     /**
40      * Default port number.
41      */

42     private static final int DEFAULT_PORTNUMBER = 1099;
43
44     /**
45      * Name.
46      */

47     private String JavaDoc name = null;
48
49     /**
50      * URL (contains host and port).
51      */

52     private String JavaDoc url = null;
53
54     /**
55      * Hostname (other way to configure the URL).
56      */

57     private String JavaDoc hostname = DEFAULT_HOSTNAME;
58
59     /**
60      * Port number (other way to configure the URL).
61      */

62     private int portNumber = DEFAULT_PORTNUMBER;
63
64     /**
65      * @return the hostname for this protocol
66      */

67     public String JavaDoc getHostname() {
68         return hostname;
69     }
70
71     /**
72      * Sets the hostname of this protocol.
73      * @param hostname the host for listening
74      */

75     public void setHostname(final String JavaDoc hostname) {
76         this.hostname = hostname;
77     }
78
79     /**
80      * @return the name for this protocol
81      */

82     public String JavaDoc getName() {
83         return name;
84     }
85
86     /**
87      * Sets the name of this protocol.
88      * @param name the given name
89      */

90     public void setName(final String JavaDoc name) {
91         this.name = name;
92     }
93
94     /**
95      * @return the port number for this protocol
96      */

97     public int getPortNumber() {
98         return portNumber;
99     }
100
101     /**
102      * Sets the port number of this protocol.
103      * @param portNumber the port for listening
104      */

105     public void setPortNumber(final int portNumber) {
106         this.portNumber = portNumber;
107     }
108
109     /**
110      * @return the URL for this protocol
111      */

112     public String JavaDoc getUrl() {
113         return url;
114     }
115
116     /**
117      * Sets the URL used as PROVIDER_URL.
118      * @param url the url which define host + port.
119      */

120     public void setUrl(final String JavaDoc url) {
121         this.url = url;
122     }
123
124 }
125
Popular Tags