KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jca > ResourceDeployAdmin


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  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Sam
28  */

29
30 package com.caucho.jca;
31
32 import com.caucho.management.server.AbstractManagedObject;
33 import com.caucho.management.server.ResourceDeployMXBean;
34 import com.caucho.vfs.Path;
35
36 public class ResourceDeployAdmin
37   extends AbstractManagedObject
38   implements ResourceDeployMXBean
39 {
40   private final ResourceDeploy _resourceDeploy;
41
42   public ResourceDeployAdmin(ResourceDeploy resourceDeploy)
43   {
44     _resourceDeploy = resourceDeploy;
45   }
46
47   protected ResourceDeploy getResourceDeploy()
48   {
49     return _resourceDeploy;
50   }
51
52   void register()
53   {
54     registerSelf();
55   }
56
57   void unregister()
58   {
59     registerSelf();
60   }
61
62   public String JavaDoc getName()
63   {
64     Path containerRootDirectory = getResourceDeploy().getContainerRootDirectory();
65
66     Path archiveDirectory = getResourceDeploy().getArchiveDirectory();
67
68     if (containerRootDirectory == null)
69       return archiveDirectory.getNativePath();
70     else
71       return containerRootDirectory.lookupRelativeNativePath(archiveDirectory);
72   }
73
74   public long getDependencyCheckInterval()
75   {
76     return getResourceDeploy().getDependencyCheckInterval();
77   }
78
79   public String JavaDoc getArchiveDirectory()
80   {
81     return getResourceDeploy().getArchiveDirectory().getNativePath();
82   }
83
84   public String JavaDoc getArchivePath(String JavaDoc name)
85   {
86     return getResourceDeploy().getArchivePath(name).getNativePath();
87   }
88
89   public String JavaDoc getExtension()
90   {
91     return getResourceDeploy().getExtension();
92   }
93
94   public String JavaDoc getExpandDirectory()
95   {
96     return getResourceDeploy().getExpandDirectory().getNativePath();
97   }
98
99   public String JavaDoc getExpandPrefix()
100   {
101     return getResourceDeploy().getExpandPrefix();
102   }
103
104   public String JavaDoc getExpandSuffix()
105   {
106     return getResourceDeploy().getExpandSuffix();
107   }
108
109   public String JavaDoc getExpandPath(String JavaDoc name)
110   {
111     Path path = getResourceDeploy().getExpandPath(name);
112
113     return path == null ? null : path.getNativePath();
114   }
115
116   public String JavaDoc getRedeployMode()
117   {
118     return getResourceDeploy().getRedeployMode();
119   }
120
121   public String JavaDoc getStartupMode()
122   {
123     return getResourceDeploy().getStartupMode();
124   }
125
126   public boolean isModified()
127   {
128     return getResourceDeploy().isModified();
129   }
130
131   public String JavaDoc getState()
132   {
133     return getResourceDeploy().getState();
134   }
135
136   public void start()
137   {
138     getResourceDeploy().start();
139   }
140
141   public Throwable JavaDoc getConfigException()
142   {
143     return getResourceDeploy().getConfigException();
144   }
145
146   public void stop()
147   {
148     getResourceDeploy().stop();
149   }
150
151   public void update()
152   {
153     getResourceDeploy().update();
154   }
155
156   public String JavaDoc[] getNames()
157   {
158     return getResourceDeploy().getNames();
159   }
160
161   public void start(String JavaDoc name)
162   {
163     getResourceDeploy().start(name);
164   }
165
166   public Throwable JavaDoc getConfigException(String JavaDoc moduleID)
167   {
168     return getResourceDeploy().getConfigException(moduleID);
169   }
170
171   public void stop(String JavaDoc name)
172   {
173     getResourceDeploy().stop(name);
174   }
175
176   public void undeploy(String JavaDoc name)
177   {
178     getResourceDeploy().undeploy(name);
179   }
180 }
181
Popular Tags