Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.ClassFab.createClass()


        cf.addMethod(
                Modifier.PUBLIC,
                new MethodSignature(int.class, "getIntValue", null, null),
                "return _intValue;");

        Class targetClass = cf.createClass();
        Constructor c = targetClass.getConstructors()[0];

        AbstractIntWrapper targetBean = (AbstractIntWrapper) c.newInstance(new Object[]
        { new Integer(137) });
View Full Code Here


    {
        ClassFab cf = newClassFab("InvalidSuperClass", List.class);

        try
        {
            cf.createClass();
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionSubstring(ex, "Unable to create class InvalidSuperClass");
View Full Code Here

        cf.addInterface(SimpleService.class);

        cf.addMethod(Modifier.PUBLIC, new MethodSignature(int.class, "add", new Class[]
        { int.class, int.class }, null), "return $1 + $2;");

        Class targetClass = cf.createClass();

        SimpleService s = (SimpleService) targetClass.newInstance();

        assertEquals(207, s.add(99, 108));
    }
View Full Code Here

    {
        ClassFab cf = newClassFab("StringSubclass", String.class);

        try
        {
            cf.createClass();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertExceptionRegexp(
                    ex,
View Full Code Here

    public void testInPackage() throws Exception
    {
        ClassFab cf = newClassFab("org.apache.hivemind.InPackage", Object.class);

        Class c = cf.createClass();

        Object o = c.newInstance();

        assertEquals("org.apache.hivemind.InPackage", o.getClass().getName());
    }
View Full Code Here

        classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceInterface, "_getInner",
                null, null), builder.toString());

        proxyBuilder.addServiceMethods("_getInner()");

        return classFab.createClass();
    }

    private Class createInnerProxyClass(Class deferredProxyClass)
    {
        ServicePoint servicePoint = getServicePoint();
View Full Code Here

        addServiceMethods(classFab, serviceInterface, factoryParameters.getServiceId(), jndiName);

        addConstructor(classFab);

        Class proxyClass = classFab.createClass();

        return invokeConstructor(proxyClass, proxyParameters.getNameLookup(_nameLookup));
    }

    private void addClearCachedMethod(ClassFab classFab)
View Full Code Here

                factoryParameters.getServiceId(),
                serviceInterface,
                propertyName,
                targetService);

        Class proxyClass = cf.createClass();

        try
        {
            return ConstructorUtils.invokeConstructor(proxyClass, new Object[]
            { targetService });
View Full Code Here

        classFab.addMethod(Modifier.PRIVATE, new MethodSignature(serviceInterface, "_getInner",
                null, null), builder.toString());

        proxyBuilder.addServiceMethods("_getInner()");

        return classFab.createClass();
    }

    private Class createInnerProxyClass(Class deferredProxyClass)
    {
        ServicePoint servicePoint = getServicePoint();
View Full Code Here

        classFab.addMethod(Modifier.PUBLIC | Modifier.FINAL, new MethodSignature(void.class,
                "_instantiateServiceImplementation", null, null), body.toString());

        classFab.addInterface(SingletonInnerProxy.class);

        return classFab.createClass();
    }

    public void instantiateService()
    {
        // Ensure that the outer and inner proxies have been created
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.