KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > j2ee > deployclient > TargetModuleIDImpl


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.j2ee.deployclient;
30
31 import javax.enterprise.deploy.spi.Target JavaDoc;
32 import javax.enterprise.deploy.spi.TargetModuleID JavaDoc;
33
34 /**
35  * Represents a deployed module.
36  */

37 public class TargetModuleIDImpl implements TargetModuleID JavaDoc, java.io.Serializable JavaDoc {
38   private TargetImpl _target;
39   private String JavaDoc _moduleID;
40
41   private TargetModuleID JavaDoc _parent;
42
43   TargetModuleIDImpl()
44   {
45   }
46
47   public TargetModuleIDImpl(TargetImpl target, String JavaDoc moduleID)
48   {
49     _target = target;
50     _moduleID = moduleID;
51   }
52   
53   /**
54    * Returns the target for the module.
55    */

56   public Target JavaDoc getTarget()
57   {
58     return _target;
59   }
60     
61   /**
62    * Returns the id.
63    */

64   public String JavaDoc getModuleID()
65   {
66     return _moduleID;
67   }
68     
69   /**
70    * Returns the web url
71    */

72   public String JavaDoc getWebURL()
73   {
74     throw new UnsupportedOperationException JavaDoc();
75   }
76
77   /**
78    * Returns the identifier of the parent object.
79    */

80   public TargetModuleID JavaDoc getParentTargetModuleID()
81   {
82     return _parent;
83   }
84
85   /**
86    * Sets the parent.
87    */

88   public void setParentTargetModuleID(TargetModuleID JavaDoc parent)
89   {
90     _parent = parent;
91   }
92
93   /**
94    * Returns the children of the object.
95    */

96   public TargetModuleID JavaDoc []getChildTargetModuleID()
97   {
98     return new TargetModuleID JavaDoc[0];
99   }
100
101   public boolean equals(Object JavaDoc o)
102   {
103     if (! (o instanceof TargetModuleIDImpl))
104       return false;
105
106     TargetModuleIDImpl id = (TargetModuleIDImpl) o;
107
108     return (_target.equals(id.getTarget()) &&
109         _moduleID.equals(id.getModuleID()));
110   }
111
112   public String JavaDoc toString()
113   {
114     return "TargetModuleIDImpl[" + getModuleID() + "," + getTarget() + "]";
115   }
116 }
117
118
Popular Tags