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: import javax.enterprise.deploy.spi.TargetModuleID;
033:
034: /**
035: * Represents a deployed module.
036: */
037: public class TargetModuleIDImpl implements TargetModuleID,
038: java.io.Serializable {
039: private TargetImpl _target;
040: private String _moduleID;
041:
042: private TargetModuleID _parent;
043:
044: TargetModuleIDImpl() {
045: }
046:
047: public TargetModuleIDImpl(TargetImpl target, String moduleID) {
048: _target = target;
049: _moduleID = moduleID;
050: }
051:
052: /**
053: * Returns the target for the module.
054: */
055: public Target getTarget() {
056: return _target;
057: }
058:
059: /**
060: * Returns the id.
061: */
062: public String getModuleID() {
063: return _moduleID;
064: }
065:
066: /**
067: * Returns the web url
068: */
069: public String getWebURL() {
070: throw new UnsupportedOperationException();
071: }
072:
073: /**
074: * Returns the identifier of the parent object.
075: */
076: public TargetModuleID getParentTargetModuleID() {
077: return _parent;
078: }
079:
080: /**
081: * Sets the parent.
082: */
083: public void setParentTargetModuleID(TargetModuleID parent) {
084: _parent = parent;
085: }
086:
087: /**
088: * Returns the children of the object.
089: */
090: public TargetModuleID[] getChildTargetModuleID() {
091: return new TargetModuleID[0];
092: }
093:
094: public boolean equals(Object o) {
095: if (!(o instanceof TargetModuleIDImpl))
096: return false;
097:
098: TargetModuleIDImpl id = (TargetModuleIDImpl) o;
099:
100: return (_target.equals(id.getTarget()) && _moduleID.equals(id
101: .getModuleID()));
102: }
103:
104: public String toString() {
105: return "TargetModuleIDImpl[" + getModuleID() + ","
106: + getTarget() + "]";
107: }
108: }
|