1 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 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 getArchiveDirectory() 80 { 81 return getResourceDeploy().getArchiveDirectory().getNativePath(); 82 } 83 84 public String getArchivePath(String name) 85 { 86 return getResourceDeploy().getArchivePath(name).getNativePath(); 87 } 88 89 public String getExtension() 90 { 91 return getResourceDeploy().getExtension(); 92 } 93 94 public String getExpandDirectory() 95 { 96 return getResourceDeploy().getExpandDirectory().getNativePath(); 97 } 98 99 public String getExpandPrefix() 100 { 101 return getResourceDeploy().getExpandPrefix(); 102 } 103 104 public String getExpandSuffix() 105 { 106 return getResourceDeploy().getExpandSuffix(); 107 } 108 109 public String getExpandPath(String name) 110 { 111 Path path = getResourceDeploy().getExpandPath(name); 112 113 return path == null ? null : path.getNativePath(); 114 } 115 116 public String getRedeployMode() 117 { 118 return getResourceDeploy().getRedeployMode(); 119 } 120 121 public String getStartupMode() 122 { 123 return getResourceDeploy().getStartupMode(); 124 } 125 126 public boolean isModified() 127 { 128 return getResourceDeploy().isModified(); 129 } 130 131 public String getState() 132 { 133 return getResourceDeploy().getState(); 134 } 135 136 public void start() 137 { 138 getResourceDeploy().start(); 139 } 140 141 public Throwable 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 [] getNames() 157 { 158 return getResourceDeploy().getNames(); 159 } 160 161 public void start(String name) 162 { 163 getResourceDeploy().start(name); 164 } 165 166 public Throwable getConfigException(String moduleID) 167 { 168 return getResourceDeploy().getConfigException(moduleID); 169 } 170 171 public void stop(String name) 172 { 173 getResourceDeploy().stop(name); 174 } 175 176 public void undeploy(String name) 177 { 178 getResourceDeploy().undeploy(name); 179 } 180 } 181 | Popular Tags |