Sets the validation to pause.<p>

@param paused <code>true</code> to pause the validation
@param entity the entity will be revalidated when setting paused to <code>false</code>
490606
public void setPaused(boolean paused, CmsEntity entity) {

        if (paused != m_paused) {
            m_paused = paused;
            if (m_paused) {
                if (m_validationTimer != null) {
                    m_validationTimer.cancel();
                    m_validationTimer = null;
                }
            } else {
                m_validationTimer = new ValidationTimer(entity);
                m_validationTimer.schedule(300);
            }

        }
    }
367071
private PauseResult<PersistableUpload> pause(
            final boolean forceCancelTransfers) throws AmazonClientException {
        UploadMonitor uploadMonitor = (UploadMonitor) monitor;
        return uploadMonitor.pause(forceCancelTransfers);
    }
55221
@Override
    // TODO: reduce Cyclomatic complexity
    public final void validate(final Class<?> clazz)
    {

        if (classes.contains(clazz))
        {
            return;
        }

        if (log.isDebugEnabled())
            log.debug("Validating " + clazz.getName());

        // Is Entity?
//        if (clazz.isAnnotationPresent(MappedSuperclass.class))
//        {
//            throw new InvalidEntityDefinitionException("JPA operation over MappedSuperclass are not allowed" + clazz);
//        }
        
        
        // Is Entity?
        if (!clazz.isAnnotationPresent(Entity.class))
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " is not annotated with @Entity.");
        }

        
        // TODO:: add validation for MappedSuperClass.
        
//        // Must be annotated with @Table
//        if (!clazz.isAnnotationPresent(Table.class))
//        {
//            throw new InvalidEntityDefinitionException(clazz.getName() + " must be annotated with @Table.");
//        }

        // must have a default no-argument constructor
        try
        {
            clazz.getConstructor();
        }
        catch (NoSuchMethodException nsme)
        {
            throw new InvalidEntityDefinitionException(clazz.getName()
                    + " must have a default no-argument constructor.");
        }

        // Check for @Key and ensure that there is just 1 @Key field of String
        // type.
        List<Field> keys = new ArrayList<Field>();
        for (Field field : clazz.getDeclaredFields())
        {
            if (field.isAnnotationPresent(Id.class) && field.isAnnotationPresent(EmbeddedId.class))
            {
                throw new InvalidEntityDefinitionException(clazz.getName()
                        + " must have either @Id field or @EmbeddedId field");
            }

            if (field.isAnnotationPresent(Id.class))
            {
                keys.add(field);
                // validate @GeneratedValue annotation if given
                if (field.isAnnotationPresent(GeneratedValue.class))
                {
                    validateGeneratedValueAnnotation(clazz, field);
                }
            }
            else if (field.isAnnotationPresent(EmbeddedId.class))
            {
                keys.add(field);
            }
        }

        if (keys.size() < 0)
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " must have an @Id field.");
        }
        else if (keys.size() > 1)
        {
            throw new InvalidEntityDefinitionException(clazz.getName() + " can only have 1 @Id field.");
        }

        // save in cache

        classes.add(clazz);
    }
854647
protected void cleanEntityForSave(final RESTBaseElementV1<?> entity) throws InvocationTargetException, IllegalAccessException {
        if (entity == null) return;

        for (final Method method : entity.getClass().getMethods()) {
            // If the method isn't a getter or returns void then skip it
            if (!method.getName().startsWith("get") || method.getReturnType().equals(Void.TYPE)) continue;

            // An entity might have
            if (isCollectionClass(method.getReturnType())) {
                cleanCollectionForSave((RESTBaseEntityCollectionV1<?, ?, ?>) method.invoke(entity), true);
            } else if (isEntityClass(method.getReturnType())) {
                cleanEntityForSave((RESTBaseElementWithConfiguredParametersV1) method.invoke(entity));
            }
        }
    }
899204
public void delete(Object entity) {
    try {
      entityManager.executeEntityListeners(CallbackType.PRE_DELETE, entity);
      Key nativeKey = Marshaller.marshalKey(entityManager, entity);
      nativeWriter.delete(nativeKey);
      entityManager.executeEntityListeners(CallbackType.POST_DELETE, entity);
    } catch (DatastoreException exp) {
      throw DatastoreUtils.wrap(exp);
    }
  }
987768
public void setPaused (boolean paused)
    {
        // sanity check
        if ((paused && (_pauseTime != 0)) || (!paused && (_pauseTime == 0))) {
            log.warning("Requested to pause when paused or vice-versa", "paused", paused);
            return;
        }

        _paused = paused;
        if (_paused) {
            // make a note of our pause time
            _pauseTime = _framemgr.getTimeStamp();

        } else {
            // let the animation and sprite managers know that we just warped into the future
            long delta = _framemgr.getTimeStamp() - _pauseTime;
            _animmgr.fastForward(delta);
            _spritemgr.fastForward(delta);

            // clear out our pause time
            _pauseTime = 0;
        }
    }
6659
public void pause() {
        if (hasState(TICKING) && !hasState(PAUSED)) {
            if (DBG) Log.v(TAG, "pause. " + mEntries.size());
            mContentView.animate().cancel();
            addState(PAUSED);
            cancel(-1);
        }
    }
1155430
static void validateDeferredIdAllocation(Object entity) {
    IdentifierMetadata identifierMetadata = EntityIntrospector.getIdentifierMetadata(entity);
    if (identifierMetadata.getDataType() == DataType.STRING) {
      throw new EntityManagerException(
          "Deferred ID allocation is not applicable for entities with String identifiers. ");
    }

  }
1200377
public <T> void validate(T entity) {
		
		// Obtention de l'ensemble des violations
		Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
		
		// Si l'ensemble est vide
		if(constraintViolations == null || constraintViolations.size() == 0) return;

		// Obtention de la première violation
		ConstraintViolation<T> first = constraintViolations.iterator().next();
		
		// Obtention du descripteur de la contrainte
		ConstraintDescriptor<?> constraintDescriptor = first.getConstraintDescriptor();
		
		// Nom du bean en echec
		String entityName = first.getRootBeanClass().getSimpleName();
		
		// Nom de la propriété en echec
		String propertyName = first.getPropertyPath().toString();
		
		// Message de violation
		String message = first.getMessage();
		
		// Obtention de l'annotation en cours
		String[] parameters = buildAnnotationConstraintParameters(constraintDescriptor.getAnnotation());
		
		// On leve une Exception
		throw new InvalidEntityInstanceStateException(entityName, propertyName, message, parameters);
	}
1273791
private void validateSettings(
        CmsEntity entity,
        CmsValidationResult validationResult,
        Map<String, CmsXmlContentProperty> settingsConfig) {

        Map<String, Map<String[], String>> errors = validationResult.getErrors();
        Map<String[], String> entityErrors = errors.get(entity.getId());
        if (entityErrors == null) {
            entityErrors = new HashMap<String[], String>();
        }
        Map<String, Map<String[], String>> warnings = validationResult.getWarnings();
        Map<String[], String> entityWarnings = warnings.get(entity.getId());
        if (entityWarnings == null) {
            entityWarnings = new HashMap<String[], String>();
        }

        for (CmsEntityAttribute attribute : entity.getAttributes()) {
            if (isSettingsAttribute(attribute.getAttributeName())) {
                if (attribute.isSimpleValue()) {
                    String settingsKey = attribute.getAttributeName().substring(
                        SETTINGS_ATTRIBUTE_NAME_PREFIX.length() + 1);
                    CmsXmlContentProperty prop = settingsConfig.get(settingsKey);
                    if (prop != null) {
                        String regex = prop.getRuleRegex();
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(regex)) {
                            if (!attribute.getSimpleValue().matches(regex)) {
                                String[] path = new String[] {attribute.getAttributeName()};

                                if (SETTINGS_RULE_TYPE_ERROR.equals(prop.getRuleType())) {
                                    entityErrors.put(path, prop.getError());
                                } else {
                                    entityWarnings.put(path, prop.getError());
                                }
                            }
                        }
                    }
                } else {
                    CmsEntity nested = attribute.getComplexValue();
                    for (CmsEntityAttribute nestedAttribute : nested.getAttributes()) {
                        String settingsKey = nestedAttribute.getAttributeName().substring(
                            SETTINGS_ATTRIBUTE_NAME_PREFIX.length() + 1);
                        CmsXmlContentProperty prop = settingsConfig.get(settingsKey);
                        if (prop != null) {
                            String regex = prop.getRuleRegex();
                            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(regex)) {
                                if (!nestedAttribute.getSimpleValue().matches(regex)) {
                                    String[] path = new String[] {
                                        attribute.getAttributeName(),
                                        nestedAttribute.getAttributeName()};
                                    if (SETTINGS_RULE_TYPE_ERROR.equals(prop.getRuleType())) {
                                        entityErrors.put(path, prop.getError());
                                    } else {
                                        entityWarnings.put(path, prop.getError());
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        if (!entityErrors.isEmpty()) {
            errors.put(entity.getId(), entityErrors);
        }
        if (!entityWarnings.isEmpty()) {
            warnings.put(entity.getId(), entityWarnings);
        }

    }
826576
@Override
    public PersistableDownload pause() throws PauseException {
        boolean forceCancel = true;
        TransferState currentState = getState();
        this.monitor.getFuture().cancel(true);

        if (persistableDownload == null) {
            throw new PauseException(TransferManagerUtils.determinePauseStatus(
                    currentState, forceCancel));
        }
        return persistableDownload;
    }
952717
def pause(self):
        """"""
        self._mq.send("p", True, type=1)
        self._paused = True
666029
public void setHandler(Object handler){
        if(handler instanceof ContentHandler)
            setContentHandler((ContentHandler)handler);
        if(handler instanceof EntityResolver)
            setEntityResolver((EntityResolver)handler);
        if(handler instanceof ErrorHandler)
            setErrorHandler((ErrorHandler)handler);
        if(handler instanceof DTDHandler)
            setDTDHandler((DTDHandler)handler);
        if(handler instanceof LexicalHandler)
            setLexicalHandler((LexicalHandler)handler);
        if(handler instanceof DeclHandler)
            setDeclHandler((DeclHandler)handler);
    }
946367
public void update(Entity entity) {
        entityCache.put(entity,
                        false); // false -> we don't store state, meaning it will always be seen as changed
        entity.setUpdated(true);
    }
255254
@Override
	public void delete(Object entity) {
		if (entity == null) {
			throw new IllegalArgumentException("'entity' must not be [" + entity + "]");
		}
		
		if (operation != Log.Operation.GET) {
			throw new IllegalStateException("Log [" + operation + "] -> ["
					+ Log.Operation.DELETE
					+ "] is not allowed: previous operation must be ["
					+ Log.Operation.GET + "]");
		}
		
		operation = Log.Operation.DELETE;
	}
513979
public synchronized void pauseControlPoint(final String controlPoint, ServerActivityCallback listener) {
        final List<ControlPoint> eps = new ArrayList<ControlPoint>();
        for (ControlPoint ep : entryPoints.values()) {
            if (ep.getEntryPoint().equals(controlPoint)) {
                if(!ep.isPaused()) {
                    eps.add(ep);
                }
            }
        }
        if(eps.isEmpty()) {
            if(listener != null) {
                listener.done();
            }
        }
        CountingRequestCountCallback realListener = new CountingRequestCountCallback(eps.size(), listener);
        for (ControlPoint ep : eps) {
            ep.pause(realListener);
        }
    }
728241
private Entity fixEntity(Entity entity){
		if(null == entity){
			entity = Entity.create(tableName);
		}else if(StrUtil.isBlank(entity.getTableName())){
			entity.setTableName(tableName);
		}
		return entity;
	}