⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spring.java

📁 java pos,你可以直接编译运行,
💻 JAVA
字号:
/* * Copyright (c) 2004 jPOS.org * * See terms of license at http://jpos.org/license.html * */package org.jpos.q2.spring;import org.jpos.q2.QBeanSupport;import org.jpos.core.ConfigurationException;import org.springframework.context.support.FileSystemXmlApplicationContext;import org.springframework.context.ApplicationContext;import org.jpos.util.NameRegistrar;/** * @author Anthony Schexnaildre * @version $Revision: 1.2 $ $Date: 2004/11/23 18:21:01 $ * @jmx:mbean description="Spring QBean" extends="org.jpos.q2.QBeanSupportMBean" */public class Spring extends QBeanSupport implements SpringMBean {    ApplicationContext context;    String[] configFiles;    public void initService () throws ConfigurationException {        configFiles = cfg.getAll( "config" );         if ( configFiles.length < 1 )            throw new ConfigurationException ("config property not specified");        context = new FileSystemXmlApplicationContext( configFiles );    }    public void startService () {        NameRegistrar.register( getName(), this );    }    public void stopService () {        NameRegistrar.unregister( getName() );    }    /**     * Returns the Spring ApplicationContext     */    public ApplicationContext getContext () {	    return context;    }    /**     * @jmx:managed-attribute description="Configuration Files"     */    public String[] getConfig () {        return configFiles;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -