/** * * @param memberId * @throws NoSuchElementException If entity cannot be resolved, or it is not a member */ @Effector(description="Replaces the entity with the given ID, if it is a member; first adds a new member, then removes this one. "+ "Returns id of the new entity; or throws exception if couldn't be replaced.") public String replaceMember(@EffectorParam(name="memberId", description="The entity id of a member to be replaced") String memberId);
/** * For the DEPLOYED_WARS to be updated, the input must match the result of the call to deploy */ @Effector(description="Undeploys the given context/artifact") public void undeploy( @EffectorParam(name="targetName") String targetName); }
/** * Start the entity in the given collection of locations. */ @Effector(description="Start the process/service represented by an entity") void start(@EffectorParam(name="locations") Collection<? extends Location> locations);
@Effector(description="Extends the fabric with a new instance of the fabric's underlying blueprint in a new region, "+ "returning the id of the new entity") public String addRegion( @EffectorParam(name="location", description="Location spec string " + "(e.g. aws-ec2:us-west-1)") String location);
/** * Grow or shrink this entity to the desired size. * * @param desiredSize the new size of the entity group. * @return the new size of the group. */ @Effector(description="Changes the size of the entity (e.g. the number of nodes in a cluster)") Integer resize(@EffectorParam(name="desiredSize", description="The new size of the cluster") Integer desiredSize);
@Effector(description="Stops and removes a region") public void removeRegion( @EffectorParam(name="id", description="ID of the child entity to stop and remove") String id);
@Effector(description="Moves this entity to the given container") public void move(@EffectorParam(name="destination") Entity destination);
/** * Deploys the given artifact, from a source URL, to a given deployment filename/context. * There is some variance in expected filename/context at various servers, * so the following conventions are followed: * <p> * either ROOT.WAR or / denotes root context * <p> * anything of form FOO.?AR (ending .?AR) is copied with that name (unless copying not necessary) * and is expected to be served from /FOO * <p> * anything of form /FOO (with leading slash) is expected to be served from /FOO * (and is copied as FOO.WAR) * <p> * anything of form FOO (without a dot) is expected to be served from /FOO * (and is copied as FOO.WAR) * <p> * otherwise <i>please note</i> behaviour may vary on different appservers; * e.g. FOO.FOO would probably be ignored on appservers which expect a file copied across (usually), * but served as /FOO.FOO on systems that take a deployment context. * <p> * See {@link FileNameToContextMappingTest} for definitive examples! * * @param url where to get the war, as a URL, either classpath://xxx or file:///home/xxx or http(s)... * @param targetName where to tell the server to serve the WAR, see above */ @Effector(description="Deploys the given artifact, from a source URL, to a given deployment filename/context") public void deploy( @EffectorParam(name="url", description="URL of WAR file") String url, @EffectorParam(name="targetName", description="context path where WAR should be deployed (/ for ROOT)") String targetName);
@Override @Effector(description = "Deploys the given artifact, from a source URL, to a given deployment filename/context") public void deploy(@EffectorParam(name = "url", description = "URL of WAR file") String url, @EffectorParam(name = "targetName", description = "context path where WAR should be deployed (/ for ROOT)") String targetName) { super.deploy(url, targetName); restartIfRunning(); }
@Override @Effector(description = "Undeploys the given context/artifact") public void undeploy(@EffectorParam(name = "targetName") String targetName) { super.undeploy(targetName); restartIfRunning(); }
/** For the DEPLOYED_WARS to be updated, the input must match the result of the call to deploy */ @Override @Effector(description="Undeploys the given context/artifact") public void undeploy( @EffectorParam(name="targetName") String targetName) { try { JavaWebAppDriver driver = getDriver(); driver.undeploy(targetName); // Update attribute Set<String> deployedWars = getAttribute(DEPLOYED_WARS); if (deployedWars == null) { deployedWars = Sets.newLinkedHashSet(); } deployedWars.remove(targetName); setAttribute(DEPLOYED_WARS, deployedWars); } catch (RuntimeException e) { // Log and propagate, so that log says which entity had problems... LOG.warn("Error undeploying '"+targetName+"' on "+toString()+"; rethrowing...", e); throw Throwables.propagate(e); } }
@EffectorParam(name="url", description="URL of WAR file") String url, @EffectorParam(name="targetName", description="context path where WAR should be deployed (/ for ROOT)") String targetName) { try { checkNotNull(url, "url");
@Override @Effector(description = "Start the process/service represented by an entity") public void start(@EffectorParam(name = "locations") Collection<? extends Location> locations) { log.info("Invoking start (method) on "+this); invoke(START, ConfigBag.newInstance().configure(StartParameters.LOCATIONS, locations).getAllConfig()) .getUnchecked(); }