@Override public void run() { // TODO consider removing each child from the parent as each child close completes, rather // than awaiting the completion of the combined future. This would make it easy to give // clearer debug that would highlight the children that have failed to closed. for(Collection<ConfiguredObject<?>> childList : _children.values()) { childList.clear(); } for(Map<UUID,ConfiguredObject<?>> childIdMap : _childrenById.values()) { childIdMap.clear(); } for(Map<String,ConfiguredObject<?>> childNameMap : _childrenByName.values()) { childNameMap.clear(); } LOGGER.debug("All children closed {} : {}", AbstractConfiguredObject.this.getClass().getSimpleName(), getName()); } });
@Override public String toString() { return getCategoryClass().getSimpleName() + "[id=" + _id + ", name=" + getName() + ", type=" + getType() + "]"; }
protected final void handleExceptionOnOpen(RuntimeException e) { if (rethrowRuntimeExceptionsOnOpen() || e instanceof ServerScopedRuntimeException) { throw e; } LOGGER.error("Failed to open object with name '" + getName() + "'. Object will be put into ERROR state.", e); try { onExceptionInOpen(e); } catch (RuntimeException re) { LOGGER.error("Unexpected exception while handling exception on open for " + getName(), e); } if (!_openComplete) { _openFailed = true; _dynamicState.compareAndSet(OPENED, UNINIT); } //TODO: children of ERRORED CO will continue to remain in ACTIVE state setState(State.ERRORED); }
@Override public String toString() { return AbstractConfiguredObject.this.getClass().getSimpleName() + "[name=" + getName() + ", categoryClass=" + getCategoryClass() + ", type=" + getType() + ", id=" + getId() + ", attributes=" + getAttributes() + "]"; } };
protected void logOperation(String operation) { EventLogger eventLogger = getEventLogger(); if(eventLogger != null) { eventLogger.message(new OperationLogMessage(this, operation)); } else { LOGGER.info(getCategoryClass().getSimpleName() + "(" + getName() + ") : Operation " + operation + " invoked by user " + AuthenticatedPrincipal.getCurrentUser().getName()); } }
@Override public ListenableFuture<Void> execute() LOGGER.debug("Closing " + AbstractConfiguredObject.this.getClass().getSimpleName() + " : " + getName()); final SettableFuture<Void> returnFuture = SettableFuture.create(); DynamicStateWithFuture desiredStateWithFuture = new DynamicStateWithFuture(DynamicState.CLOSED, returnFuture);
+ " named '" + getName() + "'" + " cannot have value '" + desiredValueOrDefault + "'" + ". Valid values are: " + " named '" + getName() + "'" + " cannot have value '" + desiredValueOrDefault + "'" + ". Valid values pattern is: " + " named '" + getName() + "'" + " cannot be null, as it is mandatory");
this.getName(), referee.getCategoryClass().getSimpleName(), referee.getName(),
getName()); return Futures.immediateFuture(null); });