commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rama <r...@meadwayholding.com>
Subject [modeler] issue while trying to register an object
Date Thu, 23 Jun 2011 10:52:33 GMT
Hello,

i am trying to learn modeler lib (commons-modeler-2.0.1) and i have do a couple of tests with
it.

I was pretty happy with it, but i have faced an issue with this object (see test class)

I got a "javax.management.RuntimeOperationsException: Field value invalid: name=" exception


Also, i have found that removing the method
public final T get() { return null; }

will solve the problem

Obviusly i can't remove the method with real-usage object :D


here is the test class, i have try to keep it small

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
package com.eg.util;

import org.apache.commons.modeler.Registry;

import java.util.Vector;

public abstract class Test<T extends Test.INNER> {

    private final Vector<T> inners;

    public static void main(String[] args) {
        new Test(1, "abcd", false) {
            @Override
            protected INNER make() {
                return null;
            }
        };
    }


    public Test(final long timeout, final String name, boolean log) {
        try {
            Registry.getRegistry(null, null).registerComponent(this, "com.eg.util:type=Test,name="
+ name, "Pool");
        } catch (Throwable e) {

        }
        inners = new Vector<T>(5);
    }

    protected abstract T make();

    public final T get() { return null; }


    static public class INNER {}
}

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message