Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.SQLJJar


        AkibanInformationSchema outAIS = writeAndRead(inAIS);

        Routine proc = outAIS.getRoutine(SCHEMA, "PROC1");
        assertNotNull(proc);
       
        SQLJJar jar = proc.getSQLJJar();
        assertNotNull(jar);
        assertEquals("myjar", jar.getName().getTableName());
        assertEquals("http://example.com/procs.jar", jar.getURL().toString());

        assertEquals("java", proc.getLanguage());
        assertEquals(Routine.CallingConvention.JAVA, proc.getCallingConvention());
        assertEquals(3, proc.getParameters().size());
        assertEquals("x1", proc.getParameters().get(0).getName());
View Full Code Here


    @Override
    public ClassLoader loadSQLJJar(Session session, TableName jarName) {
        if (jarName == null)
            return getClass().getClassLoader();
        SQLJJar sqljJar = ais(session).getSQLJJar(jarName);
        if (sqljJar == null)
            throw new NoSuchSQLJJarException(jarName);
        long currentVersion = sqljJar.getVersion();
        synchronized (classLoaders) {
            VersionedItem<ClassLoader> entry = classLoaders.get(jarName);
            if ((entry != null) && (entry.version == currentVersion))
                return entry.item;
            ClassLoader loader = new URLClassLoader(new URL[] { sqljJar.getURL() });
            if (entry != null) {
                entry.item = loader;
            }
            else {
                entry = new VersionedItem<>(currentVersion, loader);
View Full Code Here

        }
    }

    @Override
    public void checkUnloadSQLJJar(Session session, TableName jarName) {
        SQLJJar sqljJar = ais(session).getSQLJJar(jarName);
        long currentVersion = -1;
        if (sqljJar != null)
            currentVersion = sqljJar.getVersion();
        synchronized (classLoaders) {
            VersionedItem<ClassLoader> entry = classLoaders.remove(jarName);
            if ((entry != null) && (entry.version == currentVersion)) {
                classLoaders.put(jarName, entry); // Was valid after all.
            }
View Full Code Here

        }
    }

    @Override
    public JarFile openSQLJJarFile(Session session, TableName jarName) throws IOException {
        SQLJJar sqljJar = ais(session).getSQLJJar(jarName);
        if (sqljJar == null)
            throw new NoSuchSQLJJarException(jarName);
        URL jarURL = new URL("jar:" + sqljJar.getURL() + "!/");
        return ((JarURLConnection)jarURL.openConnection()).getJarFile();
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.SQLJJar

Copyright © 2018 www.massapicom. 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.