001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.j2ee.deployclient;
030:
031: import javax.enterprise.deploy.spi.Target;
032:
033: /**
034: * Target for a deployment.
035: */
036: public class TargetImpl implements Target, Comparable<TargetImpl>,
037: java.io.Serializable {
038: private String _name;
039: private String _description;
040:
041: private String _clientRefs;
042:
043: /**
044: * Null constructor.
045: */
046: public TargetImpl() {
047: }
048:
049: /**
050: * Constructor
051: */
052: public TargetImpl(String name, String description) {
053: _name = name;
054: _description = description;
055: }
056:
057: /**
058: * Returns the target name.
059: */
060: public String getName() {
061: return _name;
062: }
063:
064: public String getClientRefs() {
065: return _clientRefs;
066: }
067:
068: public void setClientRefs(String refs) {
069: _clientRefs = refs;
070: }
071:
072: /**
073: * Sorts according to name.
074: */
075: public int compareTo(TargetImpl o) {
076: if (o == null)
077: return 1;
078:
079: if (_name == null)
080: return o._name == null ? 0 : 1;
081:
082: if (o._name == null)
083: return 1;
084:
085: return _name.compareTo(o._name);
086: }
087:
088: /**
089: * Returns the target description.
090: */
091: public String getDescription() {
092: return _description;
093: }
094:
095: /**
096: * Prints the string.
097: */
098: public String toString() {
099: return "TargetImpl[" + _name + "]";
100: }
101:
102: }
|