All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.RuntimeDefaults Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

/*
 * @(#) $Id: RuntimeDefaults.java 2089 2007-11-28 13:56:13Z s3460 $
 *
 * 
 * 
 * 
 *
 */
package at.spardat.xma;

import java.util.HashSet;
import java.util.Set;

/**
 * default properties for the runtime
 * @author s2877  
 */
public class RuntimeDefaults {
    /** 
     * the properties with praefix (i.e., in the node) xma.runtime 
     * are also available at the xma-client and accessible via the
     * session class
     */
    static final public String clientPraefix ="xma.runtime";
    
    
    /** 
     * This parameter applies to RPCs and determines the minimum size of
     * data to trigger gzip-compression. This works in both directions, 
     * i.e., applies to data sent from the XMA-client to the server
     * and vice versa. A value of -1 disables compression for all 
     * RPCs in the application.
     */
    static final public int RpcCompressionThreshold=1024;

    /**
     * Determines the serializer used in RPCs:
     * binary:      Most efficient and must be set in production environment; the default;
     * ascii:       Data sent in RPCs is coded US-ASCII, without metainformation
     * tascii:      Data sent is US-ASCII, every value is preceded a descriptive tag 
     *              (tagged ascii).
     * The ascii settings may be used for loadtests to force a readable HTTP-stream.
     * This property must not be changed in a running server. 
     */
    static final public String Serializer="binary";

    /**
     * Determines if the session should be kept alive as long as the client is open.
     * Default is true.
     */
    static final public boolean doKeepAlive=true;
    
    /**
     * To activate the GlobalEvent mechanism this property has be set to a value != "false".
     * GlobalEvents enable the server to send events within a RPC to the client, which has to register a GlobalEventListener.
     * As this means a slight overhead for every RPC this feature has to be turned on explicitly.
* The name given for this property (e.g. activateGlobalEvents="samplespar") serves as a scope for GlobalEvents. * GlobalEvents are only written and read in the scope set by xma.runtime.activateGlobalEvents. * This mechanism prevents that GlobalEvents of different applications are mixed. * Usually each application will define its own scope and is therfore only able to read its own GlobalEvents. * It is suggested to use the application's name in small letters (to avoid Windows/Unix issues): * e.g. xma.runtime.activateGlobalEvents=samplespar * * Do not use a package like name as "at.spardat.samplespar" as dots are interpreted as jndi nodes! * xma.runtime.activateGlobalEvents=true is now a scope name as any other name (Of course this name is recommended). * In some cases the GlobalEvent scope might be shared between different applications. For example one application maintains * domains and sends a GlobalEvent that a certain domain was changed. Another application will receive this * GlobalEvent and refresh the domain at its clients. */ static final public String activateGlobalEvents="false"; /** * With the XMA Runtime Version 1.7.0 the ISimpleWM.set(xxxx) method changed the implementation of behaviour on type conflicts.
The old behaviour was to do nothing on type conflicts, for example if you set a String and the model is a numeric one. The new implementation is to throw an IllegalStateException.
If you do not want to switch to the new implementation, you can set this property to 'true'.
It is recommended that you do not set this property and instead use the new behaviour. */ static final public boolean sloppyModelSetters=false; /** * Per default, message boxes at the XMA client include the stacktrace if environment is local or development.
Now, this property may be set to 'false' to suppress display of the stack trace even in development environments. */ static final public boolean verboseNotificationBox=false; /** * Should the client side application automatically be terminated by the runtime if * the server side session is no longer valid or the server is unreachable? * If true and the server is unreachable, the user is asked if he wants to exit, * if true and the session is invalid, he is only notified.
* Default is false. */ static final public boolean autoExit=false; /** * To customize the handling of outdated and invalid domain keys. * If xma.runtime.useOutOfDomainKey=true, which is the default, the behaviour is unchanged: * The drop down box of domaincombos normaly contains only valid domain values. * If an invalid key is selected programatically (e.g. read from the database) it is added to this list. * So it is possible for the user to reselect this key if he started changing the selection of the combo. * It is showed as its shortvalue followed by (unknown). * If xma.runtime.useOutOfDomainKey=false, a new behaviour applies: * The drop down box of domaincombos allways contains only valid domain values. * If an invalid key is selected programatically (e.g. read from the database) it is only showed in the text * field of the combo box. It is showed in the same style as the valid values. * It is not possible for the user to reselect this key, once he started changing the selection of the combo. */ static final public boolean useOutOfDomainKey=true; /** * xma.runtime.SSLPort defines the TCP port used for login and logout * requests protected by HTTPS.
* An XMA application requested via an HTTP URL always protects its login * and logout requests by HTTPS. This property defines the HTTPS port to * use. Make sure the the application server is similary configured.
* For XMA applications which are loaded by an HTTPS URL this property is * ignored, as the whole application is already protected by HTTPS anyway. *
*
* Since Version 1.7.8
* The property xma.runtime.SSLPort may contain a list of ports seperated by * ',' (';' and '|' are possible, too). If this property contains more than * one port number, these ports are tried in sequence whenever an encryted * connection is needed during the login process. Make sure, the normaly * used port is the first in the list, because it is allways tried first! */ static final public String SSLPort="443"; /** XMA's datasource plugin */ static final public String datasourcePraefix="at.spardat.xma.datasource"; /** * Messages shown by NotificationBox.show() (used by PageClient.showException()) * show first the class name of the Exception or of the nested Exception and then the Exception text * if the argument is a SysException (like "SysException: internal Error...[100001]"). * If this property is set to 'false' then the Exception class name is suppressed. * Defaults to 'true'. */ static final public boolean showExceptionClassName=true; /** * defines if tabular tables downloaded to the xma client should be * integrity-protected by hash-values. This enables that corrupted * files at the client may be cleaned up after detection. * This property is set to false per default. It may be set to * true if the boot-runtime version is greater than or equal to 1.3.0!!! */ static final public boolean hashIntegrityProtection=false; /** * defines that tables to be downloaded should be gzip compressed * if their byte stream exceeds compressionThreshold bytes. If * set to -1, compression is disabled. * May only be set to values not equal to -1 with bootruntime versions * greater than or equal to 1.3.0!!!! */ static final public int compressionThreshold=-1; /** * Get the default value for the named property. * @param name one of the field names of this class. * @return the value of the field with the given name. */ static final public String getProperty(String name) { // sort alphabethically if("activateGlobalEvents".equals(name)||"xma.runtime.activateGlobalEvents".equals(name)) { return activateGlobalEvents; } else if("autoExit".equals(name)||"xma.runtime.autoExit".equals(name)) { return autoExit?"true":"false"; } else if("doKeepAlive".equals(name)||"xma.runtime.doKeepAlive".equals(name)) { return doKeepAlive?"true":"false"; }else if("RpcCompressionThreshold".equals(name)||"xma.runtime.RpcCompressionThreshold".equals(name)) { return Integer.toString(RpcCompressionThreshold); }else if("Serializer".equals(name)||"xma.runtime.Serializer".equals(name)) { return Serializer; } else if("showExceptionClassName".equals(name)||"xma.runtime.showExceptionClassName".equals(name)) { return showExceptionClassName?"true":"false"; } else if("sloppyModelSetters".equals(name)||"xma.runtime.sloppyModelSetters".equals(name)) { return sloppyModelSetters?"true":"false"; }else if("SSLPort".equals(name)||"xma.runtime.SSLPort".equals(name)) { return SSLPort; }else if("useOutOfDomainKey".equals(name)||"xma.runtime.useOutOfDomainKey".equals(name)) { return useOutOfDomainKey?"true":"false"; }else if("verboseNotificationBox".equals(name)||"xma.runtime.verboseNotificationBox".equals(name)) { return verboseNotificationBox?"true":"false"; } //at.spardat.xma.datasource else if("compressionThreshold".equals(name)||"at.spardat.xma.datasource.compressionThreshold".equals(name)) { return Integer.toString(compressionThreshold); } else if("hashIntegrityProtection".equals(name)||"at.spardat.xma.datasource.hashIntegrityProtection".equals(name)) { return hashIntegrityProtection?"true":"false"; } else { return null; } } /** * Get the default value for the named property. * @param name one of the field names of this class. * @param defaultValue to return if this class has no such field. * @return the value of the field with the given name. */ static final public String getProperty(String name, String defaultValue) { String value = getProperty(name); return value!=null?value:defaultValue; } /** * Get a set of the property names known to this class. * @return the field names of this class. */ static final public Set keySet() { Set keys = new HashSet(); //sort alphabethically keys.add("xma.runtime.activateGlobalEvents"); keys.add("xma.runtime.autoExit"); keys.add("xma.runtime.doKeepAlive"); keys.add("xma.runtime.RpcCompressionThreshold"); keys.add("xma.runtime.Serializer"); keys.add("xma.runtime.showExceptionClassName"); keys.add("xma.runtime.sloppyModelSetters"); keys.add("xma.runtime.SSLPort"); keys.add("xma.runtime.useOutOfDomainKey"); keys.add("xma.runtime.verboseNotificationBox"); //at.spardat.xma.datasource keys.add("at.spardat.xma.datasource.compressionThreshold"); keys.add("at.spardat.xma.datasource.hashIntegrityProtection"); return keys; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy