/** * Restart the entity. */ @Effector(description="Restart the process/service represented by an entity") void restart(); }
public AnnotationsOnMethod(Class<?> clazz, Method method) { this.clazz = clazz; this.name = method.getName(); this.returnType = method.getReturnType(); // Get the description brooklyn.entity.annotation.Effector effectorAnnotation = method.getAnnotation(brooklyn.entity.annotation.Effector.class); Description methodDescriptionAnnotation = method.getAnnotation(Description.class); String effDescription = (effectorAnnotation != null) ? effectorAnnotation.description() : null; String effLegacyDescription = (methodDescriptionAnnotation != null) ? methodDescriptionAnnotation.value() : null; if (methodDescriptionAnnotation != null) { if (!Strings.isEmpty(effDescription) && !effDescription.equals(effLegacyDescription)) { log.warn("Deprecated use of @Description on effector "+method+"; preferring @Effector annotation's description"); } else { log.warn("Deprecated use of @Description on effector "+method); } } description = (Strings.isEmpty(effDescription)) ? effLegacyDescription : effDescription; // Get the parameters parameters = Lists.newArrayList(); int numParameters = method.getParameterTypes().length; for (int i = 0; i < numParameters; i++) { parameters.add(toParameterType(method, i)); } }
/** * Stop the entity. */ @Effector(description="Stop the process/service represented by an entity") void stop();
@Effector(description="Forces reload of the configuration") public void reload();
@Effector(description="Unmanages the url-mapping, so it is discarded and no longer applies") public void discard(); }
@Effector(description="Updates the cluster members") void update(); }
@Effector(description="Updates the entities configuration, and then forces reload of that configuration") public void update();
@Effector(description="Updates the cluster members") void update();
@Effector(description="Gets the current server configuration (by brooklyn recalculating what the config should be); does not affect the server") String getCurrentConfiguration();
@Effector(description="Gets the Hostname->IP mappings stored in this DNS server's conf file") public Map<String,String> getAddressMappings();
/** * * @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="Gets the current server configuration (by brooklyn recalculating what the config should be); does not affect the server") public String getCurrentConfiguration() { return getConfigFile(); }
@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);
@Override @Effector(description = "Restart the process/service represented by an entity") public void restart() { log.info("Invoking restart (method) on "+this); invoke(RESTART).getUnchecked(); }
@Override @Effector(description = "Stop the process/service represented by an entity") public void stop() { log.info("Invoking stop (method) on "+this); invoke(STOP).getUnchecked(); }