Examples of Handle


Examples of org.ops4j.store.Handle

            .set(Constants.BUNDLE_SYMBOLICNAME, "org.ops4j.pax.exam.sample9.fragment")
            .add("messages.properties", getClass().getResource("/messages.properties"));

        try {
            Store<InputStream> store = StoreFactory.anonymousStore();
            Handle handle = store.store(bundle.build());
            return store.getLocation(handle).toURL();
        }
        catch (IOException e) {
            throw new TestContainerException(e);
        }
View Full Code Here

Examples of org.ow2.asm.Handle

        private static Handle getHandle(
            final String name,
            final String optArgs)
        {
            return new Handle(H_INVOKESTATIC,
                    "RT",
                    name,
                    "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;"
                            + optArgs + ")Ljava/lang/invoke/CallSite;");
        }
View Full Code Here

Examples of org.ow2.asm.Handle

                "java/lang/Object",
                null);

        mv = cw.visitMethod(ACC_PUBLIC, "foo", "()V", null, null);
        mv.visitCode();
        Handle h = new Handle(H_INVOKESTATIC,
                "C",
                "bsm",
                "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/CallSite;");
        mv.visitInvokeDynamicInsn("bar", "()V", h, Type.getType("()V"), h);
        mv.visitInsn(RETURN);
View Full Code Here

Examples of org.ow2.asm.Handle

        } else if (cst instanceof String) {
            appendString(buf, (String) cst);
        } else if (cst instanceof Type) {
            buf.append("Type.getType(\"").append(cst).append("\")");
        } else if (cst instanceof Handle) {
            Handle h = (Handle) cst;
            buf.append("new Handle(").append(h.getTag()).
                append(", \"").append(h.getOwner()).
                append("\", \"").append(h.getName()).
                append("\", \"").append(h.getDesc()).append("\")");
        } else {
            buf.append(cst);
        }
    }
View Full Code Here

Examples of org.ow2.asm.Handle

        assertEquals(INVOKESPECIAL, mn.getOpcode());
        assertEquals(AbstractInsnNode.METHOD_INSN, mn.getType());
    }

    public void testInvokeDynamicInsnNode() {
        Handle bsm = new Handle(Opcodes.H_INVOKESTATIC, "owner", "name", "()V");
        InvokeDynamicInsnNode mn = new InvokeDynamicInsnNode(
                "name",
                "()V",
                bsm,
                new Object[0]);
View Full Code Here

Examples of org.ow2.asm.Handle

                int tag = Integer.parseInt(val.substring(tagIndex + 1, val.length() - 1));
                String owner = val.substring(0, dotIndex);
                String name = val.substring(dotIndex + 1, descIndex);
                String desc = val.substring(descIndex, tagIndex - 1);
                return new Handle(tag, owner, name, desc);

            } catch(RuntimeException e) {
                throw new SAXException("Malformed handle "+val, e);
            }
        }
View Full Code Here

Examples of org.ow2.asm.Handle

        }

        @Override
        public final void end(final String element) {
            ArrayList<?> bsmArgs = (ArrayList<?>)pop();
            Handle bsm = (Handle)pop();
            String desc = (String)pop();
            String name = (String)pop();
            getCodeVisitor().visitInvokeDynamicInsn(name, desc, bsm, bsmArgs.toArray());
        }
View Full Code Here

Examples of org.ow2.asm.Handle

    private void addConstant(final Object cst) {
        if (cst instanceof Type) {
            addType((Type) cst);
        } else if (cst instanceof Handle) {
            Handle h = (Handle) cst;
            addInternalName(h.getOwner());
            addMethodDesc(h.getDesc());
        }
    }
View Full Code Here

Examples of org.skife.jdbi.Handle

        pf.setProxyTargetClass(false);
        pf.setInterfaces(new Class[] {Handle.class});
        pf.setTarget(handle);
        pf.addAdvice(new SQLExceptionTranslatingThrowsAdvice(dataSource));

        Handle proxy = (Handle)pf.getProxy();

        return proxy;
    }
View Full Code Here

Examples of org.skife.jdbi.v2.Handle

        return new StringTemplateStatementLocator(loader);
    }

    public void testSimpleTemplate() throws Exception
    {
        final Handle h = openHandle();
        final int count = h.insert("tests:insert_one");
        assertEquals(1, count);
    }
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.