当前位置: 首页>>代码示例>>Java>>正文


Java Property类代码示例

本文整理汇总了Java中org.ofbiz.base.container.ContainerConfig.Container.Property的典型用法代码示例。如果您正苦于以下问题:Java Property类的具体用法?Java Property怎么用?Java Property使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Property类属于org.ofbiz.base.container.ContainerConfig.Container包,在下文中一共展示了Property类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConnector

import org.ofbiz.base.container.ContainerConfig.Container.Property; //导入依赖的package包/类
protected Connector createConnector(ContainerConfig.Container.Property connectorProp) throws ContainerException {
    if (tomcat == null) {
        throw new ContainerException("Cannot create Connector without Tomcat instance!");
    }
    Connector connector = null;
    if (UtilValidate.isNotEmpty(connectorProp.properties)) {
        String protocol = ContainerConfig.getPropertyValue(connectorProp, "protocol", "HTTP/1.1");
        int port = ContainerConfig.getPropertyValue(connectorProp, "port", 0) + Start.getInstance().getConfig().portOffset;

        // set the protocol and the port first
        connector = new Connector(protocol);
        connector.setPort(port);
        // then set all the other parameters
        for (ContainerConfig.Container.Property prop: connectorProp.properties.values()) {
            if ("protocol".equals(prop.name) || "port".equals(prop.name)) {
                // protocol and port are already set
                continue;
            }
            if (IntrospectionUtils.setProperty(connector, prop.name, prop.value)) {
                if (prop.name.indexOf("Pass") != -1) {
                    // this property may be a password, do not include its value in the logs
                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name, module);
                } else {
                    Debug.logInfo("Tomcat " + connector + ": set " + prop.name + "=" + prop.value, module);
                }
            } else {
                Debug.logWarning("Tomcat " + connector + ": ignored parameter " + prop.name, module);
            }
        }

        tomcat.getService().addConnector(connector);
    }
    return connector;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:35,代码来源:CatalinaContainer.java

示例2: init

import org.ofbiz.base.container.ContainerConfig.Container.Property; //导入依赖的package包/类
@Override
public void init(String[] args, String name, String configFile) throws ContainerException {
    this.name = name;
    // get the container config
    ContainerConfig.Container cc = ContainerConfig.getContainer(name, configFile);
    if (cc == null) {
        throw new ContainerException("No catalina-container configuration found in container config!");
    }

    // embedded properties
    boolean useNaming = ContainerConfig.getPropertyValue(cc, "use-naming", false);
    //int debug = ContainerConfig.getPropertyValue(cc, "debug", 0);

    // grab some global context settings
    this.contextReloadable = ContainerConfig.getPropertyValue(cc, "apps-context-reloadable", false);
    this.crossContext = ContainerConfig.getPropertyValue(cc, "apps-cross-context", true);
    this.distribute = ContainerConfig.getPropertyValue(cc, "apps-distributable", true);

    this.catalinaRuntimeHome = ContainerConfig.getPropertyValue(cc, "catalina-runtime-home", "runtime/catalina");

    // set catalina_home
    System.setProperty(Globals.CATALINA_HOME_PROP, System.getProperty("ofbiz.home") + "/" + this.catalinaRuntimeHome);
    System.setProperty(Globals.CATALINA_BASE_PROP, System.getProperty(Globals.CATALINA_HOME_PROP));

    // create the instance of embedded Tomcat
    System.setProperty("catalina.useNaming", String.valueOf(useNaming));
    tomcat = new Tomcat();
    tomcat.setBaseDir(System.getProperty("ofbiz.home"));

    // configure JNDI in the StandardServer
    StandardServer server = (StandardServer) tomcat.getServer();
    if (useNaming) {
        tomcat.enableNaming();
    }
    try {
        server.setGlobalNamingContext(new InitialContext());
    } catch (NamingException e) {
        throw new ContainerException(e);
    }

    // create the engine
    List<ContainerConfig.Container.Property> engineProps = cc.getPropertiesWithValue("engine");
    if (UtilValidate.isEmpty(engineProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no engines defined.");
    }
    if (engineProps.size() > 1) {
        throw new ContainerException("Cannot load CatalinaContainer; more than one engine configuration found; only one is supported.");
    }
    createEngine(engineProps.get(0));

    // create the connectors
    List<ContainerConfig.Container.Property> connectorProps = cc.getPropertiesWithValue("connector");
    if (UtilValidate.isEmpty(connectorProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no connectors defined!");
    }
    for (ContainerConfig.Container.Property connectorProp: connectorProps) {
        createConnector(connectorProp);
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:60,代码来源:CatalinaContainer.java

示例3: init

import org.ofbiz.base.container.ContainerConfig.Container.Property; //导入依赖的package包/类
@Override
public void init(String[] args, String name, String configFile) throws ContainerException {
    this.name = name;
    // get the container config
    ContainerConfig.Container cc = ContainerConfig.getContainer(name, configFile);
    if (cc == null) {
        throw new ContainerException("No catalina-container configuration found in container config!");
    }

    // embedded properties
    boolean useNaming = ContainerConfig.getPropertyValue(cc, "use-naming", false);
    //int debug = ContainerConfig.getPropertyValue(cc, "debug", 0);

    // grab some global context settings
    this.delegator = DelegatorFactory.getDelegator(ContainerConfig.getPropertyValue(cc, "delegator-name", "default"));
    this.contextReloadable = ContainerConfig.getPropertyValue(cc, "apps-context-reloadable", false);
    this.crossContext = ContainerConfig.getPropertyValue(cc, "apps-cross-context", true);
    this.distribute = ContainerConfig.getPropertyValue(cc, "apps-distributable", true);

    this.catalinaRuntimeHome = ContainerConfig.getPropertyValue(cc, "catalina-runtime-home", "runtime/catalina");

    // set catalina_home
    System.setProperty(Globals.CATALINA_HOME_PROP, System.getProperty("ofbiz.home") + "/" + this.catalinaRuntimeHome);
    System.setProperty(Globals.CATALINA_BASE_PROP, System.getProperty(Globals.CATALINA_HOME_PROP));

    // create the instance of embedded Tomcat
    System.setProperty("catalina.useNaming", String.valueOf(useNaming));
    tomcat = new Tomcat();
    tomcat.setBaseDir(System.getProperty("ofbiz.home"));
    if (useNaming) {
        tomcat.enableNaming();
    }

    // configure JNDI in the StandardServer
    StandardServer server = (StandardServer) tomcat.getServer();
    try {
        server.setGlobalNamingContext(new InitialContext());
    } catch (NamingException e) {
        throw new ContainerException(e);
    }

    // create the engines
    List<ContainerConfig.Container.Property> engineProps = cc.getPropertiesWithValue("engine");
    if (UtilValidate.isEmpty(engineProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no engines defined!");
    }
    for (ContainerConfig.Container.Property engineProp: engineProps) {
        createEngine(engineProp);
    }

    // create the connectors
    List<ContainerConfig.Container.Property> connectorProps = cc.getPropertiesWithValue("connector");
    if (UtilValidate.isEmpty(connectorProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no connectors defined!");
    }
    for (ContainerConfig.Container.Property connectorProp: connectorProps) {
        createConnector(connectorProp);
    }
}
 
开发者ID:gildaslemoal,项目名称:elpi,代码行数:60,代码来源:CatalinaContainer.java

示例4: init

import org.ofbiz.base.container.ContainerConfig.Container.Property; //导入依赖的package包/类
@Override
public void init(String[] args, String name, String configFile) throws ContainerException {
    this.name = name;
    // get the container config
    ContainerConfig.Container cc = ContainerConfig.getContainer(name, configFile);
    if (cc == null) {
        throw new ContainerException("No catalina-container configuration found in container config!");
    }

    // embedded properties
    boolean useNaming = ContainerConfig.getPropertyValue(cc, "use-naming", false);
    //int debug = ContainerConfig.getPropertyValue(cc, "debug", 0);

    // grab some global context settings
    this.delegator = DelegatorFactory.getDelegator(ContainerConfig.getPropertyValue(cc, "delegator-name", "default"));
    this.contextReloadable = ContainerConfig.getPropertyValue(cc, "apps-context-reloadable", false);
    this.crossContext = ContainerConfig.getPropertyValue(cc, "apps-cross-context", true);
    this.distribute = ContainerConfig.getPropertyValue(cc, "apps-distributable", true);

    this.catalinaRuntimeHome = ContainerConfig.getPropertyValue(cc, "catalina-runtime-home", System.getProperty("runtime.home")+"/catalina");

    // set catalina_home
    System.setProperty(Globals.CATALINA_HOME_PROP, this.catalinaRuntimeHome );
    System.setProperty(Globals.CATALINA_BASE_PROP, System.getProperty(Globals.CATALINA_HOME_PROP));

    // create the instance of embedded Tomcat
    System.setProperty("catalina.useNaming", String.valueOf(useNaming));
    tomcat = new Tomcat();
    tomcat.setBaseDir(System.getProperty("ofbiz.home"));
    if (useNaming) {
        tomcat.enableNaming();
    }

    // configure JNDI in the StandardServer
    StandardServer server = (StandardServer) tomcat.getServer();
    try {
        server.setGlobalNamingContext(new InitialContext());
    } catch (NamingException e) {
        throw new ContainerException(e);
    }

    // create the engines
    List<ContainerConfig.Container.Property> engineProps = cc.getPropertiesWithValue("engine");
    if (UtilValidate.isEmpty(engineProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no engines defined!");
    }
    for (ContainerConfig.Container.Property engineProp: engineProps) {
        createEngine(engineProp);
    }

    // create the connectors
    List<ContainerConfig.Container.Property> connectorProps = cc.getPropertiesWithValue("connector");
    if (UtilValidate.isEmpty(connectorProps)) {
        throw new ContainerException("Cannot load CatalinaContainer; no connectors defined!");
    }
    for (ContainerConfig.Container.Property connectorProp: connectorProps) {
        createConnector(connectorProp);
    }
}
 
开发者ID:jamesyong,项目名称:o3erp,代码行数:60,代码来源:CatalinaContainer.java


注:本文中的org.ofbiz.base.container.ContainerConfig.Container.Property类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。