/* (non-Javadoc)
@see nz.co.senanque.rules.RuleSession#readonly(nz.co.senanque.rules.RuleContext, nz.co.senanque.validationengine.ProxyField)
487573
@InternalFunction(precedence=1,isAssign=true)
    public void readonly(RuleContext ruleContext,RuleProxyField ruleProxyField)
    {
        setReadOnly(ruleProxyField,ruleContext);
    }
368227
public void clean(final ValidationObject object)
    {
        if (m_enabled)
        {
            m_validationEngine.clean(object);
            for (ProxyField proxyField:m_history) {
            	proxyField.expire();
            }
        }
    }
62623
public static <T> Position.Readable<T> readOnly(final T value) {
        return readOnly(Validate.notNull(value, "value").getClass(), value);
    }
863792
def get_readonly_fields(self, request, obj=None):
        
        if obj:
            return list(self.readonly_fields) + ['id', 'identity',
                                                 'is_current']
        return self.readonly_fields
1176591
public void autoAssign(ProxyField proxyField, RuleContext ruleContext)
    {
        // Count the excludes left and if only 1 then assign this value.
        // TODO: work out what should happen if a later rule excludes this value
        ChoiceBase lastChoice = findLastChoice(proxyField);
        if (lastChoice != null)
        {
            Object value = proxyField.getPropertyMetadata().convertFromString(lastChoice.getKey().toString());
            s_log.debug("{}auto-assign: {} {}",new Object[]{m_indenter,proxyField,value});
            assign(getRuleProxyField(proxyField),value,ruleContext,true);
        }        
    }
564231
@Override
    public final void sessionOpened(IoSession session) throws Exception {
        ProxyIoSession proxyIoSession = (ProxyIoSession) session
                .getAttribute(ProxyIoSession.PROXY_SESSION);

        if (proxyIoSession.getRequest() instanceof SocksProxyRequest
                || proxyIoSession.isAuthenticationFailed()
                || proxyIoSession.getHandler().isHandshakeComplete()) {
            proxySessionOpened(session);
        } else {
            logger.debug("Filtered session opened event !");
        }
    }
1032030
public void set(ValidationSession session, ProxyField proxyField,
            Object value)
    {
        RuleSessionImpl ruleSession = getRuleSession(session);
        RuleProxyField ruleProxyField = ruleSession.getRuleProxyField(proxyField);
        if (ruleProxyField != null)
        {
            ruleSession.setValue(ruleProxyField, value);
        }
    }
257465
public void setReadOnly(final String dataSourceName, final boolean readOnly) {
		Map<String, String> props = getConnPropsByDataSourceName(dataSourceName);
		props.put(PROPS_READ_ONLY, Boolean.toString(readOnly));
	}
953534
public static void transaction(Runnable action, boolean readOnly) {
		Ctx ctx = Ctxs.get();
		boolean newContext = ctx == null;

		if (newContext) {
			ctx = Ctxs.open("transaction");
		}

		try {
			EntityManager em = ctx.persister();
			JPA.with(em).transactional(action, readOnly);

		} finally {
			if (newContext) {
				Ctxs.close();
			}
		}
	}
985219
public final void setReadOnly(boolean isReadOnly) throws SQLException 
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "Set readOnly to " + isReadOnly); 
        sqlConn.setReadOnly(isReadOnly);
        connectionPropertyChanged = true; 
    }
448887
Object readResolve() throws ObjectStreamException {
        Bean<?> bean = Container.instance(contextId).services().get(ContextualStore.class).<Bean<Object>, Object>getContextual(beanId);
        if (bean == null) {
            throw BeanLogger.LOG.proxyDeserializationFailure(beanId);
        }
        return Container.instance(contextId).deploymentManager().getClientProxyProvider().getClientProxy(bean);
    }
253808
public void sessionWillPassivate(HttpSessionEvent event) {
        for (Entry<String, SessionFieldMapper> entry : this.entrySet())  {
            if (!entry.getValue().serializable) {
                event.getSession().removeAttribute(entry.getKey());
            }
        }
    }
956289
@Override
	public boolean isReadonly() {

		if (isIdProperty() || isVersionProperty()) {
			return false;
		}

		Indexed indexedAnnotation = getIndexAnnotation();
		if (indexedAnnotation != null && indexedAnnotation.readonly()) {
			return true;
		}
		if (indexedAnnotation == null && getFieldAnnotation() == null) {
			return true;
		}
		return false;
	}
963714
def derive_readonly(self):
        
        readonly = list(self.readonly)
        for key, value in self.field_config.items():
            if 'readonly' in value and value['readonly']:
                readonly.append(key)

        return readonly
897680
public static boolean isBeanProxyable(Bean<?> bean, BeanManagerImpl manager) {
        if (bean instanceof RIBean<?>) {
            return ((RIBean<?>) bean).isProxyable();
        } else {
            return Proxies.isTypesProxyable(bean.getTypes(), manager.getServices());
        }
    }
677692
@InternalFunction(precedence=1,isAssign=true)
    public void exclude(RuleContext ruleContext, String key, RuleProxyField proxyField)
    {
        exclude(proxyField,key,ruleContext);
    }
1031972
private void resetNextProxy(HttpUrl url, Proxy proxy) {
    if (proxy != null) {
      // If the user specifies a proxy, try that and only that.
      proxies = Collections.singletonList(proxy);
    } else {
      // Try each of the ProxySelector choices until one connection succeeds.
      List<Proxy> proxiesOrNull = address.proxySelector().select(url.uri());
      proxies = proxiesOrNull != null && !proxiesOrNull.isEmpty()
          ? Util.immutableList(proxiesOrNull)
          : Util.immutableList(Proxy.NO_PROXY);
    }
    nextProxyIndex = 0;
  }