<p>Set bean.</p>
@param pBeanName - bean name
@param pBean bean
@throws Exception - an exception
489091
@Override
  public final synchronized void set(final String pBeanName,
    final IEntityFileReporter pBean) throws Exception {
    this.reportersMap.put(pBeanName, pBean);
  }
914348
public void initSetupBean() {

        m_bean.setAutoMode(true);
        m_bean.setDatabase(m_props.getDbProduct());
        m_bean.setDb(m_props.getDbName());
        m_bean.setDbCreateUser(m_props.getCreateUser());
        m_bean.setDbCreatePwd(m_props.getCreatePwd() == null ? "" : m_props.getCreatePwd());
        m_bean.setDbWorkUser(m_props.getWorkerUser());
        m_bean.setDbWorkPwd(m_props.getWorkerPwd() == null ? "" : m_props.getWorkerPwd());
        m_bean.setDbCreateConStr(m_props.getConnectionUrl());
        m_bean.setDbWorkConStr(m_props.getConnectionUrl());
        m_bean.setDbParamaters(m_props.toParameterMap(), m_props.getDbProvider(), "/opencms/", null);

        m_bean.setServerName(m_props.getServerName());
        m_bean.setWorkplaceSite(m_props.getServerUrl());
        m_bean.setEthernetAddress(
            m_props.getEthernetAddress() == null ? CmsStringUtil.getEthernetAddress() : m_props.getEthernetAddress());

        // initialize the available modules
        m_bean.getAvailableModules();
        List<String> componentsToInstall = m_props.getInstallComponents();
        String modules = m_bean.getComponentModules(componentsToInstall);
        m_bean.setInstallModules(modules);
    }
994627
@Override
  public final Object lazyGet(
    final String pBeanName) throws Exception {
    if (this.isReconfiguring) {
      throw new ExceptionWithCode(ExceptionWithCode.SYSTEM_RECONFIGURING,
        "system_reconfiguring");
    }
    if (this.isReinitializing) {
      // locking:
      synchronized (this) {
        if (this.isReinitializing) {
          init(); //complex initializing inner factories delegate
          this.isReinitializing = false;
        }
      }
    }
    setLastRequestTime(new Date().getTime());
    Object bean = this.beansMap.get(pBeanName);
    // see in beige-common:
    // org.beigesoft.test.DoubleCkeckLockingWrApTest
    if (bean == null) {
      // locking:
      synchronized (this) {
        // make sure again whether it's null after locking:
        bean = this.beansMap.get(pBeanName);
        if (bean == null) {
          if (getHandlerEntityRequestName().equals(pBeanName)) {
            bean = this.factoryBldServices.lazyGetHandlerEntityRequest();
          } else if (getHndlEntityFileReportReqName().equals(pBeanName)) {
            bean = this.factoryBldServices.lazyGetHndlEntityFileReportReq();
          } else if (getSrvOrmName().equals(pBeanName)) {
            bean = lazyGetSrvOrm();
          } else if (getSessionTrackerName().equals(pBeanName)) {
            bean = lazyGetSessionTracker();
          } else if (getImportFullDatabaseCopyName().equals(pBeanName)) {
            bean = lazyGetImportFullDatabaseCopy();
          } else if (getDatabaseWriterName().equals(pBeanName)) {
            bean = lazyGetDbWriterFullCopy();
          } else if (getMailSenderName().equals(pBeanName)) {
            bean = lazyGetMailSender();
          } else if (getHndlI18nRequestName().equals(pBeanName)) {
            bean = lazyGetHndlI18nRequest();
          } else if (getUtilXmlName().equals(pBeanName)) {
            bean = lazyGetUtilXml();
          } else if (getSecureLoggerName().equals(pBeanName)) {
            bean = lazyGetSecureLogger();
          } else if (getLoggerName().equals(pBeanName)) {
            bean = lazyGetLogger();
          } else if (getMngSoftwareName().equals(pBeanName)) {
            bean = lazyGetMngSoftware();
          } else if (getSrvI18nName().equals(pBeanName)) {
            bean = lazyGetSrvI18n();
          } else if (getUtlJspName().equals(pBeanName)) {
            bean = lazyGetUtlJsp();
          } else if (getSrvDatabaseName().equals(pBeanName)) {
            bean = lazyGetSrvDatabase();
          } else if (getHlpEntitiesPageName().equals(pBeanName)) {
            bean = lazyGetHlpEntitiesPage();
          } else if (getSrvNumberToStringName().equals(pBeanName)) {
            bean = lazyGetSrvNumberToString();
          } else if (getSrvDateName().equals(pBeanName)) {
            bean = lazyGetSrvDate();
          } else if (getSrvPageName().equals(pBeanName)) {
            bean = lazyGetSrvPage();
          } else if (getFillEntityFromReqName().equals(pBeanName)) {
            bean = lazyGetFillEntityFromReq();
          } else if (getMngUvdSettingsName().equals(pBeanName)) {
            bean = lazyGetMngUvdSettings();
          } else if (getUtlPropertiesName().equals(pBeanName)) {
            bean = lazyGetUtlProperties();
          } else if (getUtlReflectionName().equals(pBeanName)) {
            bean = lazyGetUtlReflection();
          } else if (getMngSettingsGetDbCopyName().equals(pBeanName)) {
            bean = lazyGetMngSettingsGetDbCopy();
          } else if (getHldFieldsCnvTfsNamesName().equals(pBeanName)) {
            bean = lazyGetHldFieldsCnvTfsNames();
          } else if (getFctConvertersToFromStringName().equals(pBeanName)) {
            bean = lazyGetFctConvertersToFromString();
          } else if (getFctFillersObjectFieldsName().equals(pBeanName)) {
            bean = lazyGetFctFillersObjectFields();
          } else if (getHolderRapiSettersName().equals(pBeanName)) {
            bean = lazyGetHolderRapiSetters();
          } else if (getHolderRapiGettersName().equals(pBeanName)) {
            bean = lazyGetHolderRapiGetters();
          } else if (getHolderRapiFieldsName().equals(pBeanName)) {
            bean = lazyGetHolderRapiFields();
          } else if (getHlpInsertUpdateName().equals(pBeanName)) {
            bean = lazyGetHlpInsertUpdate();
          } else if (getFillerEntitiesFromRsName().equals(pBeanName)) {
            bean = lazyGetFillerEntitiesFromRs();
          } else if (getFctBnCnvBnFromRsName().equals(pBeanName)) {
            bean = lazyGetFctBnCnvBnFromRs();
          } else if (getFctBnCnvIbnToColumnValuesName().equals(pBeanName)) {
            bean = lazyGetFctBnCnvIbnToColumnValues();
          } else if (getCsvReaderName().equals(pBeanName)) {
            bean = lazyGetCsvReader();
          } else if (getSrvSqlEscapeName().equals(pBeanName)) {
            bean = lazyGetSrvSqlEscape();
          } else if (getHldCnvToColumnsValuesNamesName().equals(pBeanName)) {
            bean = lazyGetHldCnvToColumnsValuesNames();
          } else if (getPrepareDbAfterFullImportName().equals(pBeanName)) {
            bean = lazyGetPrepareDbAfterFullImport();
          } else if (getHldCnvFromRsNamesName().equals(pBeanName)) {
            bean = lazyGetHldCnvFromRsNames();
          } else if (getFctBcFctSimpleEntitiesName().equals(pBeanName)) {
            bean = this.factoryBldServices.lazyGetFctBcFctSimpleEntities();
          } else if (getFctBcCnvEntityToColumnsValuesName().equals(pBeanName)) {
            bean = lazyGetFctBcCnvEntityToColumnsValues();
          } else {
            bean = lazyGetOtherBean(pBeanName);
            if (bean == null && this.factoryOverBeans != null) {
                bean = this.factoryOverBeans.lazyGet(pBeanName);
            }
          }
        }
      }
    }
    if (bean == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no bean with name " + pBeanName);
    }
    return bean;
  }
151559
public void setName(String fieldName) {
        if (m_name != null) {
            throw new IllegalArgumentException("Field name is already set: " + m_name);
        }
        if (!isValidFieldName(fieldName)) {
            throw new IllegalArgumentException("Invalid field name: " + fieldName);
        }
        m_name = fieldName;
    }
880751
public <T> void setBeanProperty(final T bean, final Object property, final Object value) {
        if (bean != null) {
            @SuppressWarnings("unchecked")
            SetResolver<T> resolver = this.setters.unsafeGet(bean.getClass());
            if (resolver != null) {
                resolver.set(bean, property, value);
                return;
            }
        }
        this.resolverManager.set(bean, property, value);
    }
1015614
public void setResourcesInBean(CmsOrgUnitBean orgUnitBean, List<CmsResource> resources) {

        List<String> resourceNames = new ArrayList<String>();
        Iterator<CmsResource> itResources = resources.iterator();
        while (itResources.hasNext()) {
            CmsResource resource = itResources.next();
            resourceNames.add(getCms().getSitePath(resource));
        }
        orgUnitBean.setResources(resourceNames);
    }
1170851
@Override
  public final void setFor(final String pThing,
    final Class<?> pCls, final String pFldNm) {
    try {
    this.mngSettings.lazFldSts(pCls, pFldNm)
      .put(this.settingName, pThing);
    } catch (Exception e) {
      throw new RuntimeException(
        "Can't set class/field/setting: " + pCls + "/"
          + pFldNm + "/" + pThing, e);
    }
  }
732659
public static <T> void setProperty(Object bean, String name, Class<T> clazz, T value) throws Exception {
        Method method = ReflectUtils.getPropertySetterMethod(bean.getClass(), name, clazz);
        if (method.isAccessible()) {
            method.invoke(bean, value);
        } else {
            try {
                method.setAccessible(true);
                method.invoke(bean, value);
            } finally {
                method.setAccessible(false);
            }
        }
    }
806164
public static void setProperty(Object bean, String propertyName, Object value,boolean throwExceptionForMissingProperty)
   {
      try
      {
         //find key ignoreClase
         //PropertyUtils.setProperty(aBean, aPropName, aValue);
    	  PropertyDescriptor propertyDescriptor = getPropertyDescriptor(bean,propertyName);
    	  if(propertyDescriptor == null)
    	  {
    		  throw new IllegalArgumentException("propertyName:"+propertyName+" not found for bean:"+bean);
    	  }
    	  Method writeMethod = propertyDescriptor.getWriteMethod();
    	  
    	  if(writeMethod == null)
    	  {
    		  if(throwExceptionForMissingProperty)
    			  throw new IllegalArgumentException("Write method not found for propertyName:"+propertyName+" for bean:"+bean);
    		  else
    			  return; //ignore missing set method for property
    	  }
    	  writeMethod.invoke(bean, value);
    	  
      }
      catch(IllegalArgumentException e)
      {
    	  if(!(value instanceof String))
    		  throw e;
    		  
    	try
  		{
    	  //convert value
    	  PropertyDescriptor desc = getPropertyDescriptor(bean, propertyName);
    	  
    	  String text = (String)value;
    	  
    
			value = Text.toObject(text, desc.getPropertyType().getName());
			  
			  //try again
			  PropertyDescriptor propertyDescriptor = getPropertyDescriptor(bean,propertyName);
	    	  propertyDescriptor.getWriteMethod().invoke(bean, value);
		}
		catch(Exception innerError)
		{
			//failed conversion
			//throw original exception
			throw e;
		}
    	  
      }
      catch(NoSuchMethodException e)
      {
         try
         {
            //find key ignores         
            Object key = Organizer.findByTextIgnoreCase(keySet(bean),propertyName );
           
            PropertyDescriptor propertyDescriptor = getPropertyDescriptor(bean,String.valueOf(key));
      	  propertyDescriptor.getWriteMethod().invoke(bean, value);
         }
         catch (Exception e1)
         {
            String typeName = "null";
            
            if(value != null)
               typeName = value.getClass().getName();
            
            throw new SystemException("type="+typeName+" "+Debugger.toString(e));
         }
      }
      catch(Exception e)
      {
         String typeName = "null";
         
         if(value != null)
            typeName = value.getClass().getName();
         
         throw new SystemException("type="+typeName+" propery:"+propertyName+" ERROR:"+e.getMessage(),e);
      }
   }
265104
void addBean(Bean bean) {
		if (bean == null) return;
		this.beans.add(new BeanDefinition(bean.name(), bean.clazz()));
	}
236603
@Override
  public final IConverterToFromString<?> lazyGet(
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    // There is no way to get from Map partially initialized bean
    // in this double-checked locking implementation
    // cause putting to the Map fully initialized bean
    IConverterToFromString<?> convrt = this.convertersMap.get(pBeanName);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanName);
        if (convrt == null) {
          if (pBeanName.equals(CnvTfsLong.class.getSimpleName())) {
            convrt = lazyGetCnvTfsLong();
          } else if (pBeanName.equals(CnvTfsDate.class.getSimpleName())) {
            convrt = createPutCnvTfsDate();
          } else if (pBeanName.equals(CnvTfsDateTime.class
            .getSimpleName())) {
            convrt = createPutCnvTfsDateTime();
          } else if (pBeanName.equals(CnvTfsDateTimeSec.class
            .getSimpleName())) {
            convrt = createPutCnvTfsDateTimeSec();
          } else if (pBeanName.equals(CnvTfsDateTimeSecMs.class
            .getSimpleName())) {
            convrt = createPutCnvTfsDateTimeSecMs();
          } else if (pBeanName.equals(CnvTfsBigDecimal.class
            .getSimpleName())) {
            convrt = createPutCnvTfsBigDecimal();
          } else if (pBeanName.equals(CnvTfsFloat.class.getSimpleName())) {
            convrt = createPutCnvTfsFloat();
          } else if (pBeanName.equals(CnvTfsDouble.class.getSimpleName())) {
            convrt = createPutCnvTfsDouble();
          } else if (pBeanName.equals(CnvTfsBoolean.class.getSimpleName())) {
            convrt = createPutCnvTfsBoolean();
          } else if (pBeanName.equals(CnvTfsInteger.class.getSimpleName())) {
            convrt = lazyGetCnvTfsInteger();
          } else if (pBeanName.equals(CnvTfsString.class.getSimpleName())) {
            convrt = lazyGetCnvTfsString();
          } else {
            for (Map.Entry<Class<? extends IHasId<Long>>, String> entry
              : this.hasLongIdMap.entrySet()) {
              if (pBeanName.equals(CnvTfsHasId.class.getSimpleName()
                + "Long" + entry.getKey().getSimpleName())) {
                convrt = createHasLongIdConverter(pBeanName,
                  entry.getKey(), entry.getValue());
                break;
              }
            }
            for (Map.Entry<Class<? extends IHasId<Integer>>, String> entry
              : this.hasIntegerIdMap.entrySet()) {
              if (pBeanName.equals(CnvTfsHasId.class.getSimpleName()
                + "Integer" + entry.getKey().getSimpleName())) {
                convrt = createHasIntegerIdConverter(pBeanName,
                  entry.getKey(), entry.getValue());
                break;
              }
            }
            for (Map.Entry<Class<? extends IHasId<String>>, String> entry
              : this.hasStringIdMap.entrySet()) {
              if (pBeanName.equals(CnvTfsHasId.class.getSimpleName()
                + "String" + entry.getKey().getSimpleName())) {
                convrt = createHasStringIdConverter(pBeanName,
                  entry.getKey(), entry.getValue());
                break;
              }
            }
            for (Map.Entry<Class<? extends IHasId<?>>, String> entry
              : this.hasCompositeIdMap.entrySet()) {
              if (pBeanName.equals(CnvTfsHasId.class.getSimpleName()
                + "Composite" + entry.getKey().getSimpleName())) {
                convrt = createHasCompositeIdConverter(pBeanName,
                  entry.getKey(), entry.getValue());
                break;
              }
            }
            for (Class<?> cmpsClass : this.compositeClasses) {
              if (pBeanName.equals(getCnvTfsObjectName(cmpsClass))) {
                convrt = lazyGetCnvTfsObject(cmpsClass);
                break;
              }
            }
            for (Class<? extends Enum<?>> enumClass : this.enumsClasses) {
              if (pBeanName.equals(CnvTfsEnum
                .class.getSimpleName() + enumClass.getSimpleName())) {
                convrt = createCnvTfsEnum(pBeanName, enumClass);
                break;
              }
            }
          }
        }
      }
    }
    if (convrt == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no converter with name " + pBeanName);
    }
    return convrt;
  }
659906
protected void doUpdateBeanValue(final Object value) {
		String beanProperty = getBeanProperty();
		if (beanProperty != null && beanProperty.length() > 0 && !".".equals(beanProperty)) {
			Object bean = getBean();
			if (bean != null) {
				try {
					Object beanValue = getBeanValue();
					if (!Util.equals(beanValue, value)) {
						PropertyUtils.setProperty(bean, beanProperty, value);
					}
				} catch (Exception e) {
					LOG.error("Failed to set bean property " + beanProperty + " on " + bean);
				}
			}
		}
	}
141922
public void setAttributes(ObjectName name, List<Attribute> attributes) throws Exception {
		checkClientConnected();
		mbeanConn.setAttributes(name, new AttributeList(attributes));
	}
920738
private Object parseBean(Map<String, Object> input, Class<?> beanType) throws Exception {
        String propName = "";
        try {
            SerDeserializer deser = settings.getDeserializers().findDeserializer(beanType);
            MetaBean metaBean = deser.findMetaBean(beanType);
            BeanBuilder<?> builder = deser.createBuilder(beanType, metaBean);
            for (Entry<String, Object> entry : input.entrySet()) {
                // property name
                propName = entry.getKey();
                MetaProperty<?> metaProp = deser.findMetaProperty(beanType, metaBean, propName);
                // ignore unknown properties
                if (metaProp != null && !metaProp.style().isDerived()) {
                    Object value = parseObject(
                            entry.getValue(), SerOptional.extractType(metaProp, beanType), metaProp, beanType, null);
                    deser.setValue(builder, metaProp, SerOptional.wrapValue(metaProp, beanType, value));
                }
                propName = "";
            }
            return deser.build(beanType, builder);
        } catch (Exception ex) {
            throw new IllegalArgumentException(
                    "Error parsing bean: " + beanType.getName() + "::" + propName + ", " + ex.getMessage(), ex);
        }
    }
605366
public void setAttribute(ObjectName name, String attrName, String value) throws Exception {
		MBeanAttributeInfo info = getAttrInfo(name, attrName);
		if (info == null) {
			throw new IllegalArgumentException("Cannot find attribute named '" + attrName + "'");
		} else {
			setAttribute(name, attrName, ClientUtils.stringToParam(value, info.getType()));
		}
	}
9908
protected static void setField(String fieldName, Object mojo, Object value) throws Exception {
        Field field = null;
        try {
            field = mojo.getClass().getDeclaredField(fieldName);
        } catch (NoSuchFieldException ex) {
            // Ignore exception and try superclass.
            field = mojo.getClass().getSuperclass().getDeclaredField(fieldName);
        }
        field.setAccessible(true);
        field.set(mojo, value);
    }
529250
public static void setBeanProperty(Object beanObj, String fieldName,
			Object value) throws Exception {
		Class cls = beanObj.getClass();
		Field field = cls.getDeclaredField(fieldName);
		Class fieldCls = field.getType();
		field.setAccessible(true);
		Object fieldObj = str2Obj(fieldCls, value);
		field.set(beanObj, fieldObj);
	}