Wrapper java main class

wrapper.java.mainclass

Class to execute when the Wrapper starts the application. The value of this property depends on which of the Integration Methods that were selected. In most cases, this is NOT the main class of your application.

wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp 
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperStartStopApp 
wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperJarApp 

If you specify a main class which does NOT correctly initialize the WrapperManager class, then the Wrapper will timeout and terminate the JVM after the startup timeout has expired. Please see the wrapper. startup. timeout property for more details. When this happens, you will see a message like the following:

------------------------------------------------------------------------ Advice: The Wrapper consists of a native component as well as a set of classes which run within the JVM that it launches. The Java component of the Wrapper must be initialized promptly after the JVM is launched or the Wrapper will timeout, as just happened. Most likely the main class specified in the Wrapper configuration file is not correctly initializing the Wrapper classes: com.myapp.Main While it is possible to do so manually, the Wrapper ships with helper classes to make this initialization processes automatic. Please review the integration section of the Wrapper's documentation for the various methods which can be employed to launch an application within the Wrapper: http://wrapper.tanukisoftware.org/doc/english/integrate.html ------------------------------------------------------------------------ 

Reference: Parameters

  • wrapper.app.parameter. (1.0.0)Set the parameters of your Java application.
    • wrapper.app.parameter..stripquotes(3.5.17)Strip the quotes in the application parameters (Unix only).
    • wrapper.app.parameter.default.stripquotes(3.5.17)Strips the quotes for all «app.parameter» properties (Unix only).
    • wrapper.app.parameter_file.required(3.5.17)Specifies if the parameter file is required or not.
    • wrapper.app.parameter_file.stripquotes(3.5.17)Strips the quotes in the application parameters listed in the parameter file.
    • (3.5.36)( Std/Pro) Append option with index ‘n’ only if the Java version is lower than or equal to the specified value.
    • (3.5.36)( Std/Pro) Append option with index ‘n’ only if the Java version is greater than or equal to the specified value.
    • wrapper.java.additional..stripquotes(1.0.0)Strip the quotes in the JVM parameters (Unix only).
    • wrapper.java.additional.default.stripquotes(3.5.17)Strips the quotes for all «java.additional» properties (Unix only).
    • wrapper.java.additional_file.required(3.5.36)Specifies if the Java additional file is required or not.
    • wrapper.java.additional_file.stripquotes(3.5.16)Strips the quotes in the JVM parameters listed in the «additional file» (Unix only).
    • wrapper.java.tmpdir.required(3.5.0)Specifies if the Wrapper should exit when the Java temporary directory cannot be written to.
    • wrapper.java.tmpdir.warn_silently(3.5.0)Specifies whether a message should be logged at the DEBUG or WARN log level when the Java temporary directory could not be written to.

    Configuration Properties:

    Источник

    Класс Wrapper в Java

    Язык программирования Java является одним из самых популярных в настоящее время. С такими понятиями, как переменные, типы данных, классы и объекты, приходит еще одна важная концепция класса-оболочки в Java, которая необходима для синхронизации в многопоточности, сборочной среде и т.д.

    Класс Wrapper предоставляет механизм для преобразования примитивных типов данных в объекты класса-оболочки. Ниже приведены эквивалентные объекты классов-оболочек примитивных типов данных.

    Примитивный тип данных Класс Wrapper
    int Integer
    char Character
    float Float
    boolean Boolean
    double Double
    short Short
    long Long
    byte Byte

    Ниже приведен пример, демонстрирующий, как вы можете создать объект класса.

    В приведенной выше программе мы использовали класс-оболочку вместо примитивных типов данных.

    Ниже приведены методы для получения связанного значения из объектов-оболочек.

    1. intValue();
    2. byteValue();
    3. shortValue();
    4. longValue();
    5. doubleValue();
    6. charValue();
    7. floatValue();
    8. booleanValue().

    Ниже приведен пример использования этих методов в программе:

    Точно так же вы можете использовать другие методы, такие как doubleValue(), shortValue(), longValue(), byteValue(), чтобы получить соответствующие значения объектов класса-оболочки.

    Информация

    • Преобразует примитивные типы данных в объекты.
    • Объекты необходимы для изменения аргументов в методе.
    • Классы в пакете java.util работают только с объектами.
    • Структуры данных в структуре коллекции хранят только объекты.
    • Объекты помогают в синхронизации в многопоточности.

    Autoboxing

    Автобокс – это автоматическое преобразование примитивных типов данных в объекты их соответствующего класса-оболочки.

    import java.util.ArrayList; class Autoboxing < public static void main(String args[])< char ch = 'e'; Character e = ch; ArrayListarraylist = new ArrayList(); arraylist.add(10); System.out.println(arraylist.get(0)); > >

    Распаковка

    Это обратная сторона автобокса, когда объект класса-оболочки конвертируется в соответствующий им примитивный тип данных.

    import java.util.ArrayList; class Unboxing < public static void main(String args[]) < Character ch = 'e'; char 'e' = ch; ArrayListarraylist = new ArrayList(); arraylist.add(10); int number = arraylist.get(0); System.out.println(number); > >

    Источник

    Читайте также:  Шедулер java что это
Оцените статью