Classloading within Webstart plus static classes

Hi folks!
I've a big problem in a software project in "migrating" a normal client-server-RMI-SWT-application to be 100% webstart compatible.
Everything works really fine except for dynamic classloading on demand.
The system currently is packaged in some jars.
Depending on the mask shown to the screen, the system looks for a "customize" class inside the resources. If it finds one, it loads and then does a "defineClass" and then calls a method via the "invoke" mechanism.
The classes are kind of standardized.
The problem is, that the "refering" classes from the - let's say - main application are mostly static.
The called class then tries to call the "namespace" of these classes but only get's null objects - no matter what object it was.
Run as a normal application - the whole system is working perfectly.
So as a "big picture", I have the following construct:
calling Client-Application + Classloader, using a static class for saving object data.
defining content of one of these static classes:
DemoObject.setFoobar("Hello world");
ClassLoader .....
getResourceAsStream("com/foobar/demo/customizeLogic.class");
defineClass(byte[] blablablabla,....)
findMethod.....
myMethod.invoke(....)inside the dynamic loaded customizeLogic class we do the following
String demo = DemoObject.getFoobar();
// this results now into NULL
// even the ClassLoader is manually loading all java.* plus all other classes because it seems to have a securitymechanism not to share the class-space.I already tried to set the classloader to all variants like SystemClassLoader, ContextClassLoader etc.
-- but, none worked. I cannot share the same ClassLoader-Resources with the main and "fixed" application... :-(
Does anyone have a clue or needs more information? I can post some sourcecode also.
Thorsten

Hi folks!
For the most of our problems we're now doing it as "keep it simple".
I'm just making a Class.forName - "Loading" which works good for alle the classes out of the jars.
PLUS the setSecurityManager tag - yup.
During the last weeks I wasn't able to reply because the project ate too much time.
We'll split the classloading into two or more or less 3-4 parts. One is for the WEBSTART - Edition and one for "normal Client" version. The webstart version we'll split for loading classes vs. loading "normal" resources out of the jars... this will give us flexibility while being able to solve all our problems for now...
Regards,
Thorsten

Similar Messages

  • Static class reference

    Below we have a class containing a static class variable and a static accessor method.
    The method is responsible for assigning the variable, which it does on demand.
    public class MyClass
        private static int INFO = -1;
        public static int getInfo()
            if(INFO < 0)
                try
                    INFO = ...;
                catch(Exception e)
            return INFO;
        }When using this class is it not safe to assume that the assignment of the variable will ever only occur once for the life of the system that uses this class? (afterall is it static within the class)
    I am experiencing the situation whereby EVERY time the method is called, the assignment of the variable is necessary. I can only assume that the static instance of this class in memory has been lost between each call and therefore the state/value of the variable has also been lost.
    It is worth noting that no object instances of this class are ever created. The class is accessed only through its static interface. It seems that since no local reference to objects of this class are held in memory then the entire class, along with its internal static state, is cleared from memory (garbage collected?).
    How is it possible to ensure that the state of static fields within such a class is preserved over time, without create instances of the class.
    John

    When using this class is it not safe to assume that
    the assignment of the variable will ever only occur
    once for the life of the system that uses this class?First of all, you haven't said what you assign it to, so we can't say. If you assign a value less than zero then it will be reassigned next time the method is called.
    Secondly, it depends on whether or not you're expecting it to be thread-safe? It isn't.
    If your code is not multi-threaded, then the section of code in your getInfo method that assigns the field should only execute once during a single run of an application.
    Thirdly, you explicitly assign it (to minus one) at class initialisation time, so stricty speaking, the variale will always be assigned at least once, and will be assigned at least once more if the getInfo method is ever called.
    I am experiencing the situation whereby EVERY time the
    method is called, the assignment of the variable is
    necessary. Can you offer any evidence to this? A small, complete, compilable and executable example that demonstrates the problem will help, and will probably get you an answer pretty quickly around here.
    I can only assume that the static instance
    of this class in memory has been lost between each
    call and therefore the state/value of the variable has
    also been lost.Then either there is a bug in your JVM, or at least two versions of the class have been loaded, and at least one of those was not loaded by the system classloader. Without further info, we aren't going to be able to help much more here.
    The class is accessed only
    through its static interface. It seems that since no
    local reference to objects of this class are held in
    memory then the entire class, along with its internal
    static state, is cleared from memory (garbage
    collected?).This is not allowed under the JLS if the class was loaded by the system classloader. If it was loaded by another classloader, then it is only allowed if it can be determined that the class will never again be used throughout the entire run of the application. Since you are referencing the class again, this should not be happening.
    How is it possible to ensure that the state of static
    fields within such a class is preserved over time,
    without create instances of the class.From what you have told us so far, it should be. You will probably have to provide some code for us to help you further.

  • Alternative to Static Class Inherit

    Greetings,
    I’ve been using some code for years in a different number of applications but that involves a lot of copy paste and is a nightmare to maintain. For that reason I’ve took some time to re-organize some of my codes and that mainly involves
    splitting it into multiple projects for latter inclusion in a number of solutions.
    So far so good and I’d say 95% is done but I’m now stuck with a Static Class I need to use. I basically need a few “Global” parameters and settings to be available across every solution. I know I can’t Inherit a Static Class nor override
    a Field to return a different value unfortunately.
    In a nutshell:
    myFrameworkProject
    namespace
    myFramework.Classes{
                    //these contains general stuff
    used in every project
                    public static class Globals{
                                   public static
    XPTO veryImportantProperty = new XPTO()
                                   public static
    Settings Settings = new Settings();
    public void doSomethingImportant();
    Public class Settings{
                    Private
    string Username;
                    Private
    string Password;
                    Private
    string Whatever;
    myFancyProject
    namespace
    myFancyProject.Classes{
                    //these add specific stuff used
    in this project
                    public static class Globals : myFramework.Classes.
    Globals {
                                   public static
    override mySettings Settings = new mySettings();
    Public class mySettings: myFramework.Classes .Settings{
                    //some
    more specific settings I need
                    Private
    string SomethingElse;
    What are my options? I’ve been trying to play with Singletons but for some reason I just can’t seem to make it work the way I want to…probably because it’s just not the right way to do it in the first place.

    I think you are over thinking it a little bit. The example you have above would be great if you had multiple setting types you wanted to retrieve within the same application domain instance using keys or specific types. The way I understand your problem
    is you have one settings type per application that you run with various applications sharing a code base. Here is an example I created for you which better illustrates the solution I had in mind when I read your problem.
    There are 2 namespaces, the one for your custom project(s) named FancyProject and then the Core / framework. Hope this helps!
    namespace JF.FancyProject
    using JF.Framework.Classes;
    // in initialization of your default application domain (ie. in your application startup)
    // inject your MySingleton with your custom implementation of ISettingsBuilder
    // this can be done in many ways from hard coding in each startup routine to IoC / Dependency Injection
    // the end result is this
    public static class Console
    public static void Main(params string[] args)
    MySingleton.Initialize(new ConcreteSettingsBuilder());
    // now you can use it where ever
    var temp = MySingleton.SettingsConcreteInstance<ConcreteSettings>().SomethingCustom;
    // or base
    var temp1 = MySingleton.SettingsInstance.SomeBaseThing;
    public sealed class ConcreteSettings : JF.Framework.Classes.SettingsBase
    public string SomethingCustom { get; set; }
    public sealed class ConcreteSettingsBuilder : BaseSettingsBuilder, ISettingsBuilder
    public override SettingsBase CreateSettings()
    var settings = new ConcreteSettings();
    // call the base if you need to get standard settings populated
    base.populateBaseSettings(settings);
    // populate all of your custom settings
    return settings;
    namespace JF.Framework.Classes
    public abstract class SettingsBase
    public string SomeBaseThing { get; set; }
    // base settings and behavior that can be abstracted
    public static class MySingleton
    private static SettingsBase _settings;
    private static Lazy<SettingsBase> _lazyCreationMethod;
    public static void Initialize(ISettingsBuilder builder)
    _lazyCreationMethod = new Lazy<SettingsBase>(builder.CreateSettings);
    public static SettingsBase SettingsInstance
    get { return _lazyCreationMethod.Value; }
    public static T SettingsConcreteInstance<T>() where T : SettingsBase
    return (T) _lazyCreationMethod.Value;
    public abstract class BaseSettingsBuilder : ISettingsBuilder
    public abstract SettingsBase CreateSettings();
    protected virtual void populateBaseSettings(SettingsBase settings)
    // if you find many of your settings are created the same way use a base class
    public interface ISettingsBuilder
    SettingsBase CreateSettings();
    Edit:
    One more thought. I do agree with some of the other posters that  for bigger projects the use of a Singleton pattern is not a good idea. For little applications it does not matter too much because chances are there is not enough substance that it will
    hinder your code and the development cycles are generally very short.
    Should you want to reconsider the Singleton pattern then I recommend you look at something like
    Autofac, you could use this to inject instances of your ISettingsBuilder, or other concrete instances, directly into your dependent classes and you could take it further in developing self containing services that you could
    inject as well.
    Again, for small projects its not a big deal but if you ever start on something a bit more complex its worth looking into.
    -Igor

  • Attributes of private static class - private or package private?

    Consider the following code:
    public class Outer {
        // Remainder omitted
        private static class Nested {
            int someInt           = 10;
            String someString = "abc";
    }The nested class Nested is declared private, as it is only used by the Outer class... now I wonder... should I declare Nested's attributes private oder package private... either way, they can't be accessed from the outside... any ideas?

    stevops wrote:
    either way, they can't be accessed from the outsideThat is true. However, when in addition the members of class Nested are declared as private, you will not be able to access them also from within the class Outer as well, i.e. int i = Nested.someInt; will give you compliation errorsAs a matter of fact, at most it'll generate some warnings, for it (the compiler) will generate synthetic accessor methods for Nested's fields.
    All in all, if you plan to access private class members from an enclosing (or inner) class, you really only have two options: make them explicitly package-private, or make them implicitly so.

  • Releasing static classes in a browser environment

    Hi all, got a problem I can't seem to find a solution for, so hoping someone knows what to do with this!
    I'm running a Java applet in a browser, under Sun's JVM. It has a custom dynamic class loader, which queries our server and downloads patches to the software. However, this doesn't work entirely as planned. The JVM doesn't seem to want to clear the class cache until the browser is restarted. I'm also wondering about static class definitions and whether I'd have to do something different to refresh those too.
    Ideally, when the loader starts and downloads patches to files, it then completely wipes out its previous definitions of cached classes, and reloads them all again from disk. Is this possible, and how would I go about doing it?
    (The reason for this behaviour is my old old software ran on Java 1.1, and the MS Java plugin exhibits this behaviour, which our users were used to...)
    Thanks in advance!
    David

    Thanks for the quick reply :)
    The loader is not static, so it should be using a new
    instance each time already? Or is it not sufficient
    to simply make it not static?Not really sure how to answer that! It's not static, so presumably it's an instance field of some other class. Now, are you using a new instance of that object each time you download a new patch? If not, that'll probably be the problem. If so, then probably what's going on is, your classloader isn't loading the classes at all, but simply delegating to it's parent. If that's the case, you need to make that delegation fail, for example by not giving your classloader a parent

  • Custom Taglets and static class fields/methods...

    Hey all,
    I have a curiosity question (running winxp + j2sdk 1.4.2_04).
    I have written a few stand-alone and inline taglets to help me document my code. I had some problems initially getting the HTML to output correctly (and I don't know how to run javadoc in the debugger) so I wrote a simple class with only static methods/members that tracks the nesting level of the current tag and allows me to pad (prefix) the output based on the nesting level (rudimentary I know). I wasn't sure if the javadoc process was multi-threaded or not, so all methods are synchronized.
    My problem is that the static initializer is being called 6 different times during the execution of javadoc.exe, resulting in what I would term as 6 "static" instances. Now, the only reason I can think of for this is that it is spinning off new process for each type of taglet it encounters. However, processing seems sequential and I don't see any other processes in Windows Task Manager. Here is the static initializer code:
         static {
              ic = new IndentControl();
              System.out.println("static: " + Thread.currentThread() + " ic instance: " + ic);
    and here is the output of javadoc.exe:
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@33c78b
         Registered Taglet ndstest.util.javadoc.MandatoryTaglet ...
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@6c137c
         Registered Taglet ndstest.util.javadoc.OptionalTaglet ...
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@1104da7
         Registered Taglet ndstest.util.javadoc.MemberInlineTaglet ...
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@6745b9
         Registered Taglet ndstest.util.javadoc.DescriptionInlineTaglet ...
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@10a14ad
         Registered Taglet ndstest.util.javadoc.ExampleTaglet ...
         static: Thread[main,5,main] ic instance: ndstest.util.javadoc.IndentControl@1afe460
         Registered Taglet ndstest.util.javadoc.ToDoTaglet ...
    Why does the static initializer get called 6 different times? It's mildly annoying and I want to understand why and if it is something I am doing to cause this.
    Thanks!

    Well, have you ever taken a look at the implementation of the Standard doclet? (Its source code is part of the SCSL distribution.)
    The current implemenatation uses a TagletManager to handle/store/load custom taglets.
    For each -taglet option, method addCustomTag of this TagletManager is called.
    This method creates a new instance of UrlClassLoader and uses loadClass( className ) to load the taglet each time it is called.
    So, each of your six taglets is loaded through/in a different ClassLoader context, therefore the static init block is executed six times.

  • Static class garbage collection

    Can garbage collector can garbage collect static classes ?.
    My doubt is that when you access a static class , that class is loaded through its class loader ( when first time that class is referenced ).
    So when did the garbage collector collects this static class ( assume that static class no longer referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a particular class ( Assume that i m implementing a singleton for my java runtime)
    thanks and regards
    Renjith.

    Can garbage collector can garbage collect static classes ?. Static classes are nothing special in terms of class loading - they are only different in visibility for linking.
    Perhaps you mean static members of classes?
    My doubt is that when you access a static class ,
    that class is loaded through its class loader ( when
    first time that class is referenced ). Classes are always loaded through classloaders. Objects of those classes are allocated from the heap, and the object instances refer to the class object.
    Objects (either instances, or classes themselves) are garbage collected when they are no longer live (i.e. no live object refers to them). (This is a somewhat recursive definition, and sometimes, you can have cyclic dependencies that make garbage collection tricky, but the GC, while it has to be conservative for correctness, usually gets it right).
    So for a static member to be garbage-collected, the class has to be garbage-collected first. The class cannot be GC'ed until all references to it go away (this includes all dynamically allocated objects of that type, and the class loader that loaded that class).
    And yes, class loaders can go away, but only if they are created by your program. The system class loader (which is the default classloader you get if you don't create any class loaders of your own) never goes away, so any class loaded from CLASSPATH will never be unloaded.
    (As an example, servlet containers - e.g. Tomcat, Weblogic, etc.) allocate one or more classloaders for each webapp. When the webapp is un-deployed, the classloaders are "orphaned", and they, and any classes loaded by them (from the WEB-INF/lib and WEB-INF/classes directories) are unloaded and garbage-collected. (After all the dynamic objects of those classes are GC'ed, of course).
    >
    So when did the garbage collector collects this
    static class ( assume that static class no longer
    referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a
    particular class ( Assume that i m implementing a
    singleton for my java runtime)
    thanks and regards
    Renjith.

  • Static classes and variables

    Hello,
    I put all of my constants in an *{color:#3366ff}interface{color}* called Constants.java (I only put constants in this file) and when obfuscated the Constants.class file is removed from .jar and constants are inlined into classes this is Great! However, do I gain anything by placing all of my static methods into one class? Currently, there are all over the place and also I have classes that are already static like HttpMgr.java/ErrorMgr.java/InfoMgr.java I am thinking about merging these classes together with all static methods defined within the project. Do I gain or loss anything by doing this?
    Thanks!

    you will gain some bytes by merging all the static classes in one.
    you can create a ManagerTool.java class and write inside all the static methods ...

  • How to change the default directory from within SQL*Plus ?

    Hello,
    I want to change the default directory directly from within SQL*Plus to be able to launch my command files with simple instructions like :
    @my_command.sql
    If I haven't launched SQL*Plus from the directory containing the file my_command.sql, how do I change the default directory to the directory of my command files ?
    I've searched through the Oracle documentation, there's no SET DEFAULTDIR or something like that. When I do a SHOW ALL, there's no variable containing the default directory.
    If you have an idea...
    regards,
    Jérôme.

    Hi Jérôme (J鲴me ?),
    You cannot directly do that, but you can use @@ instead of @ to run subscripts in the same directory as the superscript
    # head /tmp/tl30/xxx/[xyz].sql                    
    ==> /tmp/tl30/xxx/x.sql <==
    prompt call y
    @y
    prompt call z
    @@z
    quit
    ==> /tmp/tl30/xxx/y.sql <==
    prompt i am in y
    ==> /tmp/tl30/xxx/z.sql <==
    prompt i am in z
    # pwd                                             
    /root
    # sqlplus -s scott/tiger@lsc62 @/tmp/tl30/xxx/x.sql
    call y
    SP2-0310: Datei "y.sql" konnte nicht geöffnet werden
    call z
    i am in zKind regards
    Laurent Schneider
    OCM DBA

  • Purpose of static classes

    What is the purpose of making a class static?
    public static class December {
    }The only reason I can see is to access inner-classes without instantiating the outer-class? Are there any other?

    see these
    http://forum.java.sun.com/thread.jsp?forum=31&thread=277820
    http://forum.java.sun.com/thread.jsp?forum=31&thread=305260

  • Creation of a static class with private methods

    I'm new to java programming and am working on a project where I need to have a static class that does a postage calculation that must contain 2 private methods, one for first class and one for priority mail. I can't seem to figure out how to get the weight into the class to do the calculations or how to call the two private methods so that when one of my other classes calls on this class, it retrieves the correct postage. I've got all my other classes working correct and retrieving the information required. I need to use the weight from another class and return a "double". Help!!!
    Here's my code:
    * <p>Title: Order Control </p>
    * <p>Description: Order Control Calculator using methods and classes</p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: Info 250, sec 001, T/TH 0930</p>
    * @author Peggy Blake
    * @version 1.0, 10/29/02
    import javax.swing.*;
    public class ShippingCalculator
    static double firstClass, priorityMail;
    //how do I get my weight from another class into this method to use??? not sure I understand how it works.
    public static double ShippingCalculator(double weight)
    String responseFirstClass;
    double quantity, shippingCost;
    double totalFirstClass, firstClass, priorityMail, totalShipping;
    double priorityMail1 = 3.50d;//prioritymail fee up to 1 pound
    double priorityMail2 = 3.95d;//prioritymail fee up to 2 pounds
    double priorityMail3 = 5.20d;//prioritymail fee up to 3 pounds
    double priorityMail4 = 6.45d;//prioritymail fee up to 4 pounds
    double priorityMail5 = 7.70d;//prioritymail fee up to 5 pounds
    quantity = 0d;//ititialization of quantity
    // weight = 0d;//initialization of weight
    // shippingCost = 0d;
    //calculation of the number of items ordered..each item weights .75 ounces
    quantity = (weight/.75);
    if (quantity <= 30d)
    //add 1 ounce to quantities that weigh less than 30 ounces
    weight = (weight + 1);
    else
    //add 2 ounces to quantities that weigh more than 30 ounces
    weight = (weight + 2);
    if (weight > 80d)
    //message to orderclerk ..order over 5 lbs, cannot process
    JOptionPane.showMessageDialog(null, "Order exceeded 5 lbs, cannot process");
    //exit system, do not process anything else
    System.exit (0);
    else
    if (weight < 14d)
    //send message to customer: ship firstclass or priority, y or n
    responseFirstClass = JOptionPane.showInputDialog(null, "Ship first class? y or n?");
    if (responseFirstClass.equals("y"))
    //compute FirstClass shipping cost
    totalFirstClass = ((weight - 1) * .23d) + .34d;
    firstClass = totalFirstClass;
    else
    //compute PriorityMail cost for orders less than 14 ounces
    priorityMail = (priorityMail1);
    else
    if (weight <=16d)
    //compute totalshipping for orders up to 16 ounces
    priorityMail = (priorityMail1);
    else
    if (weight <=32d)
    //compute totalshipping for orders up to 32 ounces
    priorityMail = (priorityMail2);
    else
    if (weight <=48d)
    //compute totalshipping for orders up to 48 ounces
    priorityMail = (priorityMail3);
    else
    if (weight <= 64d)
    //compute totalshipping for orders up to 64 ounces
    priorityMail = (priorityMail4);
    else
    //compute totalshipping for orders up to 80 ounces
    priorityMail = (priorityMail5);
    priorityMail = 0d;
    firstClass = 0d;
    firstClassMail ();
    priorityMailCost ();
    //I think this is where I should be pulling the two methods below into my code, but can't figure out how to do it.
    shippingCost = priorityMail + firstClass;
    return (shippingCost);
    }//end method calculate shipping
    private static double firstClassMail()//method to get first class ship cost
    return (firstClass);
    }//end method firstclass shipping
    private static double priorityMailCost()//method to get priority mail cost
    return (priorityMail);
    }//end method priorityMail
    }//end class shipping calculator

    public class A {
    public String getXXX () {
    public class B {
    A a = new A();
    public void init () {
    a.getXXX();
    }

  • Static Class JMS Listener

    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?

    Hi Joost,
    This all seems to be pretty complicated. Not to mention that you can not
    guarantee that members of a cluster will be notified simultaneously.
    Why don't you want using the database?
    "Joost Ouwerkerk" <[email protected]> wrote in message
    news:[email protected]..
    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?Regards,
    Slava Imeshev

  • Do static classes persist for the lifetime of the applet or the JRE in 1.4

    I have an application that runs in a web browser and uses several applets that share data between each other using a static class. This method works fine for version 1.3 but not in 1.4.x. Do static classes now only exist for the lifetime of the applet?

    I had a similar problem and solved it by setting the codebase attribute on the applet tags. The only documentation I have been able to find about this issue is here: http://java.sun.com/products/plugin/1.3.1_01a/new.html#classloader

  • Usage of non static members in a static class

    Can you explain the usage of nonstatic members in a static class?

    Skydev2u wrote:
    I just recently started learning Java so I probably know less than you do. But from what I've learned so far a static class is a class that you can only have one instance of, like the main method. As far as non static members in a static class I think it allows the user to modify some content of the class(variables) even though the class is static. A quick Google help should help though.Actually the idea behind a static class is that you dont have any instances of it at all, its more of a place holder for things that dont have anywhere to live.
    Non-static members in a static class wouldnt have much use

  • Can we create static class in actionscript 3.0

    Hi If yes please send me chunk of code .
    thanks

    Hi Prashanth,
    There is no specifically a Static class in Flex that you can declare it at the compile time. However you can have Static variables and methods in your class and you can call them using the class name itself without creating an instance of that class.
    Here is the chunk of code...
    package com.constants
    [Bindable]
    public class ConsumerMessageConstants
      public static const UNABLE_TO_ENROLL_PLANS_MESSAGE_ID:String = "10000";
      public static const MARITAL_STATUS_UPDATED_MESSAGE_ID:String = "10001";
      public static const ERROR_IN_EDITING_MARITALSTAUS_MESSAGE_ID:String = "10002";
      public static const SMOKER_STATUS_SAVED_SUCCESSFULLY_MESSAGE_ID:String = "10003";
      public static const PASSWORD_RESET_REQUIRED_MESSAGE_ID:String = "10004";
      public static const ADDRESS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10005";
      public static const UNABLE_TO_REMOVE_THIS_DEPENDENT_MESSAGE_ID:String = "10006";
      public static const EMPLOYEE_SALARY_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10007";
      public static const ERROR_IN_EDITING_SALARY_MESSAGE_ID:String = "10008";
      public static const PLEASE_SELECT_A_CONSIDER_PLAN_MESSAGE_ID:String = "10009";
      public static const YOU_MUST_CHOOSE_A_PLAN_COVERAGE_LEVEL_MESSAGE_ID:String = "10010";
      public static const PLEASE_SELECT_PLAN_TO_LOCK_PORTFOLIO_MESSAGE_ID:String = "10011";
      public static const DEEPDIVE_INFORMATION_SAVED_SUCCESSFULLY_MESSAGE_ID:String = "10012";
      public static const NO_DATA_TO_DISPLAY_MESSAGE_ID:String = "10013";
      public static const NO_PLANS_AVAILABLE_TO_ENROLL_MESSAGE_ID:String = "10014";
      public static const NO_PLANS_TO_BE_ENROLLED_MESSAGE_ID:String = "10015";
      public static const PASSWORD_CHANGED_SUCCESSFULLY_MESSAGE_ID:String = "10016";
      public static const NEW_PASSWORD_AND_CONFIRM_PASSWORD_SAME_MESSAGE_ID:String = "10017";
      public static const YOUR_DATA_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10018";
      public static const HEALTH_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10019";
      public static const HEALTH_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10020";
      public static const MONEY_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10021";
      public static const MONEY_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10022";
      public static const PROTECTION_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10023";
      public static const PROTECTION_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10024";
      public static const UNABLE_TO_RETRIEVE_PATHS_MESSAGE_ID:String = "10025";
      public static function func1():Void
      public static function func2():Void
      public function ConsumerMessageConstants()

Maybe you are looking for

  • Opening an FDF that references a PDF in Firefox and Safari

    Our ASP.NET application serves up fdf and the associated pdf files from an underlying database. We use Fdfacx to generate the FDF with a reference (set using FDFSetFile) to a PDF. Both FDF and PDF URLs have parameters. When we use IE7, all works fine

  • Down Loaded new Itunes, now I cant get it to work

    I am an avid Itunes user, I just moments ago downloaded the newest version of Itunes. Now when I try to launch Itunes nothing happens. None of my shortcuts to Itunes work. I have even tried to log in from the apple website, I tune will not run for me

  • Letters get jumbled when I type

    For the last month, whenever I try to type in Firefox, especially in Facebook or Twitter, but really anywhere in Firefox, the letters are all jumbled together, like this: Thisis ho w my typing comesou ti n firefox wheni'm trying tot ype in Twitter, o

  • Sending texts instead of iMessages

    My husband used to have an iphone, now he does not. I still do.  When I text him my phone attempts to send him an iMessage and not a text message. I have changed his contact to be a "mobile" contact and not "iphone" contact. I have deleted all old iM

  • Difference between rsnast00 and rseout00

    hi,   Can any one say me the difference between RSNAST00 and RSEOUT00.