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: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Sam
028: */
029:
030: package com.caucho.jca;
031:
032: import com.caucho.management.server.AbstractManagedObject;
033: import com.caucho.management.server.ResourceDeployMXBean;
034: import com.caucho.vfs.Path;
035:
036: public class ResourceDeployAdmin extends AbstractManagedObject
037: implements ResourceDeployMXBean {
038: private final ResourceDeploy _resourceDeploy;
039:
040: public ResourceDeployAdmin(ResourceDeploy resourceDeploy) {
041: _resourceDeploy = resourceDeploy;
042: }
043:
044: protected ResourceDeploy getResourceDeploy() {
045: return _resourceDeploy;
046: }
047:
048: void register() {
049: registerSelf();
050: }
051:
052: void unregister() {
053: registerSelf();
054: }
055:
056: public String getName() {
057: Path containerRootDirectory = getResourceDeploy()
058: .getContainerRootDirectory();
059:
060: Path archiveDirectory = getResourceDeploy()
061: .getArchiveDirectory();
062:
063: if (containerRootDirectory == null)
064: return archiveDirectory.getNativePath();
065: else
066: return containerRootDirectory
067: .lookupRelativeNativePath(archiveDirectory);
068: }
069:
070: public long getDependencyCheckInterval() {
071: return getResourceDeploy().getDependencyCheckInterval();
072: }
073:
074: public String getArchiveDirectory() {
075: return getResourceDeploy().getArchiveDirectory()
076: .getNativePath();
077: }
078:
079: public String getArchivePath(String name) {
080: return getResourceDeploy().getArchivePath(name).getNativePath();
081: }
082:
083: public String getExtension() {
084: return getResourceDeploy().getExtension();
085: }
086:
087: public String getExpandDirectory() {
088: return getResourceDeploy().getExpandDirectory().getNativePath();
089: }
090:
091: public String getExpandPrefix() {
092: return getResourceDeploy().getExpandPrefix();
093: }
094:
095: public String getExpandSuffix() {
096: return getResourceDeploy().getExpandSuffix();
097: }
098:
099: public String getExpandPath(String name) {
100: Path path = getResourceDeploy().getExpandPath(name);
101:
102: return path == null ? null : path.getNativePath();
103: }
104:
105: public String getRedeployMode() {
106: return getResourceDeploy().getRedeployMode();
107: }
108:
109: public String getStartupMode() {
110: return getResourceDeploy().getStartupMode();
111: }
112:
113: public boolean isModified() {
114: return getResourceDeploy().isModified();
115: }
116:
117: public String getState() {
118: return getResourceDeploy().getState();
119: }
120:
121: public void start() {
122: getResourceDeploy().start();
123: }
124:
125: public Throwable getConfigException() {
126: return getResourceDeploy().getConfigException();
127: }
128:
129: public void stop() {
130: getResourceDeploy().stop();
131: }
132:
133: public void update() {
134: getResourceDeploy().update();
135: }
136:
137: public String[] getNames() {
138: return getResourceDeploy().getNames();
139: }
140:
141: public void start(String name) {
142: getResourceDeploy().start(name);
143: }
144:
145: public Throwable getConfigException(String moduleID) {
146: return getResourceDeploy().getConfigException(moduleID);
147: }
148:
149: public void stop(String name) {
150: getResourceDeploy().stop(name);
151: }
152:
153: public void undeploy(String name) {
154: getResourceDeploy().undeploy(name);
155: }
156: }
|