001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: Protocol.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.component.carol;
025:
026: /**
027: * Protocol class which describe the RMI protocol configuration.
028: * @author Florent Benoit
029: */
030: public class Protocol {
031:
032: /**
033: * Default hostname.
034: */
035: private static final String DEFAULT_HOSTNAME = "localhost";
036:
037: /**
038: * Default port number.
039: */
040: private static final int DEFAULT_PORTNUMBER = 1099;
041:
042: /**
043: * Name.
044: */
045: private String name = null;
046:
047: /**
048: * URL (contains host and port).
049: */
050: private String url = null;
051:
052: /**
053: * Hostname (other way to configure the URL).
054: */
055: private String hostname = DEFAULT_HOSTNAME;
056:
057: /**
058: * Port number (other way to configure the URL).
059: */
060: private int portNumber = DEFAULT_PORTNUMBER;
061:
062: /**
063: * @return the hostname for this protocol
064: */
065: public String getHostname() {
066: return hostname;
067: }
068:
069: /**
070: * Sets the hostname of this protocol.
071: * @param hostname the host for listening
072: */
073: public void setHostname(final String hostname) {
074: this .hostname = hostname;
075: }
076:
077: /**
078: * @return the name for this protocol
079: */
080: public String getName() {
081: return name;
082: }
083:
084: /**
085: * Sets the name of this protocol.
086: * @param name the given name
087: */
088: public void setName(final String name) {
089: this .name = name;
090: }
091:
092: /**
093: * @return the port number for this protocol
094: */
095: public int getPortNumber() {
096: return portNumber;
097: }
098:
099: /**
100: * Sets the port number of this protocol.
101: * @param portNumber the port for listening
102: */
103: public void setPortNumber(final int portNumber) {
104: this .portNumber = portNumber;
105: }
106:
107: /**
108: * @return the URL for this protocol
109: */
110: public String getUrl() {
111: return url;
112: }
113:
114: /**
115: * Sets the URL used as PROVIDER_URL.
116: * @param url the url which define host + port.
117: */
118: public void setUrl(final String url) {
119: this.url = url;
120: }
121:
122: }
|