About the reflection

Is there any way to use custom classes with reflection?
I mean dynamicly creat the object instance of the custom
class ,without declare in the programme
package {
import com.customtypes.string; // Custom String
Implementation Class
import flash.utils.getDefinitionByName;
public class GetDefinitionByNameExample {
public function GetDefinitionByNameExample() {
var ClassReference:Class =
getDefinitionByName(“com.customtypes.string”) as Class;
var instance:Object = new ClassReference();
instance.customParameter = “my parameter”;
The proramme will give a error ......
Is there any way to do it ?

Came to know about the "reflection API" which helps
in doing that.
How does that work ? and in what kind of situations
can this API be used?read this...
http://java.sun.com/docs/books/tutorial/reflect/index.html

Similar Messages

  • What do people think about the different Generic Java approaches?

    I have seen a lot of different approaches for Generic Java, and when people find problems with each approach the normal response has been: the other approach is worse with such and such a problem, do you have a better way?
    The different approaches I have seen are: (in no particular order)
    Please correct me if I am wrong and add other approaches if they are worthy of mention.
    1) PolyJ - by MIT
    This is a completely different approach than the others, that introduces a new where clause for bounding the types, and involves changing java byte codes in order to meet it's goals.
    Main comments were not a java way of doing things and far too greater risk making such big changes.
    2) Pizza - by Odersky & Wadler
    This aims at extending java in more ways than just adding Generics. The generic part of this was replaced by GJ, but with Pizza's ability to use primitives as generic types removed, and much bigger changes allowing GJ to interface with java.
    Main comments were that Pizza doesn't work well with java, and many things in Pizza were done in parallel with java, hence were no longer applicable.
    3) GJ - by Bracha, Odersky, Stoutamire & Wadler
    This creates classes with erased types and bridging methods, and inserts casts when required when going back to normal java code.
    Main comments are that type dependent operations such as new, instanceof, casting etc can't be done with parametric types, also it is not a very intuitive approach and it is difficult to work out what code should do.
    4) Runtime Generic Information - by Natali & Viroli
    Each instance holds information about its Runtime Type.
    Main comments from people were that this consumes way too much memory as each instance holds extra information about its type, and the performance would be bad due to checking Type information at runtime that would have been known at compile.
    5) NextGen - by Cartwright & Steele
    For each parameterized class an abstract base class with types erased is made and then for each new type a lightweight wrapper class and interface are created re-using code from the base class to keep the code small.
    Main comments from people were that this approach isn't as backwards compatible as GJ due to replacing the legacy classes with abstract base classes which can't be instantiated.
    6) .NET common runtime - by Kennedy & Syme
    This was written for adding Generics to C#, however the spec is also targeted at other languages such as VB.
    Main comments from people were that this approach isn't java, hence it is not subject to the restrictions of changing the JVM like java is.
    7) Fully Generated Generic Classes - by Agesen, Freund & Mitchell
    For each new type a new class is generated by a custom class loader, with all the code duplicated for each different type.
    Main comments from people were that the generated code size gets too big, and that it is lacking a base class for integration with legacy code.
    8) JSR-14 - by Sun
    This is meant to come up with a solution Generic Solution to be used in java. Currently it is heavily based on GJ and suffering from all the same problems as GJ, along with the fact that it is constantly undergoing change and so no one knows what to expect.
    See this forum for comments about it.
    As if we didn't have enough approaches already, here is yet another one that hopefully has all of the benefits, and none of the problems of the other approaches. It uses information learnt while experimenting with the other approaches. Now when people ask me if I think I have a better approach, I will have somewhere to point them to.
    (I will be happy to answer questions concerning this approach).
    9) Approach #x - by Phillips
    At compile time 1 type is made per generic type with the same name.
    e.g.class HashSet<TypeA> extends AbstractSet<TypeA> implements Cloneable, Serializable will be translated to a type: class HashSet extends AbstractSet implements Cloneable, SerializableAn instance of the class using Object as TypeA can now be created in 2 different ways.
    e.g.Set a = new HashSet();
    Set<Object> b = new HashSet<Object>();
    //a.getClass().equals(b.getClass()) is trueThis means that legacy class files don't even need to be re-compiled in order to work with the new classes. This approach is completely backwards compatible.
    Inside each type that was created from a generic type there is also some synthetic information.
    Information about each of the bounding types is stored in a synthetic field.
    Note that each bounding type may be bounded by a class and any number of interfaces, hence a ';' is used to separate bounding types. If there is no class Object is implied.
    e.g.class MyClass<TypeA extends Button implements Comparable, Runnable; TypeB> will be translated to a type: class MyClass {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Button.class, Comparable.class, Runnable.class}, {Object.class}};This information is used by a Custom Class Loader before generating a new class in order to ensure that the generic types are bounded correctly. It also gets used to establish if this class can be returned instead of a generated class (occurs when the generic types are the same as the bounding types, like for new HashSet<Object> above).
    There is another synthetic field of type byte[] that stores bytes in order for the Custom Class Loader to generate the new Type.
    There are also static methods corresponding to each method that contain the implementation for each method. These methods take parameters as required to gain access to fields, contructors, other methods, the calling object, the calling object class etc. Fields are passed to get and set values in the calling object. Constructors are passed to create new instances of the calling object. Other methods are passed when super methods are called from within the class. The calling object is almost always passed for non static methods, in order to do things with it. The class is passed when things like instanceof the generated type need to be done.
    Also in this class are any non private methods that were there before, using the Base Bounded Types, in order that the class can be used exactly as it was before Generics.
    Notes: the time consuming reflection stuff is only done once per class (not per instance) and stored in static fields. The other reflection stuff getting done is very quick in JDK1.4.1 (some earlier JDKs the same can not be said).
    Also these static methods can call each other in many circumstances (for example when the method getting called is private, final or static).
    As well as the ClassLoader and other classes required by it there is a Reflection class. This class is used to do things that are known to be safe (assuming the compiler generated the classes correctly) without throwing any exceptions.
    Here is a cut down version of the Reflection class: public final class Reflection {
      public static final Field getDeclaredField(Class aClass, String aName) {
        try {
          Field field = aClass.getDeclaredField(aName);
          field.setAccessible(true);
          return field;
        catch (Exception ex) {
          throw new Error(ex);
      public static final Object get(Field aField, Object anObject) {
        try {
          return aField.get(anObject);
        catch (Exception ex) {
          throw new Error(ex);
      public static final void set(Field aField, Object anObject, Object aValue) {
        try {
          aField.set(anObject, aValue);
        catch (Exception ex) {
          throw new Error(ex);
      public static final int getInt(Field aField, Object anObject) {
        try {
          return aField.getInt(anObject);
        catch (Exception ex) {
          throw new Error(ex);
      public static final void setInt(Field aField, Object anObject, int aValue) {
        try {
          aField.setInt(anObject, aValue);
        catch (Exception ex) {
          throw new Error(ex);
    }Last but not least, at Runtime one very lightweight wrapper class per type is created as required by the custom class loader. Basically the class loader uses the Generic Bytes as the template replacing the erased types with the new types. This can be even faster than loading a normal class file from disk, and creating it.
    Each of these classes has any non private methods that were there before, making calls to the generating class to perform their work. The reason they don't have any real code themselves is because that would lead to code bloat, however for very small methods they can keep their code inside their wrapper without effecting functionality.
    My final example assumes the following class name mangling convention:
    * A<component type> - Array
    * b - byte
    * c - char
    * C<class name length><class name> - Class
    * d - double
    * f - float
    * i - int
    * l - long
    * z - boolean
    Final Example: (very cut down version of Vector)public class Vector<TypeA> extends AbstractList<TypeA> implements RandomAccess, Cloneable, Serializable {
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      public Vector<TypeA>(int anInitialCapacity, int aCapacityIncrement) {
        if (anInitialCapacity < 0) {
          throw new IllegalArgumentException("Illegal Capacity: " + anInitialCapacity);
        elementData = new Object[initialCapacity];
        capacityIncrement = capacityIncrement;
      public synchronized void setElementAt(TypeA anObject, int anIndex) {
        if (anIndex >= elementCount) {
          throw new ArrayIndexOutOfBoundsException(anIndex + " >= " + elementCount);
        elementData[anIndex] = anObject;
    }would get translated as:public class Vector extends AbstractList implements RandomAccess, Cloneable, Serializable {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      private static final Field $0 = Reflection.getDeclaredField(Vector.class, "elementData"),
                                 $1 = Reflection.getDeclaredField(Vector.class, "elementCount"),
                                 $2 = Reflection.getDeclaredField(Vector.class, "capacityIncrement");
      static void $3(int _0, Field _1, Object _2, Field _3, int _4) {
        if (_0 < 0) {
          throw new IllegalArgumentException("Illegal Capacity: " + _0);
        Reflection.set(_1, _2, new Object[_0]);
        Reflection.setInt(_3, _2, _4);
      static void $4(int _0, Field _1, Object _2, Field _3, Object _4) {
        if (_0 >= Reflection.getInt(_1, _2)) {
          throw new ArrayIndexOutOfBoundsException(_0 + " >= " + Reflection.getInt(_1, _2));
        ((Object[])Reflection.get(_3, _2))[_0] = _4;
      public Vector(int anInitialCapacity, int aCapacityIncrement) {
        $3(anInitialCapacity, $0, this, $2, aCapacityIncrement);
      public synchronized void setElementAt(Object anObject, int anIndex) {
        $4(anIndex, $1, this, $0, anObject);
    } and new Vector<String> would get generated as:public class Vector$$C16java_lang_String extends AbstractList$$C16java_lang_String implements RandomAccess, Cloneable, Serializable {
      protected Object[] elementData;
      protected int elementCount;
      protected int capacityIncrement;
      private static final Field $0 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "elementData"),
                                 $1 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "elementCount"),
                                 $2 = Reflection.getDeclaredField(Vector$$C16java_lang_String.class, "capacityIncrement");
      public Vector$$C16java_lang_String(int anInitialCapacity, int aCapacityIncrement) {
        Vector.$3(anInitialCapacity, $0, this, $2, aCapacityIncrement);
      public synchronized void setElementAt(String anObject, int anIndex) {
        Vector.$4(anIndex, $1, this, $0, anObject);
    }Comparisons with other approaches:
    Compared with PolyJ this is a very java way of doing things, and further more it requires no changes to the JVM or the byte codes.
    Compared with Pizza this works very well with java and has been designed using the latest java technologies.
    Compared with GJ all type dependent operations can be done, and it is very intuitive, code does exactly the same thing it would have done if it was written by hand.
    Compared with Runtime Generic Information no extra information is stored in each instance and hence no extra runtime checks need to get done.
    Compared with NextGen this approach is completely backwards compatible. NextGen looks like it was trying to achieve the same goals, but aside from non backwards compatibility also suffered from the fact that Vector<String> didn't extend AbstractList<String> causing other minor problems. Also this approach doesn't create 2 types per new types like NextGen does (although this wasn't a big deal anyway). All that said NextGen was in my opinion a much better approach than GJ and most of the others.
    Compared to .NET common runtime this is java and doesn't require changes to the JVM.
    Compared to Fully Generated Generic Classes the classes generated by this approach are very lightweight wrappers, not full blown classes and also it does have a base class making integration with legacy code simple. It should be noted that the functionality of the Fully Generated Generic Classes is the same as this approach, that can't be said for the other approaches.
    Compared with JSR-14, this approach doesn't suffer from GJ's problems, also it should be clear what to expect from this approach. Hopefully JSR-14 can be changed before it is too late.

    (a) How you intend generic methods to be translated.
    Given that Vector and Vector<Object> are unrelated types,
    what would that type be represented as in the byte code of
    the method? In my approach Vector and Vector<Object> are related types. In fact the byte code signature of the existing method is exactly the same as it was in the legacy code using Vector.
    To re-emphasize what I had said when explaining my approach:
    System.out.println(Vector.class == Vector<Object>.class);  // displays true
    System.out.println(Vector.class == Vector<String>.class);  // displays false
    Vector vector1 = new Vector<Object>(); // legal
    Vector<Object> vector2 = new Vector();  // legal
    // Vector vector3 = new Vector<String>(); // illegal
    // Vector<String> vector4 = new Vector();  // illegal
    Vector<String> vector5 = new Vector<String>();  // legal
    You must also handle the case where the type
    parameter is itself a parameterized type in which the type
    parameter is not statically bound to a ground instantiation.This is also very straightforward: (let me know if I have misunderstood you)
    (translation of Vector given in my initial description)
    public class SampleClass<TypeA> {
      public static void main(String[] args) {
        System.out.println(new Vector<Vector<TypeA>>(10, 10));
    }would get translated as:public class SampleClass {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      private static final Constructor $0 = Reflection.getDeclaredConstructor(Vector$$C16java_util_Vector.class, new Class[] {int.class, int.class});
      static void $1(Constructor _0, int _1, int _2) {
        try {
          System.out.println(Reflection.newInstance(_0, new Object[] {new Integer(_1), new Integer(_2)}));
        catch (Exception ex) {
          throw (RuntimeException)ex;
      public static void main(String[] args) {
        $1($0, 10, 10);
    }and SampleClass<String> would get generated as:public class SampleClass$$C16java_lang_String {
      private static final Constructor $0 = Reflection.getConstructor(Vector$$C37java_util_Vector$$C16java_lang_String.class, new Class[] {int.class, int.class});
      public static void main(String[] args) {
        SampleClass.$1($0, 10, 10);
    Also describe the implementation strategy for when these
    methods are public or protected (i.e. virtual).As I said in my initial description that for non final, non static, non private method invocations a Method may be passed into the implementing synthetic method as a parameter.
    Note: the following main method will display 'in B'.
    class A {
      public void foo() {
        System.out.println("in A");
    class B extends A {
      public void foo() {
        System.out.println("in B");
    public class QuickTest {
      public static void main(String[] args) {
        try {
          A.class.getMethod("foo", null).invoke(new B(), null);
        catch (Exception ex) {}
    }This is very important as foo() may be overwritten by a subclass as it is here. By passing a Method to the synthetic implementation this guarantees that covariance, invariance and contra variance all work exactly the same way as in java. This is a fundamental problem with many other approaches.
    (b) The runtime overhead associated with your translationAs we don't have a working solution to compare this to, performance comments are hard to state, but I hope this helps anyway.
    The Class Load time is affected in 4 ways. i) All the Generic Bytes exist in the Base Class, hence they don't need to be read from storage. ii) The custom class loader, time to parse the name and failed finds before it finally gets to define the class. iii) The generation of the generic bytes to parametric bytes (basically involves changing bytes from the Constant Pool worked out from a new Parametric type, Utf8, Class and the new Parametric Constant types may all be effected) iv) time to do the static Reflection stuff (this is the main source of the overhead). Basically this 1 time per class overhead is nothing to be concerned with, and Sun could always optimize this part further.
    The normal Runtime overhead (once Classes have been loaded) is affected mainly by reflection: On older JDKs the reflection was a lot slower, and so might have made a noticeable impact. On newer JDKs (since 1.4 I think), the reflection performance has been significantly improved. All the time consuming reflection is done once per class (stored in static fields). The normal reflection is very quick (almost identical to what is getting done without reflection). As the wrappers simply include a single method call to another method, these can be in-lined and hence made irrelevant. Furthermore it is not too difficult to make a parameter that would include small methods in the wrapper classes, as this does not affect functionality in the slightest, however in my testing I have found this to be unnecessary.
    (c) The space overhead (per instantiation)There are very small wrapper classes (one per new Type) that simply contain all non private methods, with single method calls to the implementing synthetic method. They also include any fields that were in the original class along with other synthetic fields used to store reflected information, so that the slow reflection only gets done once per new Type.
    (d) The per-instance space overheadNone.
    (e) Evidence that the proposed translation is sound and well-defined for all relevant cases (see below)Hope this is enough, if not let me know what extra proof you need.
    (f) Evidence for backward compatibility
    (For example, how does an old class file that passes a Vector
    to some method handle the case when the method receives a Vector<T>
    where T is a type parameter? In your translation these types are unrelated.)As explained above, in my approach these are only unrelated for T != Object, in the legacy case T == Object, hence legacy code passing in Vector is exactly the same as passing in Vector<Object>.
    (g) Evidence for forward compatibility
    (How, exactly, do class files that are compiled with a generics compiler run on an old VM)They run exactly the same way, the byte codes from this approach are all legal java, and all legal java is also legal in this approach. In order to take advantage of the Generics the Custom Class Loader would need to be used or else one would get ClassNotFoundExceptons, the same way they would if they tried using Collections on an old VM without the Collections there. The Custom Class Loader even works on older VMs (note it may run somewhat slower on older VMs).
    (h) A viable implementation strategyType specific instantiations are at Class Load time, when the Custom Class Loader gets asked for a new Class, it then generates it.
    The type specific instantiations are never shipped as they never get persisted. If you really wanted to save them all you need to do is save them with the same name (with the $$ and _'s etc), then the class loader would find them instead of generating them. There is little to be gained by doing this and the only reason I can think of for doing such a thing would be if there was some reason why the target VM couldn't use the Custom Class Loader (the Reflection class would still need to be sent as well, but that is nothing special). Basically they are always generated at Runtime unless a Class with the same name already exists in which case it would be used.
    The $GENERIC_DESCRIPTOR and $GENERIC_BYTES from the base class along with the new Type name are all that is required to generate the classes at runtime. However many other approaches can achieve the same thing for the generation, and approaches such as NextGen's template approach may be better. As this generation is only done once per class I didn't put much research into this area. The way it currently works is that the $GENERIC_DESCRIPTOR are basically used to verify that a malicious class files is not trying to create a non Type Safe Type, ie new Sample<Object>() when the class definition said class Sample<TypeA extends Button>. The $GENERIC_BYTES basically correspond to the normal bytes of a wrapper class file, except that in the constant pool it has some constants of a new Parametric Constant type that get replaced at class load time. These parametric constants (along with possibly Utf8 and Class constants) are replaced by the Classes at the end of the new type name, a little more complex than that but you probably get the general idea.
    These fine implementation details don't affect the approach so much anyway, as they basically come down to class load time performance. Much of the information in the $GENERIC_BYTES could have been worked out by reflection on the base type, however at least for now simply storing the bytes is a lot easier.
    Note: I have made a small syntax change to the requested class:
    public T(X datum) --> public T<X>(X datum)
    class T<X> {
      private X datum;
      public T<X>(X datum) {
        this.datum = datum;
      public T<T<X>> box() {
        return new T<T<X>>(this);
      public String toString() {
        return datum.toString();
      public static void main(String[] args) {
        T<String> t = new T<String>("boo!");
        System.out.println(t.box().box());
    }would get translated as:
    class T {
      public static final Class[][] $GENERIC_DESCRIPTOR = {{Object.class}};
      public static final byte[] $GENERIC_BYTES = {/*Generic Bytes Go Here*/};
      private Object datum;
      private static final Field $0 = Reflection.getDeclaredField(T.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C1T.class, new Class[] {T.class});
      static void $2(Field _0, Object _1, Object _2) {
        Reflection.set(_0, _1, _2);
      static Object $3(Constructor _0, Object _1) {
        try {
          return Reflection.newInstance(_0, new Object[] {_1});
        catch (Exception ex) {
          throw (RuntimeException)ex;
      static String $4(Field _0, Object _1) {
        return Reflection.get(_0, _1).toString();
      static void $5() {
        T$$C16java_lang_String t = new T$$C16java_lang_String("boo!");
        System.out.println(t.box().box());
      public T(Object datum) {
        $2($0, this, datum);
      public T$$C1T box() {
        return (T$$C1T)$3($1, this);
      public String toString() {
        return $4($0, this);
      public static void main(String[] args) {
        $5();
    }as the generic bytes aren't very meaningful and by no means a requirement to this approach (NextGen's template method for generation may work just as well), here are the generated classes with some unused code commented out instead:
    class T$$C28T$$C22T$$C16java_lang_String {
      private T$$C22T$$C16java_lang_String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C28T$$C22T$$C16java_lang_String.class, "datum");
    //  private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C34T$$C28T$$C22T$$C16java_lang_String.class, new Class[] {T$$C28T$$C22T$$C16java_lang_String.class});
      public T$$C28T$$C22T$$C16java_lang_String(T$$C22T$$C16java_lang_String datum) {
        T.$2($0, this, datum);
    //  public T$$C34T$$C28T$$C22T$$C16java_lang_String box() {
    //    return (T$$C34T$$C28T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C22T$$C16java_lang_String {
      private T$$C16java_lang_String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C22T$$C16java_lang_String.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C28T$$C22T$$C16java_lang_String.class, new Class[] {T$$C22T$$C16java_lang_String.class});
      public T$$C22T$$C16java_lang_String(T$$C16java_lang_String datum) {
        T.$2($0, this, datum);
      public T$$C28T$$C22T$$C16java_lang_String box() {
        return (T$$C28T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C1T {
      private T datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C1T.class, "datum");
    //  private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C6T$$C1T.class, new Class[] {T$$C1T.class});
      public T$$C1T(T datum) {
        T.$2($0, this, datum);
    //  public T$$C6T$$C1T box() {
    //    return (T$$C6T$$C1T)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    class T$$C16java_lang_String {
      private String datum;
      private static final Field $0 = Reflection.getDeclaredField(T$$C16java_lang_String.class, "datum");
      private static final Constructor $1 = Reflection.getDeclaredConstructor(T$$C22T$$C16java_lang_String.class, new Class[] {T$$C16java_lang_String.class});
      public T$$C16java_lang_String(String datum) {
        T.$2($0, this, datum);
      public T$$C22T$$C16java_lang_String box() {
        return (T$$C22T$$C16java_lang_String)T.$3($1, this);
      public String toString() {
        return T.$4($0, this);
      public static void main(String[] args) {
        T.$5();
    }the methods from the Reflection class used in these answers not given in my initial description are:
      public static final Object newInstance(Constructor aConstructor, Object[] anArgsArray) throws Exception {
        try {
          return aConstructor.newInstance(anArgsArray);
        catch (InvocationTargetException ex) {
          Throwable cause = ex.getCause();
          if (ex instanceof Exception) {
            throw (Exception)ex;
          throw new Error(ex.getCause());
        catch (Exception ex) {
          throw new Error(ex);
      public static final Constructor getDeclaredConstructor(Class aClass, Class[] aParameterTypesArray) {
        try {
          Constructor constructor = aClass.getDeclaredConstructor(aParameterTypesArray);
          constructor.setAccessible(true);
          return constructor;
        catch (Exception ex) {
          throw new Error(ex);
      }

  • Creating junit test cases using the reflection API

    In order to use the reflection API to get information about a *.java file's class name and methods, I need to compile the *.java file first, and then get info through the *.class file. Am I right?
    Eclipse, the Java IDE, can create junit test cases for java files the user selects right after the *.java files have been created, and even before the *.java files have been compiled by the user. I guess Eclipse internally compiles the java files before creating JUnit test cases for them. Does anyone know about it? Thanks.

    Let me explain my problem in more details.
    Given any java source tree, my program is supposed to create junit test cases for each class using java reflection. My approach is to scan through the source tree to keep the list of classes available, then compile all the java files in the given source tree, then do Class.forName() to load them to get their methods... Obviously I don't know what classes I will have at compilation time. I create a temp_classes directory as the output directory for the given source tree java files, and I add temp_classes to my classpath when I strart up my own program. However, that won't work..
    D:\eclipse\workspace\cmpe271_hw4\classes>java -classpath ..\classes;..\temp_classes Test
    javac -classpath .\temp_classes; -d .\temp_classes @temp_classes\javalist.txt
    java.lang.ClassNotFoundException: Factory
    java.lang.ClassNotFoundException: InvalidDateFormatException
    java.lang.ClassNotFoundException: MyUtility
    java.lang.ClassNotFoundException: Storage

  • Questions about the bandwidth.

    Let me explain my existing environment
    as follows :
    - I have two 2801 routers with
    C2801-SPSERVICESK9-M IOS
    - Each router has Four-port FXS
    connected to the phones
    - The bandwidth between these routers
    is 256 Kbps ( Leased Line )
    My qouestions are as follows :
    1. How many bandwidth are a call
    comsumed ( per call ) ?
    2. To ensure that the bandwidth of
    VoIP is not excess the maximum
    bandwidth of leased line. And to
    ensure that the priority of VoIP
    is always higher than the priority
    Data. I will use RSVP and CBWFQ
    with ip precedence. Are these
    features suitable for the
    situation ?
    Thanks!! : )

    hi
    regarding bandwidth consumption it depends upon the kinda codec which you are gonna use up there.
    ofcourse g.729 does uses minimal amount of bandwidth and also that get reflects in ur quality.
    If you are gonna used some kinda RTP compression out there that can always reduce the packet length drastically to lesser size which will be easier as well u will be able to use the B/W effectively .
    regarding the priority part you can always use up LLQ to have high priority for your VOICE traffic and deploy CBWFQ for your data traffic.
    if u wanna have sample configs would suggest to do a search in cisco about the same ,if u need further assistance do revert..
    regds

  • InvocationTargetException when using the reflection package (Constructor)

    Hi there!
    its my first post in here and not an easy one I suppose.
    I have got a JFrame class that has a inner class to handle button events (the inner class implements java.awt.event.ActionListener).
    I have got a file browser to lookup a particular class file (which has to be javax.swing.jframe) on my harddisk.
    Then I try to construct a constructor :) and want to display the class.
    It works with simple classes but the class with the inner class i mentioned above makes probelems in throwing a InvocationTargetException Error when calling the contructor.
    Here is the exact message:
    InvocationTargetException!java.lang.IllegalAccessError: tried to access class org.eml.adaptiveUI.demo.TransformationDemo_jButton1_actionAdapter from class org.eml.adaptiveUI.demo.twoButtons
    twoButtons is the class i try to open vie the reflection and class methods, ransformationDemo_jButton1_actionAdapter is the inner class. If i run the main method of the twoButtons class and call the constructor directly there are no problems.
    Does the VM not know about the inner class or something like that? If yes how to get all the needed classes and how to inform the VM about it.
    Thanks a lot!

    Hi
    yes I start the prog out of Borlands JBuilder and the loaded clas (via reflection) is also in my project so everything (classpath) should be fine.
    The problem is that "invocation target exception" is about access modifiers. Inner classes are not public so the vm thinks i am not allowed to call the constructor, which is wrong because the outer class calls the constructor not me myself.
    Perhaps this is even a java bug?
    thx again, Heiner

  • Explain in detail about the operation of zerophasefilter.vi

    Description needed in detail.
    Thanks.

    I palyed with this some years ago.
    It runs off the idea that if you run a signal through a filter
    a) Only specific freq components of the signal will be passed.
    b) A phase shift that is on the order of the filter is introduced.
    When running the same signal through the same filter again,
    a) The freq components that passed before are still passed but the componenets that were removed in the first passed are not present so they are not remove.
    b) Another phase shift is introduced.
    The zero pahse shift filter runs the signal through the filter (you pick your favorite flavor) and then the signal is reflected about the Y-axis effectively reversing time. THe revers signal is run through the filter a second time but now the phase shift is is in the oposite time direction. This effectively cancels out the original phase shift.
    These are handy if you want to correlate a filtered event with an un-filtered event.
    BUT
    You do not get something for nothing (2nd Law of Theromdynamics).
    In getting better phase information you loose signal info at the front end and back end of the waveform.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Confused about the meaning of  Time Quota Types

    I am learning SAP-HCM on IDES 6.0. I am confused about the meaning of Time Quota Type. I have gone thru the SAP documentation, but still not clear about it. Please help me with a few examples. How is it different from Absence Type?

    Hi Gopal ,
    Absences are very generic ones that we create which needs to be reflected in IT2001 and dedcution can happen.
    Absence Quotas are the limited entitlement that is fixed say ur eligible for 10 days sick leave so here this is a Quota for each year  and so becomes a Quota say Sick leave Quota =10 and will be seen in IT2006.
    Now an absence needs to be linked to this Quota for dedcution.
    An absence can be or may not be linked to a Quota.This depends on business Requirement.
    Let me know if u have further Questions.
    Thanks
    Swati

  • What do you think about the new and improved SiriusDecisions Waterfall?

    SiriusDecisions launched their new and improved Demand Waterfall this week at their Summit in Scottsdale, Arizona. For those of you who haven't seen it yet, I have attached the PDF for your viewing pleasure. What do you think? What's strong? What's weak? Do you agree with Tony Jaros that teleprospecting is a required step in the Marketing Qualification process?

    It makes a lot of sense from our perspective.  Our sales organization has always generated the bulk of our leads, so it makes sense to account for them and to build programs to support them.  It was a great conference - my first SiriusDecisions Summit.  I came away both energized and overwhelmed.
    Our Inside Sales team qualifies almost all inquiries via telephone, so it makes sense to me that "teleprospecting" is a required step.  The only exceptions are sales-generated leads, so the waterfall reflects that perfectly.
    What I like most about the new waterfall is that it creates a clear structure for us to focus more on developing lead nurturing and pipeline acceleration programs specifically for teleprospecting- and sales-generated leads.  I'll admit that we've neglected this (simply including those contacts in our marketing-generated lead nurtures).  Furthermore, it reinforces the need to tailor nurtures to the buyer's stage in the buying process.  We tend to move all of our contacts through the same campaign and nurture activities as if they're progressing together, which obviously isn't the case.
    I'd be interested in learning how other Eloqua users are getting data back from their CRM on a contact who has turned into a qualified lead.  How do you find this information out?  Do you then put them through an individual nurture that is focused on accelerating the deal?

  • Macbook Pro C2D 15,4" on order - Should I worry about the display?

    I have ordered the new Macbook Pro C2D 15,4" and I read the numerous threads here about the display quality. I have just selled my CD Macbook Pro 15,4" so I want to ask you all here, is there a difference between the new and the previous model, or do you think that both are grainy?
    I personally found the display of the Macbook Pro CD very good and I hope that the new is at least as good as that one.

    My advice to you is check it out before you buy it. I've gone to 4 different apple stores or resellers and all the ones I've seen on display have unevenly back lit displays. You can tell the cd from the cd2 from the lighting. Its very obvious as you take a look at them side by side. You'll notice what i mean if you look at the very bottom corners of the display. There is more light coming through than the rest of the screen and this is very annoying. There also seems to be burn marks at the very corners, they are faint and gray but also noticable. In fact there seems to be a bar of light that looks like a reflection of the macbook pro, but is actually uneven lighting all the way across the bottom. Definately bad. I went through 3 17" macbook pros cd2 at the store and all 3 of them exhibited the same uneven lighting. So then i went with a 15" but that too had the same problems. I'm going to wait it out for another month or so. I love the macbook pros, but I want to spend my money on a good product.
    macbook pro 17" cd2   Mac OS X (10.4.8)  

  • HT4865 So who believes Apple should be a bit more cautionary about the sharing of iMessages and other content when several members of a family share the same iCloud account and unknowing can audit each other's iMessages, Contacts, and god only knows what

    I think Apple should be a bit more cautionary about iCloud and privacy.  My family shares the same iCloud account as we all enjoy the music we collectively purchase on iTunes; we paid Apple for this feature with some kind of grouped account.  We didn't know, however that this joins our devices so that iMessages, contacts, pictures and just about everything else is shared too.  The unprivate default seems to be to share everything between all devices vs. to allow access by exception or by choice (or by password?).  Sure, when my kids get all my texts I can go figure out why and fix it but that is in my mind the antithesis of privacy and could be quite embarrassing for any family.  I guess it is good for stalking the kids or parents though if they don't know about the partyline approach to privacy.  Maybe a tech solution would be to have the iPhone show somehow the extent of its audience to its user.

    No argument from me about the vagaries of using and sharing Apple IDs.  This can lead to unintended consequences, especially in a family situation.
    If you're sharing the same ID for FaceTime, you might want to go to Settings>FaceTime, tap the ID, sign out, then sign in with separate IDs there too.  Otherwise, you'll end up getting each other's FaceTime calls.
    Also, if you need to migrate everyone's devices to separate iCloud accounts to keep your synced data separated, you can do this by saving any photo stream photos you wish to keep to your camera roll (unless already there) by opening your my photo stream album, tapping Select, tapping the photos, tap the share icon (box with upward facing arrow), then tapping Save to Camera Roll.  If you are syncing notes with iCloud, you'll need to open each of your notes and email them to yourself so you can later copy and paste the text into new notes created in your new account.  Then go to Settings>iCloud, tap Delete Account (which only deletes it from this device, not from iCloud), choose Keep on My iDevice and provide the password to turn off Find My iPhone.  Then sign back in with a different Apple ID to create your new account and choose Merge to upload your data.  Once everyone's devices are on separate accounts, you can go to icloud.com and delete each other's data from your accounts.

  • Is there another way of getting apps from the appstore without putting your credit card number in, ive heard about the itunes gift card thing can anybody just give me more info about that and how i can buy free things free things from the appstorepls help

    Is there another way of getting apps from the appstore without putting your credit card number in, ive heard about the itunes gift card thing can anybody just give me more info about that and how i can buy free things free things from the appstore...pls help as im only a teenager and have no credit credit and my parents dont trust me with theres and they dont care about the fact that you can set up a password/.... PLEASE SOMEONE HELP I WILL BE SO GRATEFUL... And i would really like to get the iphone 4 but if there is no way of etting apps without your credit number then i would have to get a samsung galaxy s3 maybe ...

    You can set up an Apple ID without a credit card.
    Create iTunes Store account without credit card - Support - Apple - http://support.apple.com/kb/ht2534

  • I have a question about the calendar on the ipad2. I have multiple calendars in different colors. Some of the events are filled in with color. Others are just listed with a colored dot in front of the event. Any ideas why events ar showing up differently?

    I have an ipad2 and my question is about the calendar. I set up multiple calendars with different colors. Some of the events show up in filled color. Others only show with a colored dot in front of the event. I can't figure out why some show up one way and others show up differently? Any thoughts?

    On mine the ones that show on a coloured background are all-day events, the ones with dots and just timed events.

  • To whom do I complain about the calendar on the iPad 2 with iOS 7? I can no longer read my appointments. Is there an adjustment I can make? Larger text size doesn't help.

    To whom do I complain about the OS 7 calendar on the iPad 2? I used to be able to read my appointments. The new small font is horrible. Text size doesn't seem to change it. Can I change it?

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430http://support.apple.com/kb/ht1430
     Cheers, Tom

  • About the pricing procedure of purchasing order

    Hello friends,
    can anyone tell me about the pricing procedure,conditions & texation of Purchase order?
    and hoew to maintain all those term in Customisation?

    The Basic thing is Condition Technique. In which there are 
    1. Access Sequence 2. Condition Record 3. Condition Type 4. Condition Table. 
    A Access Sequence access a Condition Record of a Condition Type in a Condition Table is a  Condition Technique.This is a simple logic 
    Here the Condition Type is very important like PB00, PBXX,RA01 etc. 
    In the background every Condition Type has its own defition means the purpose of the Condition Type  like, is it for Pricing or Percentage, Quntity base, Accrual Feilds etc is to be defined to work this functions.  Normally we use the existing ones without any risk. But some cases, we have to Create a New Condition Types as per the organisation requirement. 
    The Pricing Schema is useful to minimise condition types while mention prices for Vendor on the basis of Pricing Schema which we defined according to organisation requirement. 
    The Pricing Schema means the calculations procedure of Condition Type. 
    Ex.  RA01 - Discoount % is caclulated on PB00 - Gross Price  means 
    RA01 is based on PB00  like that we have to define in the Pricing Schema 
    which makes easy to use in real time. 
    Here PB00 has the Access Sequence - 0002. 
    But RA01 does not have the Access Sequence.Why because it is a dependent on PB00. But both are Condition Types. 
    In the system, by default some standard  Scheme will be there at Vendor Schema Group in the Vendor Master Screen means the standard one is assigned which is very lengthy which may fullfil our requirement. But some cases which may not fullfil our requirement, in such we have to define. 
    For the configuration, I may not able to explain properly through here but will give some idea. 
    Configuration: SPRO - IMG - Material Management - Purchasing - Conditions - Define Price Deternmination Process:
    1. Define Access Sequence 
    2. Define Condition Type 
    3. Defince Calculation Schema:- Here you have to define the Schema - Define Schema group 
    1. Define Schema Group vendor 
    2. Define Pricing Schema group 
    3.  Schema group for Purchase Organisation 
    4. Assign Schema group to Purchase Organisation - Define Schema determination 
    1.define calculation schema for Standard purchase organisation 
    After completion of the Schema Group, we have to assign it to Vendors. 
    Then whenever we use any transaction with this Vendor, the concerned  Schema will work as configured by us. 
    The Pricing in MM is vast because each Condition have its own importance and each Access Sequence have its own importance. So you need not bother about this. First you learn how to define the Calculation Schema through the above.

  • I am using the Order Analysis Toolkit and want to get more information about the compensation for "Reference Signal Processing", which is scarce in the manuals, the website and the examples installed with the toolkit.

    I am using the Order Analysis Toolkit and want to get more information about the compensation for "Reference Signal Processing", which is scarce in the manuals, the website and the examples installed with the toolkit.
    In particular, I am analyzing the example "Even Angle Reference Signal Processing (Digital Tacho, DAQmx).vi", whose documentation I am reproducing in the following:
    <B>DESCRIPTIONS</B>:
    This VI demonstrates how to extract even angle reference signals and remove the slow-roll errors. It uses DAQmx VIs to acquire sound or vibration signals and a digital tachometer signal. This VI includes a two-step process: acquire data at low rotational speed to extract even angle reference; use the even angle reference to remove the errors in the vibration signal acquired at normal operation.
    <B>INSTRUCTIONS</B>:
    1. Run the VI.
    2. On the <B>DAQ Configurations</B> tab, specify the <B>sample rate</B>, <B>samples per channel</B>, device and channel configurations, and tachometer channel information.
    <B>NOTE</B>: You need to use DSA PXI-447x/PXI-446x and PXI TIO device in a PXI chassis to run this example. The DSA device must be in slot 2 of the PXI chassis.
    3. Switch to <B>Extract Even Angle Reference</B> tab. Specify the <B>number of samples to acquire</B> and the <B># of revs in reference</B> which determines the number of samples in even angle reference. Click <B>Start</B> to take a one-shot data acquisition of the vibration and tachometer signals. After the acquisition, you can see the extracted even angle references in <B>Even Angle Reference</B>.
    4. Switch to the <B>Remove Slow-roll Errors</B> tab. Click <B>Start</B> to acquire data continuously and view the compensate results. Click <B>Stop</B> in this tab to stop the acquisition.
    <B>ORDER ANALYSIS VIs USED IN THIS EXAMPLE</B>:
    1. SVL Scale Voltage to EU.vi
    2. OAT Digital Tacho Process.vi
    3. OAT Get Even Angle Reference.vi
    4. OAT Convert to Even Angle Signal.vi
    5. OAT Compensate Even Angle Signal.vi
    My question is: How is the synchronization produced at the time of the compensation ? How is it possible to eliminate the errors in a synchronized fashion with respect to the surface of the shaft bearing in mind that I am acquired data at a low rotation speed in order to get the "even angle reference" and then I use it to remove the errors in the vibration signal acquired at normal operation. In this application both operations are made in different acquisitions, therefore the reference of the correction signal is lost. Is it simply compensated without synchronizing ?
    Our application is based on FPGA and we need to clarity those aspects before implementing the procedure.
    Solved!
    Go to Solution.

    Hi CracKatoA.
    Take a look at the link bellow:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=255126&requireLogin=False
    Regards,
    Filipe Silva

Maybe you are looking for

  • How many discs should I have for OX 10.3.7?

    How many install discs come with OX 10.3.7? I'm wondering if I am missing one because I can't seem to find Safari on my disc and I need to reinstall it. I only have 2 discs Mac OS X Install Disc 1 and Apple Hardware Test AND 2. Mac OX 9 install disc.

  • Sales tax in PO but not included at the time of GR

    Hi, i have creted the PO including sales tax amount, is there any way when i post the GR against this PO the sales tax amount not calculated.

  • How to convert Date to String

    Hi All, I have a dimension member in my classic plannnig application whose datatype is Date, Now i want to use that member inside the following function: @TODATE(<date format goes here> , <date string goes here>); e.g @TODATE("mm-dd-yyyy" , "Dimensio

  • Iphone won`t start up

    Old Iphone mgs on screen restore needed wont turn up pls help. If i press restore i will lose all my contacts list and notes pls pls pls pls helpppppppppp

  • Linux+Netbeans+Commapi

    after following the installation instructions on this site: http://www.syngress.com/book_catalog/177_lego_JAVA/sample.htm and using this $java -jar -Djava.library.path=/usr/lib -cp . BlackBox finally the blackbox example using commapi is working Now