spring

资源文件加载:

 

<bean id="propertyConfigurer"
  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations">
   <list>
    <value>classpath:config/ms/jdbc.properties</value>
    <value>classpath:config/ms/ms.properties</value>
    <value>classpath:config/ms/warn.properties</value>
    <value>classpath:config/ms/status.properties</value>
   </list>
  </property>
 </bean>
 
 <bean id="reloadableResource"
  class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  <property name="basenames">
   <set>
    <value>/WEB-INF/classes/config/ms/ms</value>
   </set>
  </property>
  <property name="cacheSeconds" value="50" />
 </bean>

 

 

dbcp连接池:

 

        BasicDataSource bds = new BasicDataSource();
        bds.setDriverClassName(this.getDriverClass());
        bds.setUrl(this.getUrl());
        bds.setUsername(this.getUsername());
        bds.setPassword(this.password);
        bds.setMaxWait(Integer.valueOf(maxWait).intValue());
        bds.setMaxActive(Integer.valueOf(maxActive).intValue());
        bds.setMaxIdle(Integer.valueOf(maxIdle).intValue());
        bds.setMinIdle(Integer.valueOf(minIdle).intValue());
        bds.setInitialSize(Integer.valueOf(initialSize).intValue());
        bds.setRemoveAbandoned(true);
        bds.setRemoveAbandonedTimeout(30);
        bds.setLogAbandoned(false);
        return bds;

 

 

连接池:

 

 

//创建一个固定大小的线程,使用优先级队列
        //        pool = new ThreadPoolExecutor(10, 10, 0, TimeUnit.SECONDS, new PriorityBlockingQueue(30),
        //            new ThreadPoolExecutor.CallerRunsPolicy());
        //采用无堵塞先进先出队列
        pool = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, 0, TimeUnit.SECONDS,
            new ArrayBlockingQueue(workQueue, true), new ThreadPoolExecutor.CallerRunsPolicy());

 

 

 

 public int process(List moConmmandList)
    {
        while (pool.getQueue().size() > maxQueueSize - 1)
        {
            try
            {
                Thread.currentThread().sleep(50);
            }
            catch (InterruptedException e)
            {
                logger.error("循环等待上行处理线程池任务队列失败", e);
                return -1;
            }
        }
        for (int i = 0; i < moConmmandList.size(); i++ )
        {
            //组装成任务
            Runnable inierUpSMS = transformToPoolTask((MoItem)moConmmandList.get(i));
            if (inierUpSMS != null)
            {
                pool.execute(inierUpSMS);
            }
            else
            {
                logger.debug( ((MoItem)moConmmandList.get(i - 1)).toString());
                continue;
            }
        }
        return 0;
    }

 

 

 

 

private Runnable transformToPoolTask(MoItem moItem)
    {
        UpSMS inierUpSMS = (UpSMS)upSMS.clone();
        inierUpSMS.setMoItem(moItem);
        return inierUpSMS;
    }

 

 

 

public class UpSMS implements Cloneable, Runnable

 

 

/**
     * Description: 重写克隆方法<br>
     */
    public Object clone()
    {
        try
        {
            ParseXMLV3 parseXML_clone = (ParseXMLV3) parseXML.clone();
            UpSMS upsms = (UpSMS) super.clone();
            upsms.setParseXML(parseXML_clone);
            return upsms;
        }
        catch (CloneNotSupportedException e)
        {
            logger.error("克隆点播指令解析类异常。", e);
            return null;
        }
    } 

 

 

 

 资源文件重加载:

 <bean id="resourceUtil" class="com.huawei.taskengine.comm.util.ResourceUtil">
  <property name="reloadableResource">
   <ref bean="reloadableResource"/>
  </property>
  <property name="mspUpGather_Fast">
   <ref bean="mspUpGather_Fast"/>
  </property>
  <property name="siDataTools">
   <ref bean="siDataTools"/>
  </property>
 </bean>

【3D应力敏感度分析拓扑优化】【基于p-范数全局应力衡量的3D敏感度分析】基于伴随方法的有限元分析和p-范数应力敏感度分析(Matlab代码实现)内容概要:本文档介绍了基于伴随方法的有限元分析与p-范数全局应力衡量的3D应力敏感度分析,并结合拓扑优化技术,提供了完整的Matlab代码实现方案。该方法通过有限元建模计算结构在载荷作用下的应力分布,采用p-范数对全局应力进行有效聚合,避免传统方法中应力约束过多的问题,进而利用伴随法高效求解设计变量对应力的敏感度,为结构优化提供关键梯度信息。整个流程涵盖了从有限元分析、应力评估到敏感度计算的核心环节,适用于复杂三维结构的轻量化与高强度设计。; 适合人群:具备有限元分析基础、拓扑优化背景及Matlab编程能力的研究生、科研人员与工程技术人员,尤其适合从事结构设计、力学仿真与多学科优化的相关从业者; 使用场景及目标:①用于实现高精度三维结构的应力约束拓扑优化;②帮助理解伴随法在敏感度分析中的应用原理与编程实现;③服务于科研复现、论文写作与工程项目中的结构性能提升需求; 阅读建议:建议读者结合有限元理论与优化算法知识,逐步调试Matlab代码,重点关注伴随方程的构建与p-范数的数值处理技巧,以深入掌握方法本质并实现个性化拓展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值