1 29 30 package com.caucho.server.deploy; 31 32 45 public class StartAutoRedeployAutoStrategy 46 extends AbstractDeployControllerStrategy { 47 private final static StartAutoRedeployAutoStrategy STRATEGY = 48 new StartAutoRedeployAutoStrategy(); 49 50 private StartAutoRedeployAutoStrategy() 51 { 52 } 53 54 59 public static DeployControllerStrategy create() 60 { 61 return STRATEGY; 62 } 63 64 69 public<I extends DeployInstance> 70 void startOnInit(DeployController<I> controller) 71 { 72 controller.startImpl(); 73 } 74 75 81 public<I extends DeployInstance> 82 void update(DeployController<I> controller) 83 { 84 if (controller.isStoppedLazy()) { 85 } 87 else if (controller.isStopped()) { 88 controller.startImpl(); 90 } 91 else if (controller.isModifiedNow()) { 92 controller.restartImpl(); 94 } 95 else if (controller.isError()) { 96 controller.restartImpl(); 97 } 98 else if (controller.isActiveIdle()) { 99 controller.restartImpl(); 100 } 101 else { 102 } 103 } 104 105 106 112 public <I extends DeployInstance> 113 I request(DeployController<I> controller) 114 { 115 if (controller.isStoppedLazy()) { 116 return controller.startImpl(); 118 } 119 else if (controller.isStopped()) { 120 return controller.getDeployInstance(); 122 } 123 else if (controller.isModified()) { 124 return controller.restartImpl(); 126 } 127 else { 128 return controller.getDeployInstance(); 130 } 131 } 132 133 139 public <I extends DeployInstance> 140 I subrequest(DeployController<I> controller) 141 { 142 if (controller.isStoppedLazy()) { 143 return controller.startImpl(); 145 } 146 else if (controller.isStopped()) { 147 return controller.getDeployInstance(); 149 } 150 else if (controller.isModified()) { 151 return controller.getDeployInstance(); 153 } 154 else { 155 return controller.getDeployInstance(); 157 } 158 } 159 160 165 public <I extends DeployInstance> 166 void alarm(DeployController<I> controller) 167 { 168 if (controller.isStopped()) { 169 } 171 else if (controller.isStoppedLazy()) { 172 } 174 else if (controller.isModified()) { 175 controller.restartImpl(); 177 } 178 else if (controller.isActiveIdle()) { 179 } 180 else { 181 } 182 } 183 } 184 | Popular Tags |