1 29 30 package com.caucho.server.deploy; 31 32 45 public class StartLazyRedeployAutomaticStrategy 46 extends AbstractDeployControllerStrategy { 47 private final static StartLazyRedeployAutomaticStrategy STRATEGY = 48 new StartLazyRedeployAutomaticStrategy(); 49 50 51 private StartLazyRedeployAutomaticStrategy() 52 { 53 } 54 55 60 public static DeployControllerStrategy create() 61 { 62 return STRATEGY; 63 } 64 65 70 public<I extends DeployInstance> 71 void startOnInit(DeployController<I> controller) 72 { 73 controller.stopLazyImpl(); 74 } 75 76 77 83 public<I extends DeployInstance> 84 void update(DeployController<I> controller) 85 { 86 if (controller.isStoppedLazy()) { 87 } 89 else if (controller.isStopped()) { 90 controller.stopLazyImpl(); 92 } 93 else if (controller.isModifiedNow()) { 94 controller.stopLazyImpl(); 96 } 97 else if (controller.isError()) { 98 controller.stopLazyImpl(); 99 } 100 else if (controller.isActiveIdle()) { 101 controller.stopLazyImpl(); 102 } 103 else { 104 } 106 } 107 108 114 public <I extends DeployInstance> 115 I request(DeployController<I> controller) 116 { 117 if (controller.isStoppedLazy()) { 118 return controller.startImpl(); 120 } 121 else if (controller.isStopped()) { 122 return controller.getDeployInstance(); 124 } 125 else if (controller.isModified()) { 126 return controller.restartImpl(); 128 } 129 else { 130 return controller.getDeployInstance(); 132 } 133 } 134 135 141 public <I extends DeployInstance> 142 I subrequest(DeployController<I> controller) 143 { 144 if (controller.isStoppedLazy()) { 145 return controller.startImpl(); 147 } 148 else if (controller.isStopped()) { 149 return controller.getDeployInstance(); 151 } 152 else if (controller.isError() && controller.isModified()) { 153 return controller.restartImpl(); 155 } 156 else if (controller.isModified()) { 157 return controller.getDeployInstance(); 159 } 160 else { 161 return controller.getDeployInstance(); 163 } 164 } 165 166 171 public <I extends DeployInstance> 172 void alarm(DeployController<I> controller) 173 { 174 if (controller.isStoppedLazy()) { 175 } 177 else if (controller.isStopped()) { 178 } 180 else if (controller.isError()) { 181 } 183 else if (controller.isModified()) { 184 controller.stopLazyImpl(); 186 } 187 else if (controller.isActiveIdle()) { 188 controller.stopLazyImpl(); 189 } 190 else { 191 } 192 } 193 } 194 | Popular Tags |